diff --git a/src/fido/cbor_config.c b/src/fido/cbor_config.c index e29eb2b..9a2ffb3 100644 --- a/src/fido/cbor_config.c +++ b/src/fido/cbor_config.c @@ -243,6 +243,21 @@ int cbor_config(const uint8_t *data, size_t len) { CBOR_ERROR(CTAP2_ERR_MISSING_PARAMETER); } } + else if (vendorCommandId == CTAP_CONFIG_PHY_LED_GPIO || vendorCommandId == CTAP_CONFIG_PHY_LED_BTNESS) { + if (vendorParam != 0) { + if (vendorCommandId == CTAP_CONFIG_PHY_LED_GPIO) { + tmp[PHY_LED_GPIO] = (uint8_t)vendorParam; + opts |= PHY_OPT_GPIO; + } + else if (vendorCommandId == CTAP_CONFIG_PHY_LED_BTNESS) { + tmp[PHY_LED_BTNESS] = (uint8_t)vendorParam; + opts |= PHY_OPT_BTNESS; + } + } + else { + CBOR_ERROR(CTAP2_ERR_MISSING_PARAMETER); + } + } else if (vendorCommandId == CTAP_CONFIG_PHY_OPTS) { if (vendorParam != 0) { uint16_t opt = (uint16_t)vendorParam; diff --git a/src/fido/ctap.h b/src/fido/ctap.h index 1a82ade..28f6bb0 100644 --- a/src/fido/ctap.h +++ b/src/fido/ctap.h @@ -115,6 +115,8 @@ typedef struct { #define CTAP_CONFIG_AUT_ENABLE 0x03e43f56b34285e2 #define CTAP_CONFIG_AUT_DISABLE 0x1831a40f04a25ed9 #define CTAP_CONFIG_PHY_VIDPID 0x6fcb19b0cbe3acfa +#define CTAP_CONFIG_PHY_LED_GPIO 0x7b392a394de9f948 +#define CTAP_CONFIG_PHY_LED_BTNESS 0x76a85945985d02fd #define CTAP_CONFIG_PHY_OPTS 0x969f3b09eceb805f #define CTAP_VENDOR_CBOR (CTAPHID_VENDOR_FIRST + 1)