Skip to content

Commit

Permalink
fix: read aaguid from device config
Browse files Browse the repository at this point in the history
  • Loading branch information
jocover committed Feb 27, 2024
1 parent fc3f0fd commit f7453ca
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main/applets/ctap/ctap.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
send_keepalive_during_processing(WAIT_ENTRY_CTAPHID); \
} while (0)

static const uint8_t aaguid[] = {0x24, 0x4e, 0xb2, 0x9e, 0xe0, 0x90, 0x4e, 0x49,
0x81, 0xfe, 0x1f, 0x20, 0xf8, 0xd3, 0xb8, 0xf4};

// pin & command states
static uint8_t consecutive_pin_counter, last_cmd;
// SM2 attr
Expand Down Expand Up @@ -274,7 +271,8 @@ uint8_t ctap_make_auth_data(uint8_t *rp_id_hash, uint8_t *buf, uint8_t flags, co
// If no credProtect extension was included in the request the authenticator SHOULD use the default value of 1 for compatibility with CTAP2.0 platforms.
if (cred_protect == CRED_PROTECT_ABSENT) cred_protect = CRED_PROTECT_VERIFICATION_OPTIONAL;

memcpy(ad->at.aaguid, aaguid, sizeof(aaguid));
device_get_aaguid(ad->at.aaguid,16);

ad->at.credential_id_length = htobe16(sizeof(credential_id));
memcpy(ad->at.credential_id.rp_id_hash, rp_id_hash, sizeof(ad->at.credential_id.rp_id_hash));
if (generate_key_handle(&ad->at.credential_id, ad->at.public_key, alg_type, (uint8_t)dc, cred_protect) < 0) {
Expand Down

0 comments on commit f7453ca

Please sign in to comment.