mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-31 10:31:23 +02:00
Adding asn1_find_tag() for searching for a tag in a asn1 string.
This commit is contained in:
@@ -91,7 +91,8 @@ int sm_unwrap() {
|
||||
uint8_t *body = NULL;
|
||||
size_t body_size = 0;
|
||||
bool is87 = false;
|
||||
uint8_t tag = 0x0, *tag_data = NULL, *p = NULL;
|
||||
uint16_t tag = 0x0;
|
||||
uint8_t *tag_data = NULL, *p = NULL;
|
||||
size_t tag_len = 0;
|
||||
while (walk_tlv(apdu.data, apdu.nc, &p, &tag, &tag_len, &tag_data)) {
|
||||
if (tag == 0x87 || tag == 0x85) {
|
||||
@@ -180,7 +181,8 @@ int sm_wrap() {
|
||||
}
|
||||
|
||||
int sm_get_le() {
|
||||
uint8_t tag = 0x0, *tag_data = NULL, *p = NULL;
|
||||
uint16_t tag = 0x0;
|
||||
uint8_t *tag_data = NULL, *p = NULL;
|
||||
size_t tag_len = 0;
|
||||
while (walk_tlv(apdu.data, apdu.nc, &p, &tag, &tag_len, &tag_data)) {
|
||||
if (tag == 0x97) {
|
||||
@@ -231,7 +233,8 @@ int sm_verify() {
|
||||
bool some_added = false;
|
||||
const uint8_t *mac = NULL;
|
||||
size_t mac_len = 0;
|
||||
uint8_t tag = 0x0, *tag_data = NULL, *p = NULL;
|
||||
uint16_t tag = 0x0;
|
||||
uint8_t *tag_data = NULL, *p = NULL;
|
||||
size_t tag_len = 0;
|
||||
while (walk_tlv(apdu.data, apdu.nc, &p, &tag, &tag_len, &tag_data)) {
|
||||
if (tag & 0x1) {
|
||||
|
||||
Reference in New Issue
Block a user