Update iclass.c

Fixed correctly, in the previous fix I'm checking the length of the mac, but the mac is always 4 0 bytes (set from client side as part of the variable size) and the only actual check happens on client side. I'll have to check for the mac value to be != from 00000000
This commit is contained in:
Antiklesys 2025-07-05 19:35:41 +08:00
parent 33c3988a94
commit 75c3ce61dd

View file

@ -1938,7 +1938,7 @@ void iClass_WriteBlock(uint8_t *msg) {
write_len -= 2;
} else {
if (payload->req.use_replay && sizeof(payload->mac) > 0) {
if (payload->req.use_replay && (memcmp(payload->mac, "\x00\x00\x00\x00", 4) != 0)) {
memcpy(write + 10, payload->mac, sizeof(payload->mac));
} else {
// Secure tags uses MAC