! fixed: MS-CHAP MPPE key is not generated if authenticated with ntlm_auth
author3APA3A <3APA3A>
Fri, 17 Sep 2004 08:20:45 +0000 (08:20 +0000)
committer3APA3A <3APA3A>
Fri, 17 Sep 2004 08:20:45 +0000 (08:20 +0000)
src/modules/rlm_mschap/rlm_mschap.c

index 9bebcc2..9ed65a8 100644 (file)
@@ -1294,22 +1294,23 @@ static int mschap_authenticate(void * instance, REQUEST *request)
                                memcpy(mppe_sendkey, lm_password->strvalue, 8);
                        }
 
-                       if (nt_password) {
-                               /*
-                                *      According to RFC 2548 we
-                                *      should send NT hash.  But in
-                                *      practice it doesn't work.
-                                *      Instead, we should send nthashhash
-                                *
-                                *      This is an error on RFC 2548.
-                                */
-                               memcpy(mppe_sendkey + 8,
-                                      nthashhash, 16);
-                               mppe_add_reply(&request->reply->vps,
-                                              "MS-CHAP-MPPE-Keys",
-                                              mppe_sendkey, 32);
-                       }
-
+                       /*
+                        *      According to RFC 2548 we
+                        *      should send NT hash.  But in
+                        *      practice it doesn't work.
+                        *      Instead, we should send nthashhash
+                        *
+                        *      This is an error on RFC 2548.
+                        */
+                       /*
+                        *      do_mschap cares to zero nthashhash if NT hash
+                        *      is not available.
+                        */
+                       memcpy(mppe_sendkey + 8,
+                              nthashhash, 16);
+                       mppe_add_reply(&request->reply->vps,
+                                      "MS-CHAP-MPPE-Keys",
+                                      mppe_sendkey, 32);
                } else if (chap == 2) {
                        DEBUG2("rlm_mschap: adding MS-CHAPv2 MPPE keys");
                        mppe_chap2_gen_keys128(nthashhash,