remove dump_buffer_simple

This commit is contained in:
iceman1001
2020-11-11 18:05:05 +01:00
parent 8f67b511a6
commit bf4cdf6eb7
4 changed files with 16 additions and 26 deletions

View File

@@ -274,7 +274,7 @@ int FIDOCheckDERAndGetKey(uint8_t *der, size_t derLen, bool verbose, uint8_t *pu
}
if (verbose)
PrintAndLogEx(NORMAL, "------------------DER-------------------");
PrintAndLogEx(INFO, "------------------DER-------------------");
mbedtls_x509_crt_free(&cert);
mbedtls_x509_crt_free(&cacert);
@@ -366,8 +366,8 @@ static int FIDO2CheckSignature(json_t *root, uint8_t *publickey, uint8_t *sign,
int res = ecdsa_asn1_get_signature(sign, signLen, rval, sval);
if (!res) {
if (verbose) {
PrintAndLogEx(NORMAL, " r: %s", sprint_hex(rval, 32));
PrintAndLogEx(NORMAL, " s: %s", sprint_hex(sval, 32));
PrintAndLogEx(INFO, " r: %s", sprint_hex(rval, 32));
PrintAndLogEx(INFO, " s: %s", sprint_hex(sval, 32));
}
uint8_t clientDataHash[32] = {0};
@@ -488,9 +488,9 @@ int FIDO2MakeCredentionalParseRes(json_t *root, uint8_t *data, size_t dataLen, b
if (showCBOR) {
PrintAndLogEx(INFO, "COSE structure:");
PrintAndLogEx(NORMAL, "---------------- CBOR ------------------");
PrintAndLogEx(INFO, "---------------- CBOR ------------------");
TinyCborPrintFIDOPackage(fido2COSEKey, true, &ubuf[55 + cridlen], cplen);
PrintAndLogEx(NORMAL, "---------------- CBOR ------------------");
PrintAndLogEx(INFO, "---------------- CBOR ------------------");
}
res = COSEGetECDSAKey(&ubuf[55 + cridlen], cplen, verbose, coseKey);
@@ -542,11 +542,12 @@ int FIDO2MakeCredentionalParseRes(json_t *root, uint8_t *data, size_t dataLen, b
res = CborGetArrayBinStringValue(&mapsmt, der, sizeof(der), &derLen);
cbor_check(res);
if (verbose2) {
PrintAndLogEx(NORMAL, "DER certificate[%zu]:\n------------------DER-------------------", derLen);
dump_buffer_simple((const unsigned char *)der, derLen, NULL);
PrintAndLogEx(NORMAL, "\n----------------DER---------------------");
PrintAndLogEx(INFO, "DER certificate[%zu]:", derLen);
PrintAndLogEx(INFO, "------------------DER-------------------");
PrintAndLogEx(INFO, "%s", sprint_hex(der, derLen));
PrintAndLogEx(INFO, "----------------DER---------------------");
} else {
PrintAndLogEx(NORMAL, "DER [%zu]: %s...", derLen, sprint_hex(der, MIN(derLen, 16)));
PrintAndLogEx(INFO, "DER [%zu]: %s...", derLen, sprint_hex(der, MIN(derLen, 16)));
}
JsonSaveBufAsHexCompact(root, "$.AppData.DER", der, derLen);
}
@@ -558,9 +559,9 @@ int FIDO2MakeCredentionalParseRes(json_t *root, uint8_t *data, size_t dataLen, b
// print DER certificate in TLV view
if (showDERTLV) {
PrintAndLogEx(NORMAL, "----------------DER TLV-----------------");
PrintAndLogEx(INFO, "----------------DER TLV-----------------");
asn1_print(der, derLen, " ");
PrintAndLogEx(NORMAL, "----------------DER TLV-----------------");
PrintAndLogEx(INFO, "----------------DER TLV-----------------");
}
FIDOCheckDERAndGetKey(der, derLen, verbose, public_key, sizeof(public_key));
JsonSaveBufAsHexCompact(root, "$.AppData.DERPublicKey", public_key, sizeof(public_key));