mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
added showCBOR
This commit is contained in:
parent
b9c4bd1e0c
commit
b0e0ccb05f
1 changed files with 12 additions and 7 deletions
|
@ -658,7 +658,7 @@ bool CheckrpIdHash(json_t *json, uint8_t *hash) {
|
||||||
return !memcmp(hash, hash2, 32);
|
return !memcmp(hash, hash2, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
int MakeCredentionalParseRes(json_t *root, uint8_t *data, size_t dataLen, bool verbose, bool showDERTLV) {
|
int MakeCredentionalParseRes(json_t *root, uint8_t *data, size_t dataLen, bool verbose, bool showCBOR, bool showDERTLV) {
|
||||||
CborParser parser;
|
CborParser parser;
|
||||||
CborValue map, mapsmt;
|
CborValue map, mapsmt;
|
||||||
int res;
|
int res;
|
||||||
|
@ -724,7 +724,7 @@ int MakeCredentionalParseRes(json_t *root, uint8_t *data, size_t dataLen, bool v
|
||||||
uint8_t coseKey[65] = {0};
|
uint8_t coseKey[65] = {0};
|
||||||
uint16_t cplen = n - 55 - cridlen;
|
uint16_t cplen = n - 55 - cridlen;
|
||||||
PrintAndLog("Credentional public key (COSE_KEY)[%d]: %s", cplen, sprint_hex(&ubuf[55 + cridlen], cplen));
|
PrintAndLog("Credentional public key (COSE_KEY)[%d]: %s", cplen, sprint_hex(&ubuf[55 + cridlen], cplen));
|
||||||
if (verbose) {
|
if (showCBOR) {
|
||||||
TinyCborPrintFIDOPackage(fido2COSEKey, true, &ubuf[55 + cridlen], cplen);
|
TinyCborPrintFIDOPackage(fido2COSEKey, true, &ubuf[55 + cridlen], cplen);
|
||||||
}
|
}
|
||||||
res = COSEGetECDSAKey(&ubuf[55 + cridlen], cplen, verbose, coseKey);
|
res = COSEGetECDSAKey(&ubuf[55 + cridlen], cplen, verbose, coseKey);
|
||||||
|
@ -831,6 +831,7 @@ int CmdHFFido2MakeCredential(const char *cmd) {
|
||||||
char fname[300] = {0};
|
char fname[300] = {0};
|
||||||
bool verbose = true;
|
bool verbose = true;
|
||||||
bool showDERTLV = true;
|
bool showDERTLV = true;
|
||||||
|
bool showCBOR = true;
|
||||||
|
|
||||||
int res = GetExistsFileNameJson("fido", "fido2", fname);
|
int res = GetExistsFileNameJson("fido", "fido2", fname);
|
||||||
if(res) {
|
if(res) {
|
||||||
|
@ -869,8 +870,10 @@ int CmdHFFido2MakeCredential(const char *cmd) {
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
if (showCBOR) {
|
||||||
PrintAndLog("CBOR make credentional request:");
|
PrintAndLog("CBOR make credentional request:");
|
||||||
TinyCborPrintFIDOPackage(fido2CmdMakeCredential, false, data, datalen);
|
TinyCborPrintFIDOPackage(fido2CmdMakeCredential, false, data, datalen);
|
||||||
|
}
|
||||||
|
|
||||||
res = FIDO2MakeCredential(data, datalen, buf, sizeof(buf), &len, &sw);
|
res = FIDO2MakeCredential(data, datalen, buf, sizeof(buf), &len, &sw);
|
||||||
DropField();
|
DropField();
|
||||||
|
@ -890,11 +893,13 @@ int CmdHFFido2MakeCredential(const char *cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLog("MakeCredential result (%d b) OK.", len);
|
PrintAndLog("MakeCredential result (%d b) OK.", len);
|
||||||
|
if (showCBOR) {
|
||||||
PrintAndLog("CBOR make credentional response:");
|
PrintAndLog("CBOR make credentional response:");
|
||||||
TinyCborPrintFIDOPackage(fido2CmdMakeCredential, true, &buf[1], len - 1);
|
TinyCborPrintFIDOPackage(fido2CmdMakeCredential, true, &buf[1], len - 1);
|
||||||
|
}
|
||||||
|
|
||||||
// parse returned cbor
|
// parse returned cbor
|
||||||
MakeCredentionalParseRes(root, &buf[1], len - 1, verbose, showDERTLV);
|
MakeCredentionalParseRes(root, &buf[1], len - 1, verbose, showCBOR, showDERTLV);
|
||||||
|
|
||||||
json_decref(root);
|
json_decref(root);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue