]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmfu.c
Change mbedtls initializers to be compatible with older versions of gcc (#732)
[proxmark3-svn] / client / cmdhfmfu.c
index 63c417289567815f5cf6c3967b400780eb21222a..c3442ee3b26de848c3dc17d6a353f4a2cf494714 100644 (file)
 
 #include <stdint.h>
 #include <stdio.h>
-#include "proxmark3.h"
+#include "comms.h"
 #include "usb_cmd.h"
 #include "cmdmain.h"
 #include "ui.h"
-#include "polarssl/des.h"
+#include "mbedtls/des.h"
 #include "cmdhfmf.h"
 #include "cmdhf14a.h"
 #include "mifare.h"
 #include "util.h"
 #include "protocols.h"
-#include "data.h"
 
 #define MAX_UL_BLOCKS      0x0f
 #define MAX_ULC_BLOCKS     0x2b
@@ -1325,8 +1324,7 @@ int CmdHF14AMfUDump(const char *Cmd){
                PrintAndLog("Data exceeded Buffer size!");
                bufferSize = sizeof(data);
        }
-       GetFromBigBuf(data, bufferSize, startindex);
-       WaitForResponse(CMD_ACK,NULL);
+       GetFromBigBuf(data, bufferSize, startindex, NULL, -1, false);
 
        Pages = bufferSize/4;
        // Load lock bytes.
@@ -1744,11 +1742,11 @@ int CmdHF14AMfuGenDiverseKeys(const char *Cmd){
        mix[6] = block ^ uid[2];
        mix[7] = uid[3];
 
-       des3_context ctx = { 0x00 };
-       des3_set2key_enc(&ctx, masterkey);
+       mbedtls_des3_context ctx = { {0} };
+       mbedtls_des3_set2key_enc(&ctx, masterkey);
 
-       des3_crypt_cbc(&ctx  // des3_context
-               , DES_ENCRYPT    // int mode
+       mbedtls_des3_crypt_cbc(&ctx  // des3_context
+               , MBEDTLS_DES_ENCRYPT    // int mode
                , sizeof(mix)    // length
                , iv             // iv[8]
                , mix            // input
@@ -1783,10 +1781,10 @@ int CmdHF14AMfuGenDiverseKeys(const char *Cmd){
        memcpy(dmkey+16, dkeyA, 8);
        memset(iv, 0x00, 8);
 
-       des3_set3key_enc(&ctx, dmkey);
+       mbedtls_des3_set3key_enc(&ctx, dmkey);
 
-       des3_crypt_cbc(&ctx  // des3_context
-               , DES_ENCRYPT    // int mode
+       mbedtls_des3_crypt_cbc(&ctx  // des3_context
+               , MBEDTLS_DES_ENCRYPT    // int mode
                , sizeof(newpwd) // length
                , iv             // iv[8]
                , zeros         // input
@@ -1836,7 +1834,7 @@ static command_t CommandTable[] =
 };
 
 int CmdHFMFUltra(const char *Cmd){
-       WaitForResponseTimeout(CMD_ACK,NULL,100);
+       (void)WaitForResponseTimeout(CMD_ACK,NULL,100);
        CmdsParse(CommandTable, Cmd);
        return 0;
 }
Impressum, Datenschutz