diff --git a/src/fido/cbor_get_info.c b/src/fido/cbor_get_info.c index 34c7af2..3c6c7cd 100644 --- a/src/fido/cbor_get_info.c +++ b/src/fido/cbor_get_info.c @@ -164,9 +164,19 @@ int cbor_get_info() { if (phy_data.vid != 0x1050) { #endif CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x15)); - CBOR_CHECK(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, 2)); + uint8_t enabled_cmds = 2; +#ifndef ENABLE_EMULATION + enabled_cmds += 4; +#endif + CBOR_CHECK(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, enabled_cmds)); CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_AUT_ENABLE)); CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_AUT_DISABLE)); +#ifndef ENABLE_EMULATION + CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_PHY_VIDPID)); + CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_PHY_LED_BTNESS)); + CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_PHY_LED_GPIO)); + CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_PHY_OPTS)); +#endif CBOR_CHECK(cbor_encoder_close_container(&mapEncoder, &arrayEncoder)); #ifndef ENABLE_EMULATION } diff --git a/src/fido/ctap.h b/src/fido/ctap.h index 4c6aa31..46ad887 100644 --- a/src/fido/ctap.h +++ b/src/fido/ctap.h @@ -114,10 +114,12 @@ typedef struct { #define CTAP_CONFIG_AUT_ENABLE 0x03e43f56b34285e2 #define CTAP_CONFIG_AUT_DISABLE 0x1831a40f04a25ed9 +#ifndef ENABLE_EMULATION #define CTAP_CONFIG_PHY_VIDPID 0x6fcb19b0cbe3acfa -#define CTAP_CONFIG_PHY_LED_GPIO 0x7b392a394de9f948 #define CTAP_CONFIG_PHY_LED_BTNESS 0x76a85945985d02fd +#define CTAP_CONFIG_PHY_LED_GPIO 0x7b392a394de9f948 #define CTAP_CONFIG_PHY_OPTS 0x969f3b09eceb805f +#endif #define CTAP_VENDOR_CBOR (CTAPHID_VENDOR_FIRST + 1)