[libfreefare] 2 new revisions pushed by yob...@gmail.com on 2014-02-11 16:30 GMT

11 views
Skip to first unread message

libfr...@googlecode.com

unread,
Feb 11, 2014, 11:31:00 AM2/11/14
to nfc-tool...@googlegroups.com
master moved from dbb88cd18479 to 7933adc57ec9

2 new revisions:

Revision: 2960f704f86f
Author: Philippe Teuwen <yob...@gmail.com>
Date: Wed Dec 18 17:10:34 2013 UTC
Log: Let's redirect NFC phones to Desfire as they're ISO14443-4
http://code.google.com/p/libfreefare/source/detail?r=2960f704f86f

Revision: 7933adc57ec9
Author: Philippe Teuwen <yob...@gmail.com>
Date: Tue Feb 11 16:23:06 2014 UTC
Log: mifare_desfire_connect(): select Desfire AID
http://code.google.com/p/libfreefare/source/detail?r=7933adc57ec9

==============================================================================
Revision: 2960f704f86f
Author: Philippe Teuwen <yob...@gmail.com>
Date: Wed Dec 18 17:10:34 2013 UTC
Log: Let's redirect NFC phones to Desfire as they're ISO14443-4

http://code.google.com/p/libfreefare/source/detail?r=2960f704f86f

Modified:
/libfreefare/freefare.c

=======================================
--- /libfreefare/freefare.c Mon Jan 27 15:32:23 2014 UTC
+++ /libfreefare/freefare.c Wed Dec 18 17:10:34 2013 UTC
@@ -36,6 +36,8 @@
{ CLASSIC_4K, "Mifare Classic 4k", 0x18, 0, 0, { 0x00 },
NULL },
{ CLASSIC_4K, "Mifare Classic 4k (Emulated)", 0x38, 0, 0, { 0x00 },
NULL },
{ DESFIRE, "Mifare DESFire", 0x20, 5, 4, { 0x75,
0x77, 0x81, 0x02 /*, 0xXX */ }, NULL},
+ { DESFIRE, "Cyanogenmod card emulation", 0x60, 4, 3, { 0x78,
0x33, 0x88 /*, 0xXX */ }, NULL},
+ { DESFIRE, "Android HCE", 0x60, 4, 3, { 0x78,
0x80, 0x70 /*, 0xXX */ }, NULL},
{ ULTRALIGHT_C, "Mifare UltraLightC", 0x00, 0, 0, { 0x00 },
is_mifare_ultralightc_on_reader },
{ ULTRALIGHT, "Mifare UltraLight", 0x00, 0, 0, { 0x00 },
NULL },
};

==============================================================================
Revision: 7933adc57ec9
Author: Philippe Teuwen <yob...@gmail.com>
Date: Tue Feb 11 16:23:06 2014 UTC
Log: mifare_desfire_connect(): select Desfire AID

http://code.google.com/p/libfreefare/source/detail?r=7933adc57ec9

Modified:
/libfreefare/freefare_internal.h
/libfreefare/mifare_desfire.c

=======================================
--- /libfreefare/freefare_internal.h Wed Jun 19 22:00:55 2013 UTC
+++ /libfreefare/freefare_internal.h Tue Feb 11 16:23:06 2014 UTC
@@ -329,6 +329,8 @@

#define BUFFER_SIZE(buffer_name) (__##buffer_name##_n)

+#define BUFFER_MAXSIZE(buffer_name) (__##buffer_name##_size)
+
#define BUFFER_CLEAR(buffer_name) (__##buffer_name##_n = 0)
/*
* Append one byte of data to the buffer buffer_name.
=======================================
--- /libfreefare/mifare_desfire.c Tue Jan 29 10:45:40 2013 UTC
+++ /libfreefare/mifare_desfire.c Tue Feb 11 16:23:06 2014 UTC
@@ -299,6 +299,21 @@
.nbr = NBR_106
};
if (nfc_initiator_select_passive_target (tag->device, modulation,
tag->info.abtUid, tag->info.szUidLen, &pnti) >= 0) {
+ // The registered ISO AID of DESFire D2760000850100
+ // Selecting this AID selects the MF
+ BUFFER_INIT (cmd, 12);
+ BUFFER_INIT (res, 2);
+ BUFFER_APPEND (cmd, 0x00);
+ BUFFER_APPEND (cmd, 0xa4);
+ BUFFER_APPEND (cmd, 0x04);
+ BUFFER_APPEND (cmd, 0x00);
+ uint8_t AID[]={ 0xd2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x00};
+ BUFFER_APPEND (cmd, sizeof (AID));
+ BUFFER_APPEND_BYTES (cmd, AID, sizeof (AID));
+ if ((nfc_initiator_transceive_bytes(tag->device, cmd, BUFFER_SIZE(cmd),
res, BUFFER_MAXSIZE(cmd), 0) < 0) || (res[0] != 0x90 || res[1] != 0x00)) {
+ errno = EIO;
+ return -1;
+ }
tag->active = 1;
free (MIFARE_DESFIRE (tag)->session_key);
MIFARE_DESFIRE (tag)->session_key = NULL;
Reply all
Reply to author
Forward
0 new messages