]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
find_lm_password and find_nt_password report failure to find password attributes
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 30 Sep 2018 16:07:46 +0000 (00:07 +0800)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 30 Sep 2018 16:07:46 +0000 (00:07 +0800)
src/modules/rlm_mschap/rlm_mschap.c

index 34b13d7fd48304ff5fc88dcb11a0b134054a884d..1558d32d2411a1484fb2575df8f1491d4ed29ecf 100644 (file)
@@ -1428,6 +1428,8 @@ static bool CC_HINT(nonnull (1, 2, 4)) find_nt_password(rlm_mschap_t const *inst
 {
        VALUE_PAIR *nt_password;
 
+       *ntpw = NULL;   /* Init output pointer */
+
        /*
         *      Look for NT-Password...
         */
@@ -1473,7 +1475,17 @@ static bool CC_HINT(nonnull (1, 2, 4)) find_nt_password(rlm_mschap_t const *inst
                                return false;
                        }
                } else if (inst->method == AUTH_INTERNAL) {
+               /*
+                *      If we're doing internal auth, then this is an issue
+                */
                        RWDEBUG2("No Cleartext-Password configured.  Cannot create NT-Password");
+                       return false;
+
+               /*
+                *      ..if we're not, then we can call out to external sources.
+                */
+               } else {
+                       return false;
                }
        }
 
@@ -1494,6 +1506,8 @@ static bool CC_HINT(nonnull (1, 2, 5)) find_lm_password(rlm_mschap_t const *inst
 {
        VALUE_PAIR *lm_password;
 
+       *lmpw = NULL;   /* Init output pointer */
+
        lm_password = fr_pair_find_by_da(request->control, attr_lm_password, TAG_ANY);
        if (lm_password) {
                VP_VERIFY(lm_password);
@@ -1535,12 +1549,16 @@ static bool CC_HINT(nonnull (1, 2, 5)) find_lm_password(rlm_mschap_t const *inst
                /*
                 *      Only complain if we don't have NT-Password
                 */
-               } else if (inst->method == AUTH_INTERNAL && !nt_password) {
+               } else if ((inst->method == AUTH_INTERNAL) && !nt_password) {
                        RWDEBUG2("No Cleartext-Password configured.  Cannot create LM-Password");
+                       return false;
+               } else {
+                       return false;
                }
        }
 
        *lmpw = lm_password;
+
        return true;
 }