mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-04-26 19:00:34 +02:00
Added CTAPHID_CANCEL support.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -146,6 +146,7 @@ uint32_t lock = 0;
|
||||
|
||||
uint8_t thread_type = 0; //1 is APDU, 2 is CBOR
|
||||
extern void cbor_thread();
|
||||
extern bool cancel_button;
|
||||
|
||||
int driver_process_usb_nopacket() {
|
||||
if (last_packet_time > 0 && last_packet_time+500 < board_millis()) {
|
||||
@@ -295,6 +296,12 @@ int driver_process_usb_packet(uint16_t read) {
|
||||
if (apdu_sent < 0)
|
||||
return ctap_error(-apdu_sent);
|
||||
}
|
||||
else if (ctap_req->init.cmd == CTAPHID_CANCEL) {
|
||||
ctap_error(0x2D);
|
||||
msg_packet.len = msg_packet.current_len = 0;
|
||||
last_packet_time = 0;
|
||||
cancel_button = true;
|
||||
}
|
||||
else {
|
||||
if (msg_packet.len == 0)
|
||||
return ctap_error(CTAP1_ERR_INVALID_CMD);
|
||||
|
||||
Reference in New Issue
Block a user