Skip to content

Commit bf01adc

Browse files
committed
[hf seos] Clean up fixed array allocations
1 parent 2f394ef commit bf01adc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

client/src/cmdhfseos.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ static void generate_command_wrapping(uint8_t *command_Header, int command_heade
232232
// Breakdown
233233
// 0181e43801010201 + 0000000000000001 + 0CCB3FFF800000000000000000000000 + 8510EB54DA90CB43AEE7FBFE816ECA25A10D + 9700 + 800000000000000000000000
234234

235-
uint8_t mac[8];
236-
memset(mac, 0x00, 8);
235+
uint8_t mac[8] = { 0x00 };
237236
if (create_cmac(diversified_mac_key, padded_toEncrypt, mac, padded_toEncrypt_len, sizeof(mac), encryption_algorithm) != PM3_SUCCESS) {
238237
PrintAndLogEx(ERR, _RED_("Failed to create MAC"));
239238
return;
@@ -925,8 +924,7 @@ static int seos_mutual_auth(uint8_t *adfOID, size_t adfoid_len, uint8_t *randomI
925924
memcpy(mutual_auth_plain + 8 + 8, keyIFD, 16);
926925

927926
// ----------------- Encryption and MAC Generation -----------------
928-
uint8_t mac[8];
929-
memset(mac, 0x00, 8);
927+
uint8_t mac[8] = { 0x00 };
930928
uint8_t mutual_auth_enc[32];
931929
create_cryptogram(AES_key, mutual_auth_plain, mutual_auth_enc, sizeof(mutual_auth_plain), encryption_algorithm);
932930
create_cmac(MAC_key, mutual_auth_enc, mac, sizeof(mutual_auth_enc), sizeof(mac), encryption_algorithm);

0 commit comments

Comments
 (0)