wpa_supplicant: Fix supplicant debug logs errors.

This commit is contained in:
Hrudaynath Dhabe 2021-05-27 12:53:35 +05:30
parent ffe0c21af3
commit a260a1bafa

View File

@ -41,7 +41,7 @@ static void aes_ccm_auth_start(void *aes, size_t M, size_t L, const u8 *nonce,
os_memcpy(&b[1], nonce, 15 - L);
WPA_PUT_BE16(&b[AES_BLOCK_SIZE - L], plain_len);
wpa_hexdump_key(MSG_EXCESSIVE, "CCM B_0", b, AES_BLOCK_SIZE);
wpa_hexdump_key(MSG_DEBUG, "CCM B_0", b, AES_BLOCK_SIZE);
aes_encrypt(aes, b, x); /* X_1 = E(K, B_0) */
if (!aad_len)
@ -120,13 +120,13 @@ static void aes_ccm_encr_auth(void *aes, size_t M, u8 *x, u8 *a, u8 *auth)
size_t i;
u8 tmp[AES_BLOCK_SIZE];
wpa_hexdump_key(MSG_EXCESSIVE, "CCM T", x, M);
wpa_hexdump_key(MSG_DEBUG, "CCM T", x, M);
/* U = T XOR S_0; S_0 = E(K, A_0) */
WPA_PUT_BE16(&a[AES_BLOCK_SIZE - 2], 0);
aes_encrypt(aes, a, tmp);
for (i = 0; i < M; i++)
auth[i] = x[i] ^ tmp[i];
wpa_hexdump_key(MSG_EXCESSIVE, "CCM U", auth, M);
wpa_hexdump_key(MSG_DEBUG, "CCM U", auth, M);
}
@ -135,13 +135,13 @@ static void aes_ccm_decr_auth(void *aes, size_t M, u8 *a, const u8 *auth, u8 *t)
size_t i;
u8 tmp[AES_BLOCK_SIZE];
wpa_hexdump_key(MSG_EXCESSIVE, "CCM U", auth, M);
wpa_hexdump_key(MSG_DEBUG, "CCM U", auth, M);
/* U = T XOR S_0; S_0 = E(K, A_0) */
WPA_PUT_BE16(&a[AES_BLOCK_SIZE - 2], 0);
aes_encrypt(aes, a, tmp);
for (i = 0; i < M; i++)
t[i] = auth[i] ^ tmp[i];
wpa_hexdump_key(MSG_EXCESSIVE, "CCM T", t, M);
wpa_hexdump_key(MSG_DEBUG, "CCM T", t, M);
}
@ -205,7 +205,7 @@ int aes_ccm_ad(const u8 *key, size_t key_len, const u8 *nonce,
aes_encrypt_deinit(aes);
if (os_memcmp_const(x, t, M) != 0) {
wpa_printf(MSG_EXCESSIVE, "CCM: Auth mismatch");
wpa_printf(MSG_DEBUG, "CCM: Auth mismatch");
return -1;
}