]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AES-CCM: Use os_memcmp_const() for hash/password comparisons
authorJouni Malinen <j@w1.fi>
Sun, 29 Jun 2014 17:16:39 +0000 (20:16 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 2 Jul 2014 09:38:47 +0000 (12:38 +0300)
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>
src/crypto/aes-ccm.c

index d14670db8d65f767c4d6ae7934e1d5aadc712636..cf227785c3ca02ef41d22430f4a5a45c9694fa5a 100644 (file)
@@ -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;
        }