Initialize memory in password hashing

The authentication code did not initialize one of the buffers used to
calculate the password hashes. This resulted in the use of uninitialized
memory when the user provided no password.
This commit is contained in:
Markus Mäkelä 2018-11-28 00:15:57 +02:00
parent 631711f2bf
commit 24d1876ed4
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -220,7 +220,7 @@ static bool check_password(const char *output, uint8_t *token, size_t token_len,
/** Next, extract the SHA1 of the real password by XOR'ing it with
* the output of the previous calculation */
uint8_t step2[SHA_DIGEST_LENGTH];
uint8_t step2[SHA_DIGEST_LENGTH] = {};
gw_str_xor(step2, token, step1, token_len);
/** The phase 2 scramble needs to be copied to the shared data structure as it