]> git.ozlabs.org Git - ppp.git/commitdiff
Corrected Linux MPPE kernel modules (Frank Cusack)
authorDavid F. Skoll <dfs@roaringpenguin.com>
Tue, 2 Apr 2002 14:15:07 +0000 (14:15 +0000)
committerDavid F. Skoll <dfs@roaringpenguin.com>
Tue, 2 Apr 2002 14:15:07 +0000 (14:15 +0000)
Corrected minor bug in chap.c (Frank Cusack)
Allow domain\user in MSCHAPv2 (Frank Cusack)

pppd/chap.c
pppd/chap_ms.c

index 114ed4d6bbfd7e05ee64a7b82d58d21309f3017e..a9dc78cdc91d887feb06e1bd6c36fd39e2b86332 100644 (file)
@@ -33,7 +33,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define RCSID  "$Id: chap.c,v 1.30 2002/04/02 13:54:59 dfs Exp $"
+#define RCSID  "$Id: chap.c,v 1.31 2002/04/02 14:15:07 dfs Exp $"
 
 /*
  * TODO:
 
 /*
  * TODO:
@@ -648,8 +648,9 @@ ChapReceiveResponse(cstate, inp, id, len)
                ChapMS(cstate, cstate->challenge, secret, secret_len, &md);
 
                /* compare MDs and send the appropriate status */
                ChapMS(cstate, cstate->challenge, secret, secret_len, &md);
 
                /* compare MDs and send the appropriate status */
-               if (memcmp(&md + response_offset,
-                          remmd + response_offset, response_size) == 0)
+               if (memcmp((u_char *) &md + response_offset,
+                          (u_char *) remmd + response_offset,
+                          response_size) == 0)
                    code = CHAP_SUCCESS;        /* they are the same! */
                break;
            }
                    code = CHAP_SUCCESS;        /* they are the same! */
                break;
            }
index 318c0b60559f0706535cb161fb38bd86b256d627..0f627fb5aedc8f5ac99428b7cd9ce0c89452890e 100644 (file)
@@ -40,7 +40,7 @@
  *   Copyright (c) 2002 Google, Inc.
  */
 
  *   Copyright (c) 2002 Google, Inc.
  */
 
-#define RCSID  "$Id: chap_ms.c,v 1.19 2002/04/02 13:54:59 dfs Exp $"
+#define RCSID  "$Id: chap_ms.c,v 1.20 2002/04/02 14:15:07 dfs Exp $"
 
 #ifdef CHAPMS
 
 
 #ifdef CHAPMS
 
@@ -261,11 +261,18 @@ ChallengeHash(u_char PeerChallenge[16], u_char *rchallenge,
 {
     SHA1_CTX   sha1Context;
     u_char     sha1Hash[SHA1_SIGNATURE_SIZE];
 {
     SHA1_CTX   sha1Context;
     u_char     sha1Hash[SHA1_SIGNATURE_SIZE];
+    char       *user;
+
+    /* remove domain from "domain\username" */
+    if ((user = strrchr(username, '\\')) != NULL)
+       ++user;
+    else
+       user = username;
 
     SHA1_Init(&sha1Context);
     SHA1_Update(&sha1Context, PeerChallenge, 16);
     SHA1_Update(&sha1Context, rchallenge, 16);
 
     SHA1_Init(&sha1Context);
     SHA1_Update(&sha1Context, PeerChallenge, 16);
     SHA1_Update(&sha1Context, rchallenge, 16);
-    SHA1_Update(&sha1Context, username, strlen(username));
+    SHA1_Update(&sha1Context, user, strlen(user));
     SHA1_Final(sha1Hash, &sha1Context);
 
     BCOPY(sha1Hash, Challenge, 8);
     SHA1_Final(sha1Hash, &sha1Context);
 
     BCOPY(sha1Hash, Challenge, 8);