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.
This commit is contained in:
jdp 1998-10-11 19:40:38 +00:00
parent 08f362578e
commit fe65a276d6
2 changed files with 9 additions and 3 deletions

View File

@ -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 <bsd.prog.mk>

View File

@ -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 */