From fa559d2f999ecc61176154e656962985e292fbb5 Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 24 Feb 2008 12:35:52 +0000 Subject: add function to set mifare key from internal eeprom git-svn-id: https://svn.gnumonks.org/trunk/librfid@2086 e0336214-984f-0b4b-a45f-81c69e1f0ede --- src/rfid_proto_mifare_classic.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/rfid_proto_mifare_classic.c') diff --git a/src/rfid_proto_mifare_classic.c b/src/rfid_proto_mifare_classic.c index 66e4287..a6e2e4f 100644 --- a/src/rfid_proto_mifare_classic.c +++ b/src/rfid_proto_mifare_classic.c @@ -187,6 +187,14 @@ int mfcl_set_key(struct rfid_protocol_handle *ph, unsigned char *key) return ph->l2h->rh->reader->mifare_classic.setkey(ph->l2h->rh, key); } +int mfcl_set_key_ee(struct rfid_protocol_handle *ph, unsigned int addr) +{ + if (!ph->l2h->rh->reader->mifare_classic.setkey_ee) + return -ENODEV; + + return ph->l2h->rh->reader->mifare_classic.setkey_ee(ph->l2h->rh, addr); +} + int mfcl_auth(struct rfid_protocol_handle *ph, u_int8_t cmd, u_int8_t block) { u_int32_t serno = *((u_int32_t *)ph->l2h->uid); -- cgit v1.2.3