From 9836a38f7b26c037724fe539901251dc9d862668 Mon Sep 17 00:00:00 2001 From: John Polstra Date: Sun, 11 Oct 1998 19:40:38 +0000 Subject: [PATCH] Fix the MS-CHAP support. The code was passing a bit count to MD4Update(), but our version in libmd expects a byte count. This code is not currently compiled or linked into pppd, so I'm reasonably sure I didn't break anything. :-) I added the necessary statements to the Makefile, but left them commented out because we are in feature freeze. When the code is enabled, we must be careful to build it only if the DES library is available. --- usr.sbin/pppd/Makefile | 8 +++++++- usr.sbin/pppd/chap_ms.c | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pppd/Makefile b/usr.sbin/pppd/Makefile index 1e6b85e8cc21..323cc0dc45ad 100644 --- a/usr.sbin/pppd/Makefile +++ b/usr.sbin/pppd/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.10 1997/10/10 11:59:02 peter Exp $ +# $Id: Makefile,v 1.11 1998/09/19 22:42:11 obrien Exp $ CFLAGS+= -DHAVE_PATHS_H @@ -27,4 +27,10 @@ CFLAGS+=-DPPP_FILTER LDADD+= -lpcap DPADD+= ${LIBPCAP} +# MS-CHAP support. Requires the DES library. +#CFLAGS+=-DCHAPMS +#SRCS+= chap_ms.c +#LDADD+= -ldes +#DPADD+= ${LIBDES} + .include diff --git a/usr.sbin/pppd/chap_ms.c b/usr.sbin/pppd/chap_ms.c index 343f462d6aba..3b2ed896bf70 100644 --- a/usr.sbin/pppd/chap_ms.c +++ b/usr.sbin/pppd/chap_ms.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chap_ms.c,v 1.4 1998/03/22 05:32:48 peter Exp $"; +static char rcsid[] = "$Id: chap_ms.c,v 1.5 1998/06/20 18:02:09 peter Exp $"; #endif #ifdef CHAPMS @@ -266,7 +266,7 @@ ChapMS_NT(rchallenge, rchallenge_len, secret, secret_len, response) unicodePassword[i * 2] = (u_char)secret[i]; MD4Init(&md4Context); - MD4Update(&md4Context, unicodePassword, secret_len * 2 * 8); /* Unicode is 2 bytes/char, *8 for bit count */ + MD4Update(&md4Context, unicodePassword, secret_len * 2); /* Unicode is 2 bytes/char */ MD4Final(hash, &md4Context); /* Tell MD4 we're done */