summaryrefslogtreecommitdiff
path: root/openct-escape.c
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-10-22 20:20:21 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-10-22 20:20:21 +0000
commit5fc01ff6f98d72219420bc29fb59d2d6eb93e887 (patch)
tree1cf64c994346c29e0a143bacf6ce69d8ae3bc2be /openct-escape.c
parent073fc3dcce216782501b12113704b6256d15670c (diff)
- add mifare classic support
- move uid/pupi from l2 private data into l2 global data - various cleanups git-svn-id: https://svn.gnumonks.org/trunk/librfid@1555 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'openct-escape.c')
-rw-r--r--openct-escape.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/openct-escape.c b/openct-escape.c
index 41eb9c3..b488610 100644
--- a/openct-escape.c
+++ b/openct-escape.c
@@ -25,6 +25,7 @@
#include <rfid/rfid_layer2.h>
#include <rfid/rfid_protocol.h>
#include <rfid/rfid_reader_cm5121.h>
+#include <rfid/rfid_protocol_mifare_classic.h>
static int slot = 1;
static ct_handle *h;
@@ -286,6 +287,7 @@ int main(int argc, char **argv)
exit(1);
protocol = RFID_PROTOCOL_MIFARE_UL;
+ protocol = RFID_PROTOCOL_MIFARE_CLASSIC;
// protocol = RFID_PROTOCOL_TCL;
if (l3(protocol) < 0)
@@ -315,9 +317,17 @@ int main(int argc, char **argv)
mifare_ulight_read(ph);
#endif
break;
+ case RFID_PROTOCOL_MIFARE_CLASSIC:
+ mfcl_set_key(ph, MIFARE_CLASSIC_KEY_DEFAULT);
+ rc = mfcl_auth(ph, RFID_CMD_MIFARE_AUTH1A, 0);
+ if (rc < 0) {
+ printf("mifare auth error\n");
+ exit(1);
+ } else
+ printf("mifare authe succeeded!\n");
+ break;
}
-
rfid_reader_close(rh);
exit(0);
personal git repositories of Harald Welte. Your mileage may vary