summaryrefslogtreecommitdiff
path: root/src/rfid_proto_mifare_classic.c
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2008-02-24 12:35:52 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2008-02-24 12:35:52 +0000
commitfa559d2f999ecc61176154e656962985e292fbb5 (patch)
treeed300a989e1a97ffde23c9873a29d662784be6db /src/rfid_proto_mifare_classic.c
parent292444f20bb8892f419bac3d84d1c0baa6a1c6af (diff)
add function to set mifare key from internal eeprom
git-svn-id: https://svn.gnumonks.org/trunk/librfid@2086 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'src/rfid_proto_mifare_classic.c')
-rw-r--r--src/rfid_proto_mifare_classic.c8
1 files changed, 8 insertions, 0 deletions
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);
personal git repositories of Harald Welte. Your mileage may vary