summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/lcp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-09-25 00:52:37 +0000
committerbrian <brian@FreeBSD.org>1997-09-25 00:52:37 +0000
commit4c4910184f1f2da40f3c2c67f88b7104873af74f (patch)
tree37ef470f53f5dcf8862dea9118e58a470a1d431e /usr.sbin/ppp/lcp.c
parent92277fa474d464011e3bfb7177f8a1c51d582404 (diff)
downloadFreeBSD-src-4c4910184f1f2da40f3c2c67f88b7104873af74f.zip
FreeBSD-src-4c4910184f1f2da40f3c2c67f88b7104873af74f.tar.gz
Allow Microsoft CHAP authentication.
This is a combination of MD4 & DES. Submitted by: Gabor Kincses <gabor@acm.org>
Diffstat (limited to 'usr.sbin/ppp/lcp.c')
-rw-r--r--usr.sbin/ppp/lcp.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index 31fafca..aa6c619 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lcp.c,v 1.33 1997/09/22 23:59:14 brian Exp $
+ * $Id: lcp.c,v 1.34 1997/09/23 19:52:14 brian Exp $
*
* TODO:
* o Validate magic number received from peer.
@@ -291,7 +291,11 @@ LcpSendConfigReq(struct fsm * fp)
break;
case PROTO_CHAP:
PutConfValue(&cp, cftypes, TY_AUTHPROTO, 5, lcp->want_auth);
- *cp++ = 5; /* Use MD4/MD5 */
+#ifdef HAVE_DES
+ *cp++ = VarMSChap ? 0x80 : 0x05; /* Use MSChap vs. RFC 1994 (MD5) */
+#else
+ *cp++ = 0x05; /* Use MD5 */
+#endif
break;
}
FsmOutput(fp, CODE_CONFIGREQ, fp->reqid++, ReqBuff, cp - ReqBuff);
@@ -510,10 +514,18 @@ LcpDecodeConfig(u_char * cp, int plen, int mode)
LogPrintf(LogLCP, " %s bad length (%d)\n", request, length);
goto reqreject;
}
- if (Acceptable(ConfChap) && cp[4] == 5) {
+#ifdef HAVE_DES
+ if (Acceptable(ConfChap) && (cp[4] == 5 || cp[4] == 0x80))
+#else
+ if (Acceptable(ConfChap) && cp[4] == 5)
+#endif
+ {
LcpInfo.his_auth = proto;
bcopy(cp, ackp, length);
ackp += length;
+#ifdef HAVE_DES
+ VarMSChap = cp[4] = 0x80;
+#endif
} else if (Acceptable(ConfPap)) {
*nakp++ = *cp;
*nakp++ = 4;
OpenPOWER on IntegriCloud