]> git.ozlabs.org Git - ppp.git/commitdiff
Merge pull request #409 from enaess/conf-fixes
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 17 Mar 2023 23:22:33 +0000 (10:22 +1100)
committerGitHub <noreply@github.com>
Fri, 17 Mar 2023 23:22:33 +0000 (10:22 +1100)
Additional fixes for various configure options (less frequently used) that broke

pppd/chap_ms.c
pppd/options.c
pppd/plugins/radius/radius.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
 
index 214adaeca455dcb5638f87d4c541e6300136f748..42e39b8ea96c53950c71c69218d5a5803f2749c4 100644 (file)
@@ -452,9 +452,11 @@ ppp_get_path(ppp_path_t type, char *buf, size_t bufsz)
         case PPP_DIR_RUNTIME:
             path = PPP_PATH_VARRUN;
             break;
+#ifdef PPP_WITH_PLUGINS
         case PPP_DIR_PLUGIN:
             path = PPP_PATH_PLUGIN;
             break;
+#endif
         case PPP_DIR_CONF:
             path = PPP_PATH_CONFDIR;
             break;
@@ -477,10 +479,12 @@ ppp_get_filepath(ppp_path_t type, const char *name, char *buf, size_t bufsz)
         case PPP_DIR_RUNTIME:
             path = PPP_PATH_VARRUN;
             break;
+#ifdef PPP_WITH_PLUGINS
         case PPP_DIR_PLUGIN:
             path = PPP_PATH_PLUGIN;
             break;
-        case PPP_DIR_CONF:
+#endif
+       case PPP_DIR_CONF:
             path = PPP_PATH_CONFDIR;
             break;
         }
index 11cf27cfdd9dc023750d62685b3c5c5fe181f8e4..c73ca0b53ef82b07932fa304d667ff22e0d7db7a 100644 (file)
@@ -44,9 +44,9 @@ static char const RCSID[] =
 #include <pppd/chap_ms.h>
 #ifdef PPP_WITH_MPPE
 #include <pppd/mppe.h>
-#include <pppd/crypto.h>
 #endif
 #endif
+#include <pppd/crypto.h>
 #include <pppd/fsm.h>
 #include <pppd/ipcp.h>