[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

anyone use CHAP with pppd?



If so, could you try the following patch and verify that it does not
break anything?  Patch is relative to -current but it should apply
to vanilla 2.3 as well.

 - todd

Index: chap.c
===================================================================
RCS file: /cvs/src/usr.sbin/pppd/chap.c,v
retrieving revision 1.7
diff -u -r1.7 chap.c
--- chap.c	1998/01/17 20:30:19	1.7
+++ chap.c	1998/07/03 02:09:02
@@ -460,7 +460,7 @@
 	MD5Update(&mdContext, &cstate->resp_id, 1);
 	MD5Update(&mdContext, secret, secret_len);
 	MD5Update(&mdContext, rchallenge, rchallenge_len);
-	MD5Final(hash, &mdContext);
+	MD5End(&mdContext, hash);
 	BCOPY(hash, cstate->response, MD5_SIGNATURE_SIZE);
 	cstate->resp_length = MD5_SIGNATURE_SIZE;
 	break;
@@ -570,7 +570,7 @@
 	    MD5Update(&mdContext, &cstate->chal_id, 1);
 	    MD5Update(&mdContext, secret, secret_len);
 	    MD5Update(&mdContext, cstate->challenge, cstate->chal_len);
-	    MD5Final(hash, &mdContext);
+	    MD5End(&mdContext, hash);
 
 	    /* compare local and remote MDs and send the appropriate status */
 	    if (memcmp (hash, remmd, MD5_SIGNATURE_SIZE) == 0)
Index: chap_ms.c
===================================================================
RCS file: /cvs/src/usr.sbin/pppd/chap_ms.c,v
retrieving revision 1.5
diff -u -r1.5 chap_ms.c
--- chap_ms.c	1998/05/08 04:52:22	1.5
+++ chap_ms.c	1998/07/03 02:09:04
@@ -274,7 +274,7 @@
     MD4Init(&md4Context);
     MD4Update(&md4Context, unicodePassword, secret_len * 2 * 8);	/* Unicode is 2 bytes/char, *8 for bit count */
 
-    MD4Final(hash, &md4Context);	/* Tell MD4 we're done */
+    MD4End(&md4Context, hash);	/* Tell MD4 we're done */
 
     ChallengeResponse(rchallenge, hash, response->NTResp);
 }