Skip to content

Commit

Permalink
1342 add mifare infineon (flipperdevices#1346)
Browse files Browse the repository at this point in the history
* Adding MIFARE 1K Infineon Compatibility
  As per Issue flipperdevices#1342,
  MIFARE Classic 1K Cards from NXP have the SAK value of 0x08.
  MIFARE Classic 1K Cards from Infineon have an SAK value of 0x88.
  Adding the SAK values accordingly so that Infineon tags are properly handled.
  • Loading branch information
quantum-x authored Jun 30, 2022
1 parent 8b988e2 commit 8632c77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/nfc_protocols/mifare_classic.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static bool mf_classic_is_allowed_access(

bool mf_classic_check_card_type(uint8_t ATQA0, uint8_t ATQA1, uint8_t SAK) {
UNUSED(ATQA1);
if((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08)) {
if((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08 || SAK == 0x88)) {
return true;
} else if((ATQA0 == 0x42 || ATQA0 == 0x02) && (SAK == 0x18)) {
return true;
Expand All @@ -219,7 +219,7 @@ bool mf_classic_get_type(
furi_assert(reader);
memset(reader, 0, sizeof(MfClassicReader));

if((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08)) {
if((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08 || SAK == 0x88)) {
reader->type = MfClassicType1k;
} else if((ATQA0 == 0x42 || ATQA0 == 0x02) && (SAK == 0x18)) {
reader->type = MfClassicType4k;
Expand Down
2 changes: 1 addition & 1 deletion lib/nfc_protocols/mifare_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MifareType mifare_common_get_type(uint8_t ATQA0, uint8_t ATQA1, uint8_t SAK) {
if((ATQA0 == 0x44) && (ATQA1 == 0x00) && (SAK == 0x00)) {
type = MifareTypeUltralight;
} else if(
((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08)) ||
((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08 || SAK == 0x88)) ||
((ATQA0 == 0x42 || ATQA0 == 0x02) && (SAK == 0x18))) {
type = MifareTypeClassic;
} else if(ATQA0 == 0x44 && ATQA1 == 0x03 && SAK == 0x20) {
Expand Down

0 comments on commit 8632c77

Please sign in to comment.