mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
refactoring
This commit is contained in:
parent
a9be05dbf7
commit
26cf350713
3 changed files with 17 additions and 16 deletions
|
@ -463,3 +463,19 @@ int CBOREncodeElm(json_t *root, char *rootElmId, CborEncoder *encoder) {
|
|||
|
||||
return res;
|
||||
}
|
||||
|
||||
CborError CBOREncodeClientDataHash(json_t *root, CborEncoder *encoder) {
|
||||
uint8_t buf[100] = {0};
|
||||
size_t jlen;
|
||||
|
||||
JsonLoadBufAsHex(root, "$.ClientDataHash", buf, sizeof(buf), &jlen);
|
||||
|
||||
// fill with 0x00 if not found
|
||||
if (!jlen)
|
||||
jlen = 32;
|
||||
|
||||
int res = cbor_encode_byte_string(encoder, buf, jlen);
|
||||
cbor_check(res);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue