From 53b48ae6a978863af650624ac341f2f8305b6af0 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 17 Apr 2019 11:55:52 +0200 Subject: [PATCH] use printandlogex --- client/fido/cose.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/client/fido/cose.c b/client/fido/cose.c index a3fc9755c..b5c6a3511 100644 --- a/client/fido/cose.c +++ b/client/fido/cose.c @@ -163,16 +163,16 @@ int COSEGetECDSAKey(uint8_t *data, size_t datalen, bool verbose, uint8_t *public size_t len; if (verbose) - PrintAndLog("----------- CBOR decode ----------------"); + PrintAndLogEx(NORMAL, "----------- CBOR decode ----------------"); // kty int res = CborMapGetKeyById(&parser, &map, data, datalen, 1); if (!res) { cbor_value_get_int64(&map, &i64); if (verbose) - PrintAndLog("kty [%lld] %s", (long long)i64, GetCOSEktyDescription(i64)); + PrintAndLogEx(SUCCESS, "kty [%lld] %s", (long long)i64, GetCOSEktyDescription(i64)); if (i64 != 2) - PrintAndLog("ERROR: kty must be 2."); + PrintAndLogEx(ERR, "ERROR: kty must be 2."); } // algorithm @@ -180,9 +180,9 @@ int COSEGetECDSAKey(uint8_t *data, size_t datalen, bool verbose, uint8_t *public if (!res) { cbor_value_get_int64(&map, &i64); if (verbose) - PrintAndLog("algorithm [%lld] %s", (long long)i64, GetCOSEAlgDescription(i64)); + PrintAndLogEx(SUCCESS, "algorithm [%lld] %s", (long long)i64, GetCOSEAlgDescription(i64)); if (i64 != -7) - PrintAndLog("ERROR: algorithm must be -7."); + PrintAndLogEx(ERR, "ERROR: algorithm must be -7."); } // curve @@ -190,9 +190,9 @@ int COSEGetECDSAKey(uint8_t *data, size_t datalen, bool verbose, uint8_t *public if (!res) { cbor_value_get_int64(&map, &i64); if (verbose) - PrintAndLog("curve [%lld] %s", (long long)i64, GetCOSECurveDescription(i64)); + PrintAndLogEx(SUCCESS, "curve [%lld] %s", (long long)i64, GetCOSECurveDescription(i64)); if (i64 != 1) - PrintAndLog("ERROR: curve must be 1."); + PrintAndLogEx(ERR, "ERROR: curve must be 1."); } // plain key @@ -204,9 +204,9 @@ int COSEGetECDSAKey(uint8_t *data, size_t datalen, bool verbose, uint8_t *public res = CborGetBinStringValue(&map, &public_key[1], 32, &len); cbor_check(res); if (verbose) - PrintAndLog("x - coordinate [%d]: %s", len, sprint_hex(&public_key[1], 32)); + PrintAndLogEx(SUCCESS, "x - coordinate [%d]: %s", len, sprint_hex(&public_key[1], 32)); if (len != 32) - PrintAndLog("ERROR: x - coordinate length must be 32."); + PrintAndLogEx(ERR, "ERROR: x - coordinate length must be 32."); } // y - coordinate @@ -215,9 +215,9 @@ int COSEGetECDSAKey(uint8_t *data, size_t datalen, bool verbose, uint8_t *public res = CborGetBinStringValue(&map, &public_key[33], 32, &len); cbor_check(res); if (verbose) - PrintAndLog("y - coordinate [%d]: %s", len, sprint_hex(&public_key[33], 32)); + PrintAndLogEx(SUCCESS, "y - coordinate [%d]: %s", len, sprint_hex(&public_key[33], 32)); if (len != 32) - PrintAndLog("ERROR: y - coordinate length must be 32."); + PrintAndLogEx(ERR, "ERROR: y - coordinate length must be 32."); } // d - private key @@ -227,11 +227,11 @@ int COSEGetECDSAKey(uint8_t *data, size_t datalen, bool verbose, uint8_t *public res = CborGetBinStringValue(&map, private_key, sizeof(private_key), &len); cbor_check(res); if (verbose) - PrintAndLog("d - private key [%d]: %s", len, sprint_hex(private_key, len)); + PrintAndLogEx(SUCCESS, "d - private key [%d]: %s", len, sprint_hex(private_key, len)); } if (verbose) - PrintAndLog("----------- CBOR decode ----------------"); + PrintAndLogEx(NORMAL, "----------- CBOR decode ----------------"); return 0; }