diff options
author | Jouni Malinen <j@w1.fi> | 2014-06-29 17:21:03 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2014-07-02 09:38:47 (GMT) |
commit | c434503f5e7d6a198772fb6bd1d56fc3de23dd9d (patch) | |
tree | 56039e3df7633d002dd5e7dda7b9bcd398530726 /src/eap_server | |
parent | dddf7bbd4e522666775db58ff1187ac99d971d7e (diff) | |
download | hostap-c434503f5e7d6a198772fb6bd1d56fc3de23dd9d.zip hostap-c434503f5e7d6a198772fb6bd1d56fc3de23dd9d.tar.gz hostap-c434503f5e7d6a198772fb6bd1d56fc3de23dd9d.tar.bz2 |
EAP-FAST: 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>
Diffstat (limited to 'src/eap_server')
-rw-r--r-- | src/eap_server/eap_server_fast.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eap_server/eap_server_fast.c b/src/eap_server/eap_server_fast.c index 44a443a..06dcf74 100644 --- a/src/eap_server/eap_server_fast.c +++ b/src/eap_server/eap_server_fast.c @@ -1198,7 +1198,7 @@ static int eap_fast_validate_crypto_binding( return -1; } - if (os_memcmp(data->crypto_binding_nonce, b->nonce, 31) != 0 || + if (os_memcmp_const(data->crypto_binding_nonce, b->nonce, 31) != 0 || (data->crypto_binding_nonce[31] | 1) != b->nonce[31]) { wpa_printf(MSG_DEBUG, "EAP-FAST: Invalid nonce in " "Crypto-Binding"); @@ -1212,7 +1212,7 @@ static int eap_fast_validate_crypto_binding( (u8 *) b, bind_len); hmac_sha1(data->cmk, EAP_FAST_CMK_LEN, (u8 *) b, bind_len, b->compound_mac); - if (os_memcmp(cmac, b->compound_mac, sizeof(cmac)) != 0) { + if (os_memcmp_const(cmac, b->compound_mac, sizeof(cmac)) != 0) { wpa_hexdump(MSG_MSGDUMP, "EAP-FAST: Calculated Compound MAC", b->compound_mac, sizeof(cmac)); |