X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fchap_ms.c;h=2dde5ba76b60a3dbb297ffce23480175edecc1ac;hp=a489cc0d111aae8d61af1aed4432b06ddd5ce574;hb=5d490c4106f4a34864c980b925e183cf3bf575e2;hpb=71d3de90eae52087b405e962ca650b71cec79c67 diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c index a489cc0..2dde5ba 100644 --- a/pppd/chap_ms.c +++ b/pppd/chap_ms.c @@ -74,7 +74,7 @@ * */ -#define RCSID "$Id: chap_ms.c,v 1.29 2003/06/11 23:56:26 paulus Exp $" +#define RCSID "$Id: chap_ms.c,v 1.30 2003/07/10 17:59:33 fcusack Exp $" #ifdef CHAPMS @@ -186,17 +186,18 @@ chapms_verify_response(int id, char *name, unsigned char *challenge, unsigned char *response, char *message, int message_space) { - MS_ChapResponse *rmd = (MS_ChapResponse *) response; + MS_ChapResponse *rmd; MS_ChapResponse md; int diff; int challenge_len, response_len; challenge_len = *challenge++; /* skip length, is 8 */ - response_len = *response++; if (response_len != MS_CHAP_RESPONSE_LEN) goto bad; + rmd = (MS_ChapResponse *) response; + #ifndef MSLANMAN if (!rmd->UseNT[0]) { /* Should really propagate this into the error packet. */ @@ -235,7 +236,7 @@ chapms2_verify_response(int id, char *name, unsigned char *challenge, unsigned char *response, char *message, int message_space) { - MS_Chap2Response *rmd = (MS_Chap2Response *) response; + MS_Chap2Response *rmd; MS_Chap2Response md; char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; int challenge_len, response_len; @@ -245,6 +246,8 @@ chapms2_verify_response(int id, char *name, if (response_len != MS_CHAP2_RESPONSE_LEN) goto bad; /* not even the right length */ + rmd = (MS_Chap2Response *) response; + /* Generate the expected response and our mutual auth. */ ChapMS2(challenge, rmd->PeerChallenge, name, secret, secret_len, &md,