From 7ea7e4b3649fdf31ff155924d5d16c19dea8b332 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Sat, 7 Aug 2021 14:53:23 +0300 Subject: [PATCH] fix --- client/src/mifare/desfire_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/mifare/desfire_crypto.c b/client/src/mifare/desfire_crypto.c index b0bbc62b7..7ee2f542c 100644 --- a/client/src/mifare/desfire_crypto.c +++ b/client/src/mifare/desfire_crypto.c @@ -320,7 +320,6 @@ void cmac(const desfirekey_t key, uint8_t *ivect, const uint8_t *data, size_t le // This function is almot like cmac(...). but with some key differences. void mifare_kdf_an10922(const desfirekey_t key, const uint8_t *data, size_t len) { int kbs = key_block_size(key); - int kbs2 = kbs * 2; if (key == NULL || kbs == 0 || data == NULL || len < 1 || len > 31) { return; } @@ -328,6 +327,7 @@ void mifare_kdf_an10922(const desfirekey_t key, const uint8_t *data, size_t len) // AES uses 16 byte IV if (kbs < 16) kbs = 16; + int kbs2 = kbs * 2; cmac_generate_subkeys(key, MCD_SEND);