From 14b5af09f0a70c5f6e6a3d2de11e578616a2ac85 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Wed, 11 Jun 2003 23:50:53 +0000 Subject: [PATCH] Fix a bug where we would keep asking for MS-CHAP v2 even though the peer NAK'd with MD5. --- pppd/lcp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pppd/lcp.c b/pppd/lcp.c index eabdfba..cf2f46d 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: lcp.c,v 1.67 2003/05/09 11:49:46 carlsonj Exp $" +#define RCSID "$Id: lcp.c,v 1.68 2003/06/11 23:50:53 paulus Exp $" /* * TODO: @@ -1029,6 +1029,10 @@ lcp_nakci(f, p, len) try.neg = 0; \ } + /* + * NOTE! There must be no assignments to individual fields of *go in + * the code below. Any such assignment is a BUG! + */ /* * We don't care if they want to send us smaller packets than * we want. Therefore, accept any MRU less than what we asked for, @@ -1089,7 +1093,7 @@ lcp_nakci(f, p, len) try.neg_eap = 0; /* Try to set up to use their suggestion, if possible */ if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) - go->chap_mdtype = CHAP_MDTYPE_D(cichar); + try.chap_mdtype = CHAP_MDTYPE_D(cichar); } else if (go->neg_chap) { /* * We were asking for our preferred algorithm, they must @@ -1098,7 +1102,7 @@ lcp_nakci(f, p, len) if (cichar != CHAP_DIGEST(go->chap_mdtype)) { if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { /* Use their suggestion if we support it ... */ - go->chap_mdtype = CHAP_MDTYPE_D(cichar); + try.chap_mdtype = CHAP_MDTYPE_D(cichar); } else { /* ... otherwise, try our next-preferred algorithm. */ try.chap_mdtype &= ~(CHAP_MDTYPE(try.chap_mdtype)); -- 2.39.2