Make crypto_hash_init() easier for static analyzers
Avoid zero-length memset at the end of the buffer. This is not really needed, but it makes the code a bit easier for static analyzers. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
16cc7a4304
commit
911e10eac6
1 changed files with 2 additions and 1 deletions
|
@ -63,6 +63,7 @@ struct crypto_hash * crypto_hash_init(enum crypto_hash_alg alg, const u8 *key,
|
|||
ctx->key_len = key_len;
|
||||
|
||||
os_memcpy(k_pad, key, key_len);
|
||||
if (key_len < sizeof(k_pad))
|
||||
os_memset(k_pad + key_len, 0, sizeof(k_pad) - key_len);
|
||||
for (i = 0; i < sizeof(k_pad); i++)
|
||||
k_pad[i] ^= 0x36;
|
||||
|
|
Loading…
Reference in a new issue