]> git.ozlabs.org Git - ppp.git/commitdiff
Fix bug in CHAP MS v2 handling where we didn't zero enough.
authorPaul Mackerras <paulus@samba.org>
Tue, 19 Dec 2006 08:38:14 +0000 (08:38 +0000)
committerPaul Mackerras <paulus@samba.org>
Tue, 19 Dec 2006 08:38:14 +0000 (08:38 +0000)
Changing the response parameter of the ChapMS2 function to an
unsigned char * meant that using sizeof(*response) in a BZERO call
was no longer correct.  Instead we need to use MS_CHAP2_RESPONSE_LEN.
Patch from Guillaume Knispel.

pppd/chap_ms.c

index 75724c514b0946ad24e7c06d52bcf3eff9eca996..b8feeb825cb61974636580dfeb13b7a58faba7e6 100644 (file)
@@ -74,7 +74,7 @@
  *
  */
 
-#define RCSID  "$Id: chap_ms.c,v 1.36 2006/05/21 11:56:40 paulus Exp $"
+#define RCSID  "$Id: chap_ms.c,v 1.37 2006/12/19 08:38:14 paulus Exp $"
 
 #ifdef CHAPMS
 
@@ -852,7 +852,7 @@ ChapMS2(u_char *rchallenge, u_char *PeerChallenge,
     u_char *p = &response[MS_CHAP2_PEER_CHALLENGE];
     int i;
 
-    BZERO(response, sizeof(*response));
+    BZERO(response, MS_CHAP2_RESPONSE_LEN);
 
     /* Generate the Peer-Challenge if requested, or copy it if supplied. */
     if (!PeerChallenge)