From b7be78a8fb46c55e4a28626634e2755d5f81f7f3 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 29 Mar 2021 21:52:36 +0200 Subject: [PATCH] cbc is already done in mifare_cypher_single_block (anon) --- client/src/mifare/desfire_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/mifare/desfire_crypto.c b/client/src/mifare/desfire_crypto.c index f08aeb7b8..1f36bacac 100644 --- a/client/src/mifare/desfire_crypto.c +++ b/client/src/mifare/desfire_crypto.c @@ -862,7 +862,7 @@ void mifare_cypher_single_block(desfirekey_t key, uint8_t *data, uint8_t *ivect, mbedtls_aes_context actx; mbedtls_aes_init(&actx); mbedtls_aes_setkey_enc(&actx, key->data, 128); - mbedtls_aes_crypt_cbc(&actx, MBEDTLS_AES_ENCRYPT, sizeof(edata), ivect, data, edata); + mbedtls_aes_crypt_ecb(&actx, MBEDTLS_AES_ENCRYPT, data, edata); mbedtls_aes_free(&actx); break; } @@ -870,7 +870,7 @@ void mifare_cypher_single_block(desfirekey_t key, uint8_t *data, uint8_t *ivect, mbedtls_aes_context actx; mbedtls_aes_init(&actx); mbedtls_aes_setkey_dec(&actx, key->data, 128); - mbedtls_aes_crypt_cbc(&actx, MBEDTLS_AES_DECRYPT, sizeof(edata), ivect, edata, data); + mbedtls_aes_crypt_ecb(&actx, MBEDTLS_AES_DECRYPT, edata, data); mbedtls_aes_free(&actx); break; }