Fix few zelaous WARNING->ERR

This commit is contained in:
Philippe Teuwen 2019-07-14 12:17:34 +02:00
parent 8bf4b4ad97
commit 55602bf833
13 changed files with 31 additions and 31 deletions

View file

@ -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));

View file

@ -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);

View file

@ -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.");

View file

@ -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);

View file

@ -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));
}

View file

@ -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;

View file

@ -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]);

View file

@ -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) {

View file

@ -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.");
}
}

View file

@ -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);

View file

@ -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 {

View file

@ -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);

View file

@ -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++) {