Skip to content

Commit

Permalink
enable clientPin support
Browse files Browse the repository at this point in the history
  • Loading branch information
jocover committed Jan 19, 2024
1 parent c47f34b commit 0e3bfb4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ menu "ESP32 U2F GPIO Configuration"
Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink.

config BUTTON_ENABLE
bool "enable button support"
default y
bool "enable Button support"
default n
help
Use button to confirm enter,Default use automatically enter

Expand Down
10 changes: 5 additions & 5 deletions main/ctap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ static uint8_t ctap_get_info(CborEncoder *encoder) {
ret = cbor_encode_int(&map, GI_RESP_OPTIONS);
CHECK_CBOR_RET(ret);
CborEncoder option_map;
ret = cbor_encoder_create_map(&map, &option_map, 5);
ret = cbor_encoder_create_map(&map, &option_map, 6);
CHECK_CBOR_RET(ret);
{
ret = cbor_encode_text_stringz(&option_map, "rk");
Expand All @@ -1282,10 +1282,10 @@ static uint8_t ctap_get_info(CborEncoder *encoder) {
CHECK_CBOR_RET(ret);
ret = cbor_encode_boolean(&option_map, true);
CHECK_CBOR_RET(ret);
//ret = cbor_encode_text_stringz(&option_map, "clientPin");
//CHECK_CBOR_RET(ret);
//ret = cbor_encode_boolean(&option_map, has_pin());
//CHECK_CBOR_RET(ret);
ret = cbor_encode_text_stringz(&option_map, "clientPin");
CHECK_CBOR_RET(ret);
ret = cbor_encode_boolean(&option_map, has_pin());
CHECK_CBOR_RET(ret);
ret = cbor_encode_text_stringz(&option_map, "largeBlobs");
CHECK_CBOR_RET(ret);
ret = cbor_encode_boolean(&option_map, true);
Expand Down
4 changes: 3 additions & 1 deletion main/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,14 @@ void device_init(void)
{
ESP_LOGI(TAG, "cert file initialization");

ctap_install(true);
ctap_install(1);

ctap_install_cert(u2f_cert_start, u2f_cert_end - u2f_cert_start);
ctap_install_private_key(u2f_cert_key_start, u2f_cert_key_end - u2f_cert_key_start);
}

ctap_install(0);

ESP_LOGI(TAG, "u2f device init done");
}

Expand Down

0 comments on commit 0e3bfb4

Please sign in to comment.