AES-GCM: Use os_memcmp_const() for hash/password comparisons
This makes the implementation less likely to provide useful timing information to potential attackers from comparisons of information received from a remote device and private material known only by the authorized devices. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
87a5c93bec
commit
05f916eeed
1 changed files with 1 additions and 1 deletions
|
@ -310,7 +310,7 @@ int aes_gcm_ad(const u8 *key, size_t key_len, const u8 *iv, size_t iv_len,
|
||||||
|
|
||||||
aes_encrypt_deinit(aes);
|
aes_encrypt_deinit(aes);
|
||||||
|
|
||||||
if (os_memcmp(tag, T, 16) != 0) {
|
if (os_memcmp_const(tag, T, 16) != 0) {
|
||||||
wpa_printf(MSG_EXCESSIVE, "GCM: Tag mismatch");
|
wpa_printf(MSG_EXCESSIVE, "GCM: Tag mismatch");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue