Commit 1c082ea0 authored by Ilya Makarov's avatar Ilya Makarov Committed by github-actions[bot]
Browse files

Bluetooth: host: Fix MIC generation in Bluetooth CCM encryption


bt_ccm_encrypt only works when encrypting in place. To fix this
ccm_auth() inside bt_ccm_encrypt() must take plaintext instead of
enc_data, to not rely on assumption that plain and cypher data are the
same memory.
Signed-off-by: default avatarIlya Makarov <ilya.makarov.592@gmail.com>

Fixes: #40069
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -223,7 +223,7 @@ int bt_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13],
return -EINVAL;
}
ccm_auth(key, nonce, enc_data, len, aad, aad_len, mic, mic_size);
ccm_auth(key, nonce, plaintext, len, aad, aad_len, mic, mic_size);
ccm_crypt(key, nonce, plaintext, enc_data, len);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment