From fdc5a68fcd20bd35158075d13501c05b8e670b81 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Sat, 21 Mar 2020 13:15:07 -0400 Subject: [PATCH] update info/feature detection details --- fido2/ctap.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/fido2/ctap.c b/fido2/ctap.c index 2d8a010..319f9cd 100644 --- a/fido2/ctap.c +++ b/fido2/ctap.c @@ -75,20 +75,22 @@ uint8_t ctap_get_info(CborEncoder * encoder) uint8_t aaguid[16]; device_read_aaguid(aaguid); - ret = cbor_encoder_create_map(encoder, &map, 6); + ret = cbor_encoder_create_map(encoder, &map, 8); check_ret(ret); { ret = cbor_encode_uint(&map, RESP_versions); // versions key check_ret(ret); { - ret = cbor_encoder_create_array(&map, &array, 2); + ret = cbor_encoder_create_array(&map, &array, 3); check_ret(ret); { ret = cbor_encode_text_stringz(&array, "U2F_V2"); check_ret(ret); ret = cbor_encode_text_stringz(&array, "FIDO_2_0"); check_ret(ret); + ret = cbor_encode_text_stringz(&array, "FIDO_2_1_PRE"); + check_ret(ret); } ret = cbor_encoder_close_container(&map, &array); check_ret(ret); @@ -97,11 +99,14 @@ uint8_t ctap_get_info(CborEncoder * encoder) ret = cbor_encode_uint(&map, RESP_extensions); check_ret(ret); { - ret = cbor_encoder_create_array(&map, &array, 1); + ret = cbor_encoder_create_array(&map, &array, 2); check_ret(ret); { ret = cbor_encode_text_stringz(&array, "hmac-secret"); check_ret(ret); + + ret = cbor_encode_text_stringz(&array, "credProtect"); + check_ret(ret); } ret = cbor_encoder_close_container(&map, &array); check_ret(ret); @@ -117,7 +122,7 @@ uint8_t ctap_get_info(CborEncoder * encoder) ret = cbor_encode_uint(&map, RESP_options); check_ret(ret); { - ret = cbor_encoder_create_map(&map, &options,4); + ret = cbor_encoder_create_map(&map, &options,5); check_ret(ret); { ret = cbor_encode_text_string(&options, "rk", 2); @@ -151,6 +156,12 @@ uint8_t ctap_get_info(CborEncoder * encoder) check_ret(ret); } + ret = cbor_encode_text_string(&options, "credMgmt", 8); + check_ret(ret); + { + ret = cbor_encode_boolean(&options, 1); + check_ret(ret); + } ret = cbor_encode_text_string(&options, "clientPin", 9); check_ret(ret); @@ -160,6 +171,8 @@ uint8_t ctap_get_info(CborEncoder * encoder) } + + } ret = cbor_encoder_close_container(&map, &options); check_ret(ret); @@ -186,9 +199,19 @@ uint8_t ctap_get_info(CborEncoder * encoder) } + ret = cbor_encode_uint(&map, 0x07); //maxCredentialCountInList + check_ret(ret); + { + ret = cbor_encode_uint(&map, ALLOW_LIST_MAX_SIZE); + check_ret(ret); + } - - + ret = cbor_encode_uint(&map, 0x08); // maxCredentialIdLength + check_ret(ret); + { + ret = cbor_encode_uint(&map, 128); + check_ret(ret); + } } ret = cbor_encoder_close_container(encoder, &map);