Skip to content

Commit

Permalink
Merge pull request #2671 from Eltrick/g3apdu-sak
Browse files Browse the repository at this point in the history
Fix Gen 3 APDU block 0 SAK not being written correctly
  • Loading branch information
iceman1001 authored Dec 2, 2024
2 parents 9623a5f + 4adf663 commit de3f374
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 de3f374

Please sign in to comment.