From c8f071c67c14d16fb12eca6553488ed8f2a19942 Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Thu, 10 Jan 2019 14:34:21 -0800 Subject: [PATCH] mschaputil: Rearrange ops to fail early --- src/mschaputil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mschaputil.c b/src/mschaputil.c index b4a4b6bd..39edddf3 100644 --- a/src/mschaputil.c +++ b/src/mschaputil.c @@ -182,13 +182,13 @@ bool mschapv2_generate_nt_response(const uint8_t password_hash[static 16], uint8_t challenge[8]; uint8_t buffer[21]; - memset(buffer, 0, sizeof(buffer)); - memcpy(buffer, password_hash, 16); - if (!mschapv2_challenge_hash(peer_challenge, server_challenge, user, challenge)) return false; + memset(buffer, 0, sizeof(buffer)); + memcpy(buffer, password_hash, 16); + if (!mschap_des_encrypt(challenge, buffer + 0, response + 0)) return false;