commit c8f071c67c14d16fb12eca6553488ed8f2a19942
parent cd00416168839fa14b4f10bca32125439f9a1d2d
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date: Thu, 10 Jan 2019 14:34:21 -0800
mschaputil: Rearrange ops to fail early
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git 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;