EAP-PSK: 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
cba0f8698b
commit
4685482552
2 changed files with 2 additions and 2 deletions
|
@ -314,7 +314,7 @@ static void eap_psk_process_2(struct eap_sm *sm,
|
|||
}
|
||||
os_free(buf);
|
||||
wpa_hexdump(MSG_DEBUG, "EAP-PSK: MAC_P", resp->mac_p, EAP_PSK_MAC_LEN);
|
||||
if (os_memcmp(mac, resp->mac_p, EAP_PSK_MAC_LEN) != 0) {
|
||||
if (os_memcmp_const(mac, resp->mac_p, EAP_PSK_MAC_LEN) != 0) {
|
||||
wpa_printf(MSG_INFO, "EAP-PSK: Invalid MAC_P");
|
||||
wpa_hexdump(MSG_MSGDUMP, "EAP-PSK: Expected MAC_P",
|
||||
mac, EAP_PSK_MAC_LEN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue