]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Check nt_password_hash() return code
authorJouni Malinen <j@w1.fi>
Sun, 4 Dec 2011 14:59:16 +0000 (16:59 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 4 Dec 2011 14:59:16 +0000 (16:59 +0200)
While this is unlikely to fail in practice, better be more consistent
in validating nt_password_hash() result.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/eap_server/eap_server_mschapv2.c

index 64120a4f9b7475aa5a3299109e0542c1621eb7ad..f5ee7f41243d504a6867c2669487f6c7fab76165 100644 (file)
@@ -405,9 +405,12 @@ static void eap_mschapv2_process_response(struct eap_sm *sm,
                if (sm->user->password_hash) {
                        pw_hash = sm->user->password;
                } else {
-                       nt_password_hash(sm->user->password,
-                                        sm->user->password_len,
-                                        pw_hash_buf);
+                       if (nt_password_hash(sm->user->password,
+                                            sm->user->password_len,
+                                            pw_hash_buf) < 0) {
+                               data->state = FAILURE;
+                               return;
+                       }
                        pw_hash = pw_hash_buf;
                }
                generate_authenticator_response_pwhash(