From 75c3ce61dd50f81991339ed43ecd40aa937502ae Mon Sep 17 00:00:00 2001 From: Antiklesys Date: Sat, 5 Jul 2025 19:35:41 +0800 Subject: [PATCH] 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 --- armsrc/iclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/armsrc/iclass.c b/armsrc/iclass.c index 522dfdfe9..3837d6931 100644 --- a/armsrc/iclass.c +++ b/armsrc/iclass.c @@ -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