Clear temporary results from stack in PBKDF2-SHA1
Force stack memory to be cleared of temporary values that might contain keying material. Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
parent
1364f322bf
commit
007fd6111d
1 changed files with 3 additions and 0 deletions
|
@ -50,6 +50,8 @@ static int pbkdf2_sha1_f(const char *passphrase, const u8 *ssid,
|
|||
for (j = 0; j < SHA1_MAC_LEN; j++)
|
||||
digest[j] ^= tmp2[j];
|
||||
}
|
||||
forced_memzero(tmp, SHA1_MAC_LEN);
|
||||
forced_memzero(tmp2, SHA1_MAC_LEN);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -87,6 +89,7 @@ int pbkdf2_sha1(const char *passphrase, const u8 *ssid, size_t ssid_len,
|
|||
pos += plen;
|
||||
left -= plen;
|
||||
}
|
||||
forced_memzero(digest, SHA1_MAC_LEN);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue