Bluetooth: Mesh: AES-CCM: Fix output MIC with additional data
General MIC fix for AAD lengths up to 14 bytes. This case doesn't concern the mesh stack because it uses 16 bytes. Signed-off-by: Reham Tarek <reham.tarek@si-vision.com>
This commit is contained in:
parent
321fec4a38
commit
a1d69fb725
1 changed files with 2 additions and 2 deletions
|
@ -267,7 +267,7 @@ static int bt_mesh_ccm_decrypt(const u8_t key[16], u8_t nonce[13],
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < aad_len; i++, j++) {
|
||||
for (; i < aad_len; i++, j++) {
|
||||
pmsg[i] = Xn[i] ^ aad[j];
|
||||
}
|
||||
|
||||
|
@ -431,7 +431,7 @@ static int bt_mesh_ccm_encrypt(const u8_t key[16], u8_t nonce[13],
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < aad_len; i++, j++) {
|
||||
for (; i < aad_len; i++, j++) {
|
||||
pmsg[i] = Xn[i] ^ aad[j];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue