]> git.ozlabs.org Git - ppp.git/commitdiff
Compiling with --enable-mslanman is broken
authorEivind Næss <eivnaes@yahoo.com>
Fri, 10 Mar 2023 00:20:03 +0000 (00:20 +0000)
committerEivind Næss <eivnaes@yahoo.com>
Fri, 17 Mar 2023 14:17:41 +0000 (14:17 +0000)
Correcting the call to DesEncrypt() where needed.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
pppd/chap_ms.c

index 6b2a0261c2c8141e01912419b77cd153b01ddad0..e3d808fd86ccb094cead86629234c3da6c54cdee 100644 (file)
@@ -654,11 +654,12 @@ ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len,
     BZERO(UcasePassword, sizeof(UcasePassword));
     for (i = 0; i < secret_len; i++)
        UcasePassword[i] = (u_char)toupper(secret[i]);
-    (void) DesSetkey(UcasePassword + 0);
-    DesEncrypt( StdText, PasswordHash + 0 );
-    (void) DesSetkey(UcasePassword + 7);
-    DesEncrypt( StdText, PasswordHash + 8 );
-    ChallengeResponse(rchallenge, PasswordHash, &response[MS_CHAP_LANMANRESP]);
+
+    if (DesEncrypt(StdText, UcasePassword + 0, PasswordHash + 0) &&
+        DesEncrypt(StdText, UcasePassword + 7, PasswordHash + 8)) {
+
+        ChallengeResponse(rchallenge, PasswordHash, &response[MS_CHAP_LANMANRESP]);
+    }
 }
 #endif