From c9cb16d428928c6f8d1d7b16fd31346e59e46558 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 17 Mar 2019 13:51:47 +0100 Subject: [PATCH] fix: mfkey32, cut and paste error? --- client/mifare/mfkey.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mifare/mfkey.c b/client/mifare/mfkey.c index cefc19164..b55c7e3c7 100644 --- a/client/mifare/mfkey.c +++ b/client/mifare/mfkey.c @@ -95,7 +95,7 @@ bool mfkey32(nonces_t data, uint64_t *outputkey) { uint8_t counter = 0; uint32_t p640 = prng_successor(data.nonce, 64); - uint32_t p641 = prng_successor(data.nonce2, 64); + s = lfsr_recovery32(data.ar ^ p640, 0); for (t = s; t->odd | t->even; ++t) { @@ -105,7 +105,7 @@ bool mfkey32(nonces_t data, uint64_t *outputkey) { crypto1_get_lfsr(t, &key); crypto1_word(t, data.cuid ^ data.nonce, 0); crypto1_word(t, data.nr2, 1); - if (data.ar2 == (crypto1_word(t, 0, 0) ^ p641)) { + if (data.ar2 == (crypto1_word(t, 0, 0) ^ p640)) { outkey = key; counter++; if (counter == 20) break;