cmdhfseos: fix stack buffer overflow in select_DF_verify

increased CMAC buffer size, otherwise memset in aes_cmac writes 16-bytes to 8-byte buffer
This commit is contained in:
Jakub Kramarz 2025-05-08 23:52:01 +02:00
commit 0655b6389e

View file

@ -562,7 +562,7 @@ static int select_DF_verify(uint8_t *response, uint8_t response_length, uint8_t
}
// ----------------- MAC Key Generation -----------------
uint8_t cmac[8];
uint8_t cmac[16];
uint8_t MAC_key[24] = {0x00};
memcpy(MAC_key, keys[key_index].privMacKey, 16);
create_cmac(MAC_key, input, cmac, sizeof(input), encryption_algorithm);