X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/325f26e25dfd0315d080214bdcaf4d3239ff491c..6c3795a315ae5bbd295b47190ffffe5e671b80ad:/armsrc/mifareutil.c

diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c
index ca2cbeb7..4795a7ec 100644
--- a/armsrc/mifareutil.c
+++ b/armsrc/mifareutil.c
@@ -8,18 +8,7 @@
 //-----------------------------------------------------------------------------
 // Work with mifare cards.
 //-----------------------------------------------------------------------------
-
-#include "proxmark3.h"
-#include "apps.h"
-#include "util.h"
-#include "string.h"
-
-#include "iso14443crc.h"
-#include "iso14443a.h"
-#include "crapto1.h"
 #include "mifareutil.h"
-#include "parity.h"
-#include "des.h"
 
 int MF_DBGLEVEL = MF_DBG_ALL;
 
@@ -287,7 +276,7 @@ int mifare_ultra_auth(uint8_t *keybytes){
 	memcpy(enc_random_b,resp+1,8);
 
 	// decrypt nonce.
-	tdes_2key_dec(random_b, enc_random_b, sizeof(random_b), key, IV );
+	tdes_2key_dec((void*)random_b, (void*)enc_random_b, sizeof(random_b), (const void*)key, IV );
 	rol(random_b,8);
 	memcpy(rnd_ab  ,random_a,8);
 	memcpy(rnd_ab+8,random_b,8);
@@ -471,7 +460,11 @@ int mifare_ultra_writeblock(uint8_t blockNo, uint8_t *blockData) {
 }
 int mifare_classic_halt_ex(struct Crypto1State *pcs) {
 	uint8_t receivedAnswer[4] = {0x00, 0x00, 0x00, 0x00};
-	mifare_sendcmd_short(pcs, (pcs == NULL) ? CRYPT_NONE : CRYPT_ALL, 0x50, 0x00, receivedAnswer, NULL, NULL);
+	uint16_t len = mifare_sendcmd_short(pcs, (pcs == NULL) ? CRYPT_NONE : CRYPT_ALL, 0x50, 0x00, receivedAnswer, NULL, NULL);
+	if (len != 0) {
+		if (MF_DBGLEVEL >= MF_DBG_EXTENDED) Dbprintf("halt warning. response len: %x", len);
+		return 1;
+	}
 	return 0;
 }
 int mifare_classic_halt(struct Crypto1State *pcs, uint32_t uid) {