Merge pull request #2671 from Eltrick/g3apdu-sak

Fix Gen 3 APDU block 0 SAK not being written correctly
This commit is contained in:
Iceman 2024-12-02 20:19:45 +01:00 committed by GitHub
commit de3f374930
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3482,7 +3482,8 @@ void MifareGen3Blk(uint8_t block_len, uint8_t *block) {
retval = PM3_ESOFT;
goto OUT;
}
cmd[ofs++] = card_info->sak;
cmd[ofs] = block_len < card_info->uidlen ? card_info->sak : cmd[ofs];
ofs++;
cmd[ofs++] = card_info->atqa[0];
cmd[ofs++] = card_info->atqa[1];
AddCrc14A(cmd, sizeof(block_cmd) + MIFARE_BLOCK_SIZE);