X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/e7f43e92e9b8a8afe7aa235a34a70af59e8e6cea..c930078036cfdf38ca1c922c0d1841722c48a611:/armsrc/mifarecmd.c diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 46478735..c05ba6fd 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -14,11 +14,6 @@ //----------------------------------------------------------------------------- #include "mifarecmd.h" -#include "apps.h" -#include "util.h" -#include "crc.h" -#include "protocols.h" -#include "parity.h" //----------------------------------------------------------------------------- // Select, Authenticate, Read a MIFARE tag. @@ -641,14 +636,17 @@ void MifareAcquireEncryptedNonces(uint32_t arg0, uint32_t arg1, uint32_t flags, LED_A_ON(); LED_C_OFF(); + BigBuf_free(); BigBuf_Clear_ext(false); + clear_trace(); + set_tracing(FALSE); + if (initialize) { iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN); - clear_trace(); - set_tracing(true); } LED_C_ON(); + uint8_t dummy_answer = 0; uint16_t num_nonces = 0; bool have_uid = false; for (uint16_t i = 0; i <= USB_CMD_DATA_SIZE - 9; ) { @@ -699,7 +697,6 @@ void MifareAcquireEncryptedNonces(uint32_t arg0, uint32_t arg1, uint32_t flags, } // send a dummy byte as reader response in order to trigger the cards authentication timeout - uint8_t dummy_answer = 0; ReaderTransmit(&dummy_answer, 1, NULL); timeout = GetCountSspClk() + AUTHENTICATION_TIMEOUT; @@ -708,7 +705,7 @@ void MifareAcquireEncryptedNonces(uint32_t arg0, uint32_t arg1, uint32_t flags, memcpy(buf+i, receivedAnswer, 4); nt_par_enc = par_enc[0] & 0xf0; } else { - nt_par_enc |= par_enc[0] >> 4; + nt_par_enc |= par_enc[0] >> 4; memcpy(buf+i+4, receivedAnswer, 4); memcpy(buf+i+8, &nt_par_enc, 1); i += 9; @@ -718,9 +715,7 @@ void MifareAcquireEncryptedNonces(uint32_t arg0, uint32_t arg1, uint32_t flags, } LED_C_OFF(); - - crypto1_destroy(pcs); - + crypto1_destroy(pcs); LED_B_ON(); cmd_send(CMD_ACK, isOK, cuid, num_nonces, buf, sizeof(buf)); LED_B_OFF();