Skip to content

Commit

Permalink
Fix Gen 3 APDU block 0 SAK not being written correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Eltrick committed Dec 1, 2024
1 parent ca15bbd commit 4adf663
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion armsrc/mifarecmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4adf663

Please sign in to comment.