1
0
mirror of https://github.com/Sucareto/ESP32-CardReader.git synced 2024-11-23 23:00:56 +01:00

正确判断 Key A 和 Key B

This commit is contained in:
Sucareto 2023-06-04 12:32:50 +08:00
parent 24b06ac849
commit 83cb72fe83

View File

@ -356,7 +356,7 @@ static void sg_nfc_cmd_aime_authenticate() {
sg_res_init(); sg_res_init();
if (!digitalRead(SW3_CARD)) { if (!digitalRead(SW3_CARD)) {
uint8_t key_block_no = (req.block_no / 4) * 4 + 3; uint8_t key_block_no = (req.block_no / 4) * 4 + 3;
if (memcmp(AimeKey, mifare_data[key_block_no], 6)) { if (memcmp(AimeKey, mifare_data[key_block_no] + 10, 6)) { // Key B
res.status = 1; res.status = 1;
} }
return; return;