X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/babca445ffa9f7af6f5e1deb78476754c484a2b1..dcd936a1da12a50a4084f4445d8ebbb080b5bc36:/client/cmdhficlass.c

diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c
index e99c3285..a2e31754 100644
--- a/client/cmdhficlass.c
+++ b/client/cmdhficlass.c
@@ -16,14 +16,14 @@
 #include <sys/stat.h>
 #include <ctype.h>
 #include "iso14443crc.h" // Can also be used for iClass, using 0xE012 as CRC-type
-#include "proxmark3.h"
+#include "comms.h"
 #include "ui.h"
 #include "cmdparser.h"
 #include "cmdhficlass.h"
 #include "common.h"
 #include "util.h"
 #include "cmdmain.h"
-#include "polarssl/des.h"
+#include "mbedtls/des.h"
 #include "loclass/cipherutils.h"
 #include "loclass/cipher.h"
 #include "loclass/ikeys.h"
@@ -33,6 +33,7 @@
 #include "usb_cmd.h"
 #include "cmdhfmfu.h"
 #include "util_posix.h"
+#include "cmdhf14a.h" // DropField()
 
 static int CmdHelp(const char *Cmd);
 
@@ -414,8 +415,8 @@ int CmdHFiClassDecrypt(const char *Cmd) {
 	fseek(f, 0, SEEK_SET);
 	uint8_t enc_dump[8] = {0};
 	uint8_t *decrypted = malloc(fsize);
-	des3_context ctx = { DES_DECRYPT ,{ 0 } };
-	des3_set2key_dec( &ctx, key);
+	mbedtls_des3_context ctx = { {0} };
+	mbedtls_des3_set2key_dec( &ctx, key);
 	size_t bytes_read = fread(enc_dump, 1, 8, f);
 
 	//Use the first block (CSN) for filename
@@ -431,7 +432,7 @@ int CmdHFiClassDecrypt(const char *Cmd) {
 		{
 			memcpy(decrypted+(blocknum*8), enc_dump, 8);
 		}else{
-			des3_crypt_ecb(&ctx, enc_dump,decrypted +(blocknum*8) );
+			mbedtls_des3_crypt_ecb(&ctx, enc_dump,decrypted +(blocknum*8) );
 		}
 		printvar("decrypted block", decrypted +(blocknum*8), 8);
 		bytes_read = fread(enc_dump, 1, 8, f);
@@ -466,10 +467,10 @@ static int iClassEncryptBlkData(uint8_t *blkData) {
 
 	uint8_t encryptedData[16];
 	uint8_t *encrypted = encryptedData;
-	des3_context ctx = { DES_DECRYPT ,{ 0 } };
-	des3_set2key_enc( &ctx, key);
+	mbedtls_des3_context ctx = { {0} };
+	mbedtls_des3_set2key_enc( &ctx, key);
 	
-	des3_crypt_ecb(&ctx, blkData,encrypted);
+	mbedtls_des3_crypt_ecb(&ctx, blkData,encrypted);
 	//printvar("decrypted block", decrypted, 8);
 	memcpy(blkData,encrypted,8);