mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 02:26:59 -07:00
Fido U2F complete (#716)
* add pkwrite * asn1print * asn1dump and CA * added PrintAndLogEx for merge commits between repo easier than now * changelog
This commit is contained in:
parent
e0991f6aa7
commit
6b882a3918
21 changed files with 3703 additions and 17 deletions
|
@ -264,6 +264,23 @@ bool HexToBuffer(const char *errormsg, const char *hexvalue, uint8_t * buffer, s
|
|||
return true;
|
||||
}
|
||||
|
||||
int JsonLoadStr(json_t *root, char *path, char *value) {
|
||||
if (!value)
|
||||
return 1;
|
||||
|
||||
json_t *jelm = json_path_get((const json_t *)root, path);
|
||||
if (!jelm || !json_is_string(jelm))
|
||||
return 2;
|
||||
|
||||
const char * strval = json_string_value(jelm);
|
||||
if (!strval)
|
||||
return 1;
|
||||
|
||||
memcpy(value, strval, strlen(strval));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int JsonLoadBufAsHex(json_t *elm, char *path, uint8_t *data, size_t maxbufferlen, size_t *datalen) {
|
||||
if (datalen)
|
||||
*datalen = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue