diff --git a/applets/ctap/ctap.c b/applets/ctap/ctap.c index 7bb7b351..e93f0a7d 100644 --- a/applets/ctap/ctap.c +++ b/applets/ctap/ctap.c @@ -2084,3 +2084,8 @@ int ctap_process_apdu(const CAPDU *capdu, RAPDU *rapdu) { else return 0; } + +int ctap_wink(void) { + start_blinking_interval(1, 50); +} + diff --git a/include/ctap.h b/include/ctap.h index 740f5613..fe94f09d 100644 --- a/include/ctap.h +++ b/include/ctap.h @@ -10,5 +10,6 @@ int ctap_install_private_key(const CAPDU *capdu, RAPDU *rapdu); int ctap_install_cert(const CAPDU *capdu, RAPDU *rapdu); int ctap_process_cbor(uint8_t *req, size_t req_len, uint8_t *resp, size_t *resp_len); int ctap_process_apdu(const CAPDU *capdu, RAPDU *rapdu); +int ctap_wink(void); #endif // CANOKEY_CORE_FIDO2_FIDO2_H_ diff --git a/interfaces/USB/class/ctaphid/ctaphid.c b/interfaces/USB/class/ctaphid/ctaphid.c index a9b1a1fe..c2162676 100644 --- a/interfaces/USB/class/ctaphid/ctaphid.c +++ b/interfaces/USB/class/ctaphid/ctaphid.c @@ -208,6 +208,11 @@ uint8_t CTAPHID_Loop(uint8_t wait_for_user) { else CTAPHID_SendResponse(channel.cid, channel.cmd, channel.data, channel.bcnt_total); break; + case CTAPHID_WINK: + DBG_MSG("WINK\n"); + if (!wait_for_user) ctap_wink(); + CTAPHID_SendResponse(channel.cid, channel.cmd, channel.data, 0); + break; case CTAPHID_CANCEL: DBG_MSG("CANCEL\n"); ret = LOOP_CANCEL;