From: Eivind Næss Date: Sun, 14 Mar 2021 23:20:29 +0000 (-0700) Subject: pppd: Fix logical error in comparing valid encryption policies (#262) X-Git-Tag: ppp-2.5.0~82 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=e609ed8bb62e4648568eaa49fbbc858dfda6d122;p=ppp.git pppd: Fix logical error in comparing valid encryption policies (#262) 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 --- diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c index e6b84f2..df2dadd 100644 --- a/pppd/chap_ms.c +++ b/pppd/chap_ms.c @@ -953,7 +953,7 @@ void 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;