From c002ae9f770b03d1047e7ffbae1e154efc0029c9 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 6 Oct 2024 10:08:17 +0200 Subject: [PATCH] style --- armsrc/iso14443a.c | 2 -- armsrc/lfops.c | 1 - armsrc/mifaredesfire.c | 3 ++- common/iso15693tools.c | 9 ++++----- include/pm3_cmd.h | 5 ++++- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index 8660b18ab..23d1d91c3 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -1355,8 +1355,6 @@ bool SimulateIso14443aInit(uint8_t tagType, uint16_t flags, uint8_t *data, uint8 return false; } - - AddCrc14A(rRATS, rRATS_len - 2); AddCrc14A(rPPS, sizeof(rPPS) - 2); diff --git a/armsrc/lfops.c b/armsrc/lfops.c index 1fba4a381..137809524 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -29,7 +29,6 @@ #include "dbprint.h" #include "util.h" #include "commonutil.h" - #include "crc16.h" #include "string.h" #include "printf.h" diff --git a/armsrc/mifaredesfire.c b/armsrc/mifaredesfire.c index 50a3086d8..448f475dd 100644 --- a/armsrc/mifaredesfire.c +++ b/armsrc/mifaredesfire.c @@ -696,9 +696,10 @@ int DesfireAPDU(uint8_t *cmd, size_t cmd_len, uint8_t *dataout) { ReaderTransmit(wCmd, wrappedLen, NULL); len = ReaderReceive(resp, sizeof(resp), par); - if (!len) { + if (len == 0) { if (g_dbglevel >= DBG_EXTENDED) Dbprintf("fukked"); return false; //DATA LINK ERROR + } // if we received an I- or R(ACK)-Block with a block number equal to the // current block number, toggle the current block number diff --git a/common/iso15693tools.c b/common/iso15693tools.c index 5f6dd7567..9c554fd70 100644 --- a/common/iso15693tools.c +++ b/common/iso15693tools.c @@ -16,10 +16,8 @@ // ISO15693 other commons //----------------------------------------------------------------------------- #include "iso15693tools.h" - #include - #define ISO15693_SPRINTUID_BUFLEN (3 * 8 + 1) // returns a string representation of the UID @@ -28,9 +26,10 @@ // uid[] the UID in transmission order // return: ptr to string char *iso15693_sprintUID(char *dest, uint8_t *uid) { - static char tempbuf[ISO15693_SPRINTUID_BUFLEN] = {0}; - if (dest == NULL) - dest = tempbuf; + static char tmp[ISO15693_SPRINTUID_BUFLEN] = {0}; + if (dest == NULL) { + dest = tmp; + } if (uid) { #ifdef HAVE_SNPRINTF diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index 9ab3bc993..87d0d2c66 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -864,7 +864,10 @@ typedef struct { // Got wrong length error pm3: when received wrong length of data #define PM3_ELENGTH -27 -// No data pm3: no data available, no host frame available (not really an error) +// No key available client/pm3: no cryptographic key available. +#define PM3_ENOKEY -28 + +// No data client/pm3: no data available, no host frame available (not really an error) #define PM3_ENODATA -98 // Quit program client: reserved, order to quit the program #define PM3_EFATAL -99