Skip to content

Commit f7453ca

Browse files
committed
fix: read aaguid from device config
1 parent fc3f0fd commit f7453ca

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

main/applets/ctap/ctap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
send_keepalive_during_processing(WAIT_ENTRY_CTAPHID); \
5454
} while (0)
5555

56-
static const uint8_t aaguid[] = {0x24, 0x4e, 0xb2, 0x9e, 0xe0, 0x90, 0x4e, 0x49,
57-
0x81, 0xfe, 0x1f, 0x20, 0xf8, 0xd3, 0xb8, 0xf4};
58-
5956
// pin & command states
6057
static uint8_t consecutive_pin_counter, last_cmd;
6158
// SM2 attr
@@ -274,7 +271,8 @@ uint8_t ctap_make_auth_data(uint8_t *rp_id_hash, uint8_t *buf, uint8_t flags, co
274271
// If no credProtect extension was included in the request the authenticator SHOULD use the default value of 1 for compatibility with CTAP2.0 platforms.
275272
if (cred_protect == CRED_PROTECT_ABSENT) cred_protect = CRED_PROTECT_VERIFICATION_OPTIONAL;
276273

277-
memcpy(ad->at.aaguid, aaguid, sizeof(aaguid));
274+
device_get_aaguid(ad->at.aaguid,16);
275+
278276
ad->at.credential_id_length = htobe16(sizeof(credential_id));
279277
memcpy(ad->at.credential_id.rp_id_hash, rp_id_hash, sizeof(ad->at.credential_id.rp_id_hash));
280278
if (generate_key_handle(&ad->at.credential_id, ad->at.public_key, alg_type, (uint8_t)dc, cred_protect) < 0) {

0 commit comments

Comments
 (0)