From: Jouni Malinen Date: Sun, 29 Jun 2014 17:16:39 +0000 (+0300) Subject: AES-CCM: Use os_memcmp_const() for hash/password comparisons X-Git-Tag: hostap_2_3~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87a5c93bec420ea81bee89f241908a70da9596c5;p=thirdparty%2Fhostap.git AES-CCM: 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 --- diff --git a/src/crypto/aes-ccm.c b/src/crypto/aes-ccm.c index d14670db8..cf227785c 100644 --- a/src/crypto/aes-ccm.c +++ b/src/crypto/aes-ccm.c @@ -203,7 +203,7 @@ int aes_ccm_ad(const u8 *key, size_t key_len, const u8 *nonce, aes_encrypt_deinit(aes); - if (os_memcmp(x, t, M) != 0) { + if (os_memcmp_const(x, t, M) != 0) { wpa_printf(MSG_EXCESSIVE, "CCM: Auth mismatch"); return -1; }