mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-18 01:59:31 +01:00
mschaputil: Rearrange ops to fail early
This commit is contained in:
parent
cd00416168
commit
c8f071c67c
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user