summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/chap.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-11-07 23:19:11 +0000
committerbrian <brian@FreeBSD.org>2000-11-07 23:19:11 +0000
commit34d0ad4986a2d93f4c82f3a76e6f76f284c9e7a4 (patch)
treec6235cde408dda01abf7c7817f6b472e631061ab /usr.sbin/ppp/chap.c
parent3e6dc67f1fc629ceacdf110524b175b0910a7093 (diff)
downloadFreeBSD-src-34d0ad4986a2d93f4c82f3a76e6f76f284c9e7a4.zip
FreeBSD-src-34d0ad4986a2d93f4c82f3a76e6f76f284c9e7a4.tar.gz
Introduce another global (MPPE_IsServer) so that we initiate the
MPPE session keys correctly. I'm a bit dubious about this code. It seems that the session keys are initialised differently based on whether you're the client or the server. One side is the server if it issues the first challenge, but of course you can issue a challenge from both sides.... at the same time. Sounds like another wonderful M$ assumption... Ppp can now talk to itself correctly using encryption. Problem solved by: Ustimenko Semen <semen@iclub.nsu.ru> Hair torn out by: me
Diffstat (limited to 'usr.sbin/ppp/chap.c')
-rw-r--r--usr.sbin/ppp/chap.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c
index be41362..437fbc1 100644
--- a/usr.sbin/ppp/chap.c
+++ b/usr.sbin/ppp/chap.c
@@ -203,7 +203,7 @@ chap_BuildAnswer(char *name, char *key, u_char id, char *challenge, u_char type
expkey, klen * 2, ntresponse);
/* Generate MPPE MASTERKEY */
- GetMasterKey(pwdhashhash, ntresponse, MPPE_MasterKey);
+ GetMasterKey(pwdhashhash, ntresponse, MPPE_MasterKey); /* XXX Global ! */
/* Generate AUTHRESPONSE to verify on auth success */
GenerateAuthenticatorResponse(expkey, klen * 2, ntresponse,
@@ -371,6 +371,7 @@ chap_Respond(struct chap *chap, char *name, char *key, u_char type
ans, *ans + 1 + strlen(name), name);
#ifdef HAVE_DES
chap->NTRespSent = !lm;
+ MPPE_IsServer = 0; /* XXX Global ! */
#endif
free(ans);
} else
@@ -536,7 +537,7 @@ chap_Success(struct authinfo *authp)
#ifdef HAVE_DES
if (authp->physical->link.lcp.want_authtype == 0x81) {
msg = auth2chap(authp)->authresponse;
- MPPE_MasterKeyValid = 1;
+ MPPE_MasterKeyValid = 1; /* XXX Global ! */
} else
#endif
msg = "Welcome!!";
@@ -857,9 +858,11 @@ chap_Input(struct bundle *bundle, struct link *l, struct mbuf *bp)
p->link.lcp.want_authtype
#ifdef HAVE_DES
, chap->challenge.peer,
- chap->authresponse, lanman
-#endif
+ chap->authresponse, lanman);
+ MPPE_IsServer = 1; /* XXX Global ! */
+#else
);
+#endif
if (myans == NULL)
key = NULL;
else {
@@ -896,7 +899,7 @@ chap_Input(struct bundle *bundle, struct link *l, struct mbuf *bp)
} else {
/* Successful login */
- MPPE_MasterKeyValid = 1;
+ MPPE_MasterKeyValid = 1; /* XXX Global ! */
datalink_AuthOk(p->dl);
}
} else
OpenPOWER on IntegriCloud