Skip to content
Permalink
Browse files

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>
  • Loading branch information...
RehamTarekAhmed authored and jhedberg committed Nov 11, 2018
1 parent 321fec4 commit a1d69fb72578985c96de4e951f7b75ab64ce0da2
Showing with 2 additions and 2 deletions.
  1. +2 −2 subsys/bluetooth/host/mesh/crypto.c
@@ -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];
}

0 comments on commit a1d69fb

Please sign in to comment.
You can’t perform that action at this time.