X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/4ecde0e1ff60d5e3d217dc1e5ca12c78864804cc..4a71da5a359c5f2449a19f19f2fbcbe7bb989ebb:/armsrc/desfire_crypto.c?ds=sidebyside diff --git a/armsrc/desfire_crypto.c b/armsrc/desfire_crypto.c index 9ea07371..469a8ec4 100644 --- a/armsrc/desfire_crypto.c +++ b/armsrc/desfire_crypto.c @@ -27,9 +27,8 @@ */ #include "desfire_crypto.h" -static void xor (const uint8_t *ivect, uint8_t *data, const size_t len); - -static size_t key_macing_length (desfirekey_t key); +static void xor (const uint8_t *ivect, uint8_t *data, const size_t len); +static size_t key_macing_length (desfirekey_t key); static void xor (const uint8_t *ivect, uint8_t *data, const size_t len) { for (size_t i = 0; i < len; i++) { @@ -85,6 +84,7 @@ void cmac (const desfirekey_t key, uint8_t *ivect, const uint8_t *data, size_t l mifare_cypher_blocks_chained (NULL, key, ivect, buffer, len, MCD_SEND, MCO_ENCYPHER); memcpy (cmac, ivect, kbs); + free(buffer); } size_t key_block_size (const desfirekey_t key) {