]> git.ozlabs.org Git - ppp.git/commitdiff
pppd: Fix logical error in comparing valid encryption policies (#262)
authorEivind Næss <eivnaes@yahoo.com>
Sun, 14 Mar 2021 23:20:29 +0000 (16:20 -0700)
committerGitHub <noreply@github.com>
Sun, 14 Mar 2021 23:20:29 +0000 (10:20 +1100)
RFC2548 describes the proper values of the MS-MPPE-Encryption-Policy attribute.
and it can only hold 2 values: 1 (encryption allowed) and 2 (encryption required).

See
   https://tools.ietf.org/html/rfc2548, section 2.4.4

The correct comparison should be made with an && and not a ||.

This fixes github issue #218

Signed-off-by: Eivind Naess <eivnaes@yahoo.com>
pppd/chap_ms.c

index e6b84f203fc3fc2f62ca2a471b17e11d8422e975..df2dadd1220efcf354ebc0d628c5c7700f5a99ab 100644 (file)
@@ -953,7 +953,7 @@ void
 set_mppe_enc_types(int policy, int types)
 {
     /* Early exit for unknown policies. */
 set_mppe_enc_types(int policy, int types)
 {
     /* Early exit for unknown policies. */
-    if (policy != MPPE_ENC_POL_ENC_ALLOWED ||
+    if (policy != MPPE_ENC_POL_ENC_ALLOWED &&
        policy != MPPE_ENC_POL_ENC_REQUIRED)
        return;
 
        policy != MPPE_ENC_POL_ENC_REQUIRED)
        return;