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
|
@ -9,7 +9,14 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "asn1utils.h"
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <mbedtls/asn1.h>
|
||||
#include "emv/tlv.h"
|
||||
#include "emv/dump.h"
|
||||
#include "asn1dump.h"
|
||||
#include "util.h"
|
||||
#include "ui.h" // PrintAndLog
|
||||
|
||||
int ecdsa_asn1_get_signature(uint8_t *signature, size_t signaturelen, uint8_t *rval, uint8_t *sval) {
|
||||
if (!signature || !signaturelen || !rval || !sval)
|
||||
|
@ -55,7 +62,27 @@ exit:
|
|||
return res;
|
||||
}
|
||||
|
||||
int asn1_print(uint8_t *asn1buf, int level) {
|
||||
static bool print_cb(void *data, const struct tlv *tlv, int level, bool is_leaf) {
|
||||
bool candump = true;
|
||||
asn1_tag_dump(tlv, stdout, level, &candump);
|
||||
if (is_leaf && candump) {
|
||||
dump_buffer(tlv->value, tlv->len, stdout, level);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int asn1_print(uint8_t *asn1buf, size_t asn1buflen, char *indent) {
|
||||
|
||||
struct tlvdb *t = NULL;
|
||||
t = tlvdb_parse_multi(asn1buf, asn1buflen);
|
||||
if (t) {
|
||||
tlvdb_visit(t, print_cb, NULL, 0);
|
||||
tlvdb_free(t);
|
||||
} else {
|
||||
PrintAndLogEx(ERR, "Can't parse data as TLV tree.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue