From 55602bf833c5a9c1c4c1dcb07e11cd89d73d58dd Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 14 Jul 2019 12:17:34 +0200 Subject: [PATCH] Fix few zelaous WARNING->ERR --- client/cmddata.c | 2 +- client/cmdhf15.c | 2 +- client/cmdhffido.c | 4 ++-- client/cmdhfmf.c | 2 +- client/cmdlft55xx.c | 4 ++-- client/cmdlfti.c | 4 ++-- client/cmdsmartcard.c | 4 ++-- client/comms.c | 8 ++++---- client/emv/cmdemv.c | 18 +++++++++--------- client/emv/emvcore.c | 6 +++--- client/fido/fidocore.c | 2 +- client/loclass/elite_crack.c | 4 ++-- client/mifare/mad.c | 2 +- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/client/cmddata.c b/client/cmddata.c index e0e0f73c1..ba6790c93 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -667,7 +667,7 @@ static int CmdBiphaseDecodeRaw(const char *Cmd) { } if (errCnt > 0) - PrintAndLogEx(ERR, "# Errors found during Demod (shown as " _YELLOW_("7")" in bit stream): %d", errCnt); + PrintAndLogEx(WARNING, "# Errors found during Demod (shown as " _YELLOW_("7")" in bit stream): %d", errCnt); PrintAndLogEx(NORMAL, "Biphase Decoded using offset: %d - # invert:%d - data:", offset, invert); PrintAndLogEx(NORMAL, "%s", sprint_bin_break(bits, size, 32)); diff --git a/client/cmdhf15.c b/client/cmdhf15.c index 65bc26010..33c3957fe 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -564,7 +564,7 @@ static int CmdHF15Demod(const char *Cmd) { } if (mask != 0x01) { - PrintAndLogEx(ERR, "Error, uneven octet! (discard extra bits!)"); + PrintAndLogEx(WARNING, "Warning, uneven octet! (discard extra bits!)"); PrintAndLogEx(NORMAL, " mask = %02x", mask); } PrintAndLogEx(NORMAL, "%d octets", k); diff --git a/client/cmdhffido.c b/client/cmdhffido.c index 9db6583f6..39b080dca 100644 --- a/client/cmdhffido.c +++ b/client/cmdhffido.c @@ -351,7 +351,7 @@ static int CmdHFFidoRegister(const char *cmd) { if (res == -0x4e00) { PrintAndLogEx(WARNING, "Signature is NOT VALID."); } else { - PrintAndLogEx(ERR, "Other signature check error: %x %s", (res < 0) ? -res : res, ecdsa_get_error(res)); + PrintAndLogEx(WARNING, "Other signature check error: %x %s", (res < 0) ? -res : res, ecdsa_get_error(res)); } } else { PrintAndLogEx(SUCCESS, "Signature is OK."); @@ -577,7 +577,7 @@ static int CmdHFFidoAuthenticate(const char *cmd) { if (res == -0x4e00) { PrintAndLogEx(WARNING, "Signature is NOT VALID."); } else { - PrintAndLogEx(ERR, "Other signature check error: %x %s", (res < 0) ? -res : res, ecdsa_get_error(res)); + PrintAndLogEx(WARNING, "Other signature check error: %x %s", (res < 0) ? -res : res, ecdsa_get_error(res)); } } else { PrintAndLogEx(SUCCESS, "Signature is OK."); diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 3ca958f80..a62924787 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -2765,7 +2765,7 @@ static int CmdHF14AMfEKeyPrn(const char *Cmd) { PrintAndLogEx(NORMAL, "|---|----------------|----------------|"); for (i = 0; i < numSectors; i++) { if (mfEmlGetMem(data, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1) != PM3_SUCCESS) { - PrintAndLogEx(ERR, "error get block %d", FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1); + PrintAndLogEx(WARNING, "error get block %d", FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1); break; } uint64_t keyA = bytes_to_num(data, 6); diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index 07285053b..9a23e660b 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -1829,13 +1829,13 @@ static int CmdT55xxWipe(const char *Cmd) { else snprintf(ptrData, sizeof(writeData), "b 0 d 000880E0 p 0"); - if (CmdT55xxWriteBlock(ptrData) != PM3_SUCCESS) PrintAndLogEx(ERR, "Error writing blk 0"); + if (CmdT55xxWriteBlock(ptrData) != PM3_SUCCESS) PrintAndLogEx(WARNING, "Warning: error writing blk 0"); for (uint8_t blk = 1; blk < 8; blk++) { snprintf(ptrData, sizeof(writeData), "b %d d 0", blk); - if (CmdT55xxWriteBlock(ptrData) != PM3_SUCCESS) PrintAndLogEx(ERR, "Error writing blk %d", blk); + if (CmdT55xxWriteBlock(ptrData) != PM3_SUCCESS) PrintAndLogEx(WARNING, "Warning: error writing blk %d", blk); memset(writeData, 0x00, sizeof(writeData)); } diff --git a/client/cmdlfti.c b/client/cmdlfti.c index b37a6fdc1..5236550b2 100644 --- a/client/cmdlfti.c +++ b/client/cmdlfti.c @@ -233,7 +233,7 @@ static int CmdTIDemod(const char *Cmd) { // only 15 bits compare, last bit of ident is not valid if ((shift3 ^ shift0) & 0x7FFF) { - PrintAndLogEx(ERR, "Error: Ident mismatch!"); + PrintAndLogEx(WARNING, "Warning: Ident mismatch!"); } // WARNING the order of the bytes in which we calc crc below needs checking // i'm 99% sure the crc algorithm is correct, but it may need to eat the @@ -257,7 +257,7 @@ static int CmdTIDemod(const char *Cmd) { PrintAndLogEx(INFO, "Tag data = %08X%08X [Crc %04X %s]", shift1, shift0, crc, crcStr); if (crc != (shift2 & 0xFFFF)) - PrintAndLogEx(ERR, "Error: CRC mismatch, calculated %04X, got %04X", crc, shift2 & 0xFFFF); + PrintAndLogEx(WARNING, "Warning: CRC mismatch, calculated %04X, got %04X", crc, shift2 & 0xFFFF); retval = PM3_SUCCESS; goto out; diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index f7a0b4ca4..c49f0d0e7 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -284,7 +284,7 @@ static int PrintATR(uint8_t *atr, size_t atrlen) { vxor ^= atr[i]; if (vxor) - PrintAndLogEx(ERR, "Check sum error. Must be 0 got 0x%02X", vxor); + PrintAndLogEx(WARNING, "Invalid check sum. Must be 0 got 0x%02X", vxor); else PrintAndLogEx(INFO, "Check sum OK."); } @@ -295,7 +295,7 @@ static int PrintATR(uint8_t *atr, size_t atrlen) { uint8_t calen = 2 + T1len + TD1len + TDilen + K; if (atrlen != calen && atrlen != calen + 1) // may be CRC - PrintAndLogEx(ERR, "ATR length error. len: %d, T1len: %d, TD1len: %d, TDilen: %d, K: %d", atrlen, T1len, TD1len, TDilen, K); + PrintAndLogEx(WARNING, "Invalid ATR length. len: %d, T1len: %d, TD1len: %d, TDilen: %d, K: %d", atrlen, T1len, TD1len, TDilen, K); if (K > 0) PrintAndLogEx(INFO, "\nHistorical bytes | len 0x%02d | format %02x", K, atr[2 + T1len + TD1len + TDilen]); diff --git a/client/comms.c b/client/comms.c index dad7c1640..304948a4d 100644 --- a/client/comms.c +++ b/client/comms.c @@ -359,7 +359,7 @@ __attribute__((force_align_arg_pointer)) res = uart_receive(sp, (uint8_t *)&rx_raw.data, length, &rxlen); if ((res != PM3_SUCCESS) || (rxlen != length)) { - PrintAndLogEx(ERR, "Received packet frame error variable part too short? %d/%d", rxlen, length); + PrintAndLogEx(WARNING, "Received packet frame with variable part too short? %d/%d", rxlen, length); error = true; } else { @@ -392,7 +392,7 @@ __attribute__((force_align_arg_pointer)) if (!error) { // Get the postamble res = uart_receive(sp, (uint8_t *)&rx_raw.foopost, sizeof(PacketResponseNGPostamble), &rxlen); if ((res != PM3_SUCCESS) || (rxlen != sizeof(PacketResponseNGPostamble))) { - PrintAndLogEx(ERR, "Received packet frame error fetching postamble"); + PrintAndLogEx(WARNING, "Received packet frame without postamble"); error = true; } } @@ -402,7 +402,7 @@ __attribute__((force_align_arg_pointer)) uint8_t first, second; compute_crc(CRC_14443_A, (uint8_t *)&rx_raw, sizeof(PacketResponseNGPreamble) + length, &first, &second); if ((first << 8) + second != rx.crc) { - PrintAndLogEx(ERR, "Received packet frame CRC error %02X%02X <> %04X", first, second, rx.crc); + PrintAndLogEx(WARNING, "Received packet frame with invalid CRC %02X%02X <> %04X", first, second, rx.crc); error = true; } } @@ -424,7 +424,7 @@ __attribute__((force_align_arg_pointer)) res = uart_receive(sp, ((uint8_t *)&rx_old) + sizeof(PacketResponseNGPreamble), sizeof(PacketResponseOLD) - sizeof(PacketResponseNGPreamble), &rxlen); if ((res != PM3_SUCCESS) || (rxlen != sizeof(PacketResponseOLD) - sizeof(PacketResponseNGPreamble))) { - PrintAndLogEx(ERR, "Received packet OLD frame payload error too short? %d/%d", rxlen, sizeof(PacketResponseOLD) - sizeof(PacketResponseNGPreamble)); + PrintAndLogEx(WARNING, "Received packet OLD frame with payload too short? %d/%d", rxlen, sizeof(PacketResponseOLD) - sizeof(PacketResponseNGPreamble)); error = true; } if (!error) { diff --git a/client/emv/cmdemv.c b/client/emv/cmdemv.c index 0585c1661..0b50ecfe1 100644 --- a/client/emv/cmdemv.c +++ b/client/emv/cmdemv.c @@ -931,7 +931,7 @@ static int CmdEMVExec(const char *Cmd) { while (AFL && AFL->len) { if (AFL->len % 4) { - PrintAndLogEx(ERR, "Error: Wrong AFL length: %d", AFL->len); + PrintAndLogEx(WARNING, "Warning: Wrong AFL length: %d", AFL->len); break; } @@ -952,7 +952,7 @@ static int CmdEMVExec(const char *Cmd) { res = EMVReadRecord(channel, true, SFI, n, buf, sizeof(buf), &len, &sw, tlvRoot); if (res) { - PrintAndLogEx(ERR, "Error SFI[%02x]. APDU error %4x", SFI, sw); + PrintAndLogEx(WARNING, "Error SFI[%02x]. APDU error %4x", SFI, sw); continue; } @@ -972,7 +972,7 @@ static int CmdEMVExec(const char *Cmd) { memcpy(&ODAiList[ODAiListLen], &buf[len - elmlen], elmlen); ODAiListLen += elmlen; } else { - PrintAndLogEx(ERR, "Error SFI[%02x]. Creating input list for Offline Data Authentication error.", SFI); + PrintAndLogEx(WARNING, "Error SFI[%02x]. Creating input list for Offline Data Authentication error.", SFI); } } else { memcpy(&ODAiList[ODAiListLen], buf, len); @@ -1001,7 +1001,7 @@ static int CmdEMVExec(const char *Cmd) { AIP = AIPtlv->value[0] + AIPtlv->value[1] * 0x100; PrintAndLogEx(NORMAL, "* * AIP=%04x", AIP); } else { - PrintAndLogEx(ERR, "Can't found AIP."); + PrintAndLogEx(ERR, "Can't find AIP."); } // SDA @@ -1047,11 +1047,11 @@ static int CmdEMVExec(const char *Cmd) { TLVPrintFromTLVLev(cvr, 1); } } else { - PrintAndLogEx(NORMAL, "WARNING: IAD not found."); + PrintAndLogEx(WARNING, "WARNING: IAD not found."); } } else { - PrintAndLogEx(ERR, "Error AC: Application Transaction Counter (ATC) not found."); + PrintAndLogEx(WARNING, "Warning AC: Application Transaction Counter (ATC) not found."); } } } @@ -1131,14 +1131,14 @@ static int CmdEMVExec(const char *Cmd) { PrintAndLogEx(NORMAL, "Transaction approved ONLINE."); break; default: - PrintAndLogEx(ERR, "Error: CID transaction code error %2x", CID->value[0] & EMVAC_AC_MASK); + PrintAndLogEx(WARNING, "Warning: CID transaction code error %2x", CID->value[0] & EMVAC_AC_MASK); break; } } else { - PrintAndLogEx(ERR, "Error: Wrong CID length %d", CID->len); + PrintAndLogEx(WARNING, "Warning: Wrong CID length %d", CID->len); } } else { - PrintAndLogEx(ERR, "Error: CID(9F27) not found."); + PrintAndLogEx(WARNING, "Warning: CID(9F27) not found."); } } diff --git a/client/emv/emvcore.c b/client/emv/emvcore.c index e7bda4be5..2d96b567a 100644 --- a/client/emv/emvcore.c +++ b/client/emv/emvcore.c @@ -763,7 +763,7 @@ int trDDA(EMVCommandChannel channel, bool decodeTLV, struct tlvdb *tlv) { if (tlvdb_get(tlv, 0x9f2d, NULL)) { struct emv_pk *icc_pe_pk = emv_pki_recover_icc_pe_cert(issuer_pk, tlv); if (!icc_pe_pk) { - PrintAndLogEx(ERR, "WARNING: ICC PE PK recover error. "); + PrintAndLogEx(WARNING, "WARNING: ICC PE PK recover error. "); } else { PrintAndLogEx(SUCCESS, "ICC PE PK recovered. RID %02hhx:%02hhx:%02hhx:%02hhx:%02hhx IDX %02hhx CSN %02hhx:%02hhx:%02hhx\n", icc_pe_pk->rid[0], @@ -807,7 +807,7 @@ int trDDA(EMVCommandChannel channel, bool decodeTLV, struct tlvdb *tlv) { PrintAndLogEx(SUCCESS, "ATC check OK."); PrintAndLogEx(SUCCESS, "fDDA (fast DDA) verified OK."); } else { - PrintAndLogEx(ERR, "Error: fDDA verified, but ATC in the certificate and ATC in the record not the same."); + PrintAndLogEx(WARNING, "Error: fDDA verified, but ATC in the certificate and ATC in the record not the same."); } } else { PrintAndLogEx(NORMAL, "\nERROR: fDDA (fast DDA) verify error"); @@ -862,7 +862,7 @@ int trDDA(EMVCommandChannel channel, bool decodeTLV, struct tlvdb *tlv) { struct tlvdb *dda_db = NULL; if (buf[0] == 0x80) { if (len < 3) { - PrintAndLogEx(ERR, "Error: Internal Authenticate format1 parsing error. length=%d", len); + PrintAndLogEx(WARNING, "Warning: Internal Authenticate format1 parsing error. length=%d", len); } else { // parse response 0x80 struct tlvdb *t80 = tlvdb_parse_multi(buf, len); diff --git a/client/fido/fidocore.c b/client/fido/fidocore.c index 21079eb34..c356c3456 100644 --- a/client/fido/fidocore.c +++ b/client/fido/fidocore.c @@ -386,7 +386,7 @@ static int FIDO2CheckSignature(json_t *root, uint8_t *publickey, uint8_t *sign, if (res == -0x4e00) { PrintAndLogEx(WARNING, "Signature is NOT VALID."); } else { - PrintAndLogEx(ERR, "Other signature check error: %x %s", (res < 0) ? -res : res, ecdsa_get_error(res)); + PrintAndLogEx(WARNING, "Other signature check error: %x %s", (res < 0) ? -res : res, ecdsa_get_error(res)); } return res; } else { diff --git a/client/loclass/elite_crack.c b/client/loclass/elite_crack.c index 3e0aa1dc5..5b019d8e0 100644 --- a/client/loclass/elite_crack.c +++ b/client/loclass/elite_crack.c @@ -517,7 +517,7 @@ int bruteforceDump(uint8_t dump[], size_t dumpsize, uint16_t keytable[]) { first16bytes[i] = keytable[i] & 0xFF; if (!(keytable[i] & CRACKED)) - PrintAndLogDevice(ERR, "error, we are missing byte %d, custom key calculation will fail...", i); + PrintAndLogDevice(WARNING, "Warning: we are missing byte %d, custom key calculation will fail...", i); } errors += calculateMasterKey(first16bytes, NULL); return errors; @@ -557,7 +557,7 @@ int bruteforceFile(const char *filename, uint16_t keytable[]) { fclose(f); if (bytes_read < fsize) { - PrintAndLogDevice(ERR, "Error, could only read %d bytes (should be %d)", bytes_read, fsize); + PrintAndLogDevice(WARNING, "Warning: could only read %d bytes (should be %d)", bytes_read, fsize); } uint8_t res = bruteforceDump(dump, fsize, keytable); diff --git a/client/mifare/mad.c b/client/mifare/mad.c index fa5b7d259..47b7cb70a 100644 --- a/client/mifare/mad.c +++ b/client/mifare/mad.c @@ -225,7 +225,7 @@ int MAD1DecodeAndPrint(uint8_t *sector, bool verbose, bool *haveMAD2) { PrintAndLogEx(NORMAL, "Card publisher sector not present."); } if (InfoByte == 0x10 || InfoByte >= 0x28) - PrintAndLogEx(ERR, "Info byte error"); + PrintAndLogEx(WARNING, "Info byte error"); PrintAndLogEx(NORMAL, "00 MAD1"); for (int i = 1; i < 16; i++) {