3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-24 06:52:37 +01:00

mschaputil: Rearrange ops to fail early

This commit is contained in:
Tim Kourt 2019-01-10 14:34:21 -08:00 committed by Denis Kenzior
parent cd00416168
commit c8f071c67c

View File

@ -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;