Loading...
Searching...
No Matches

Definition for CTAPHID helper functions. More...

Detailed Description

Definition for CTAPHID helper functions.

Author
Nils Ollrogge nils..nosp@m.ollr.nosp@m.ogge@.nosp@m.fu-b.nosp@m.erlin.nosp@m..de

Definition in file ctap_hid.h.

#include <stdint.h>
#include "usb/usbus/hid.h"
+ Include dependency graph for ctap_hid.h:

Go to the source code of this file.

Data Structures

struct  ctap_hid_init_pkt_t
 CTAP_HID initialization packet struct. More...
 
struct  ctap_hid_cont_pkt_t
 CTAP_HID continuation packet struct. More...
 
struct  ctap_hid_pkt_t
 CTAP_HID packet struct. More...
 
struct  ctap_hid_init_resp_t
 CTAP_HID initialization response struct. More...
 
struct  ctap_hid_cid_t
 CTAP_HID channel identifier struct. More...
 

Macros

#define CTAP_HID_PROTOCOL_VERSION   0x02
 CTAP_HID protocol version.
 
#define CTAP_HID_INIT_NONCE_SIZE   8
 CTAP_HID size of nonce for init request.
 
#define CTAP_HID_TRANSACTION_TIMEOUT_MS   (500)
 CTAP_HID transaction timeout in microseconds.
 
#define CTAP_HID_BUFFER_SIZE   7609
 CTAP_HID max message payload size.
 
#define CTAP_HID_CIDS_MAX   0x08
 CTAP_HID max number of channels.
 
#define CTAP_HID_WINK_DELAY   400
 CTAP_HID animation delay in milliseconds for wink command.
 
#define CTAP_HID_BROADCAST_CID   0xffffffff
 CTAP_HID broadcast channel identifier.
 

Functions

void fido2_ctap_transport_hid_init (event_queue_t *queue)
 Initialize CTAPHID.
 
void fido2_ctap_transport_hid_handle_packet (void *pkt_raw)
 Handle CTAP_HID packet.
 
void fido2_ctap_transport_hid_check_timeouts (void)
 Check logical channels for timeouts.
 
bool fido2_ctap_transport_hid_should_cancel (void)
 Check if CTAPHID layer has received CANCEL command.
 

CTAP_HID packet type payload sizes

#define CTAP_HID_INIT_PAYLOAD_SIZE   (CONFIG_USBUS_HID_INTERRUPT_EP_SIZE - 7)
 endpoint size - init packet metadata
 
#define CTAP_HID_CONT_PAYLOAD_SIZE   (CONFIG_USBUS_HID_INTERRUPT_EP_SIZE - 5)
 endpoint size - cont packet metadata
 

CTAP_HID packet type identifiers

#define CTAP_HID_INIT_PACKET   0x80
 initialization packet identifier
 
#define CTAP_HID_CONT_PACKET   0x00
 continuation packet identifier
 

CTAP_HID commands

#define CTAP_HID_COMMAND_PING   (0x01 | CTAP_HID_INIT_PACKET)
 CTAPHID_PING command.
 
#define CTAP_HID_COMMAND_MSG   (0x03 | CTAP_HID_INIT_PACKET)
 CTAPHID_MSG command.
 
#define CTAP_HID_COMMAND_LOCK   (0x04 | CTAP_HID_INIT_PACKET)
 CTAPHID_LOCK command.
 
#define CTAP_HID_COMMAND_INIT   (0x06 | CTAP_HID_INIT_PACKET)
 CTAPHID_INIT command.
 
#define CTAP_HID_COMMAND_WINK   (0x08 | CTAP_HID_INIT_PACKET)
 CTAPHID_WINK command.
 
#define CTAP_HID_COMMAND_CBOR   (0x10 | CTAP_HID_INIT_PACKET)
 CTAPHID_CBOR command.
 
#define CTAP_HID_COMMAND_CANCEL   (0x11 | CTAP_HID_INIT_PACKET)
 CTAPHID_CANCEL command.
 
#define CTAP_HID_COMMAND_KEEPALIVE   (0x3b | CTAP_HID_INIT_PACKET)
 CTAPHID_KEEPALIVE command.
 
#define CTAP_HID_COMMAND_ERROR   (0x3f | CTAP_HID_INIT_PACKET)
 CTAPHID_ERROR command.
 

CTAP_HID capability flags

#define CTAP_HID_CAPABILITY_WINK   0x01
 If set, authenticator implements CTAPHID_WINK function.
 
#define CTAP_HID_CAPABILITY_CBOR   0x04
 If set, authenticator implements CTAPHID_CBOR function.
 
#define CTAP_HID_CAPABILITY_NMSG   0x08
 If set, authenticator DOES NOT implement CTAPHID_MSG function (CTAP1 / U2F)
 

CTAP_HID error codes

#define CTAP_HID_OK   0x00
 Success.
 
#define CTAP_HID_ERR_INVALID_CMD   0x01
 The command in the request is invalid.
 
#define CTAP_HID_ERR_INVALID_PAR   0x02
 The parameter(s) in the request is invalid.
 
#define CTAP_HID_ERR_INVALID_LEN   0x03
 The length field (BCNT) is invalid for the request.
 
#define CTAP_HID_ERR_INVALID_SEQ   0x04
 The sequence does not match expected value.
 
#define CTAP_HID_ERR_MSG_TIMEOUT   0x05
 The message has timed out.
 
#define CTAP_HID_ERR_CHANNEL_BUSY   0x06
 The device is busy for the requesting channel.
 
#define CTAP_HID_ERR_LOCK_REQUIRED   0x0a
 Command requires channel lock.
 
#define CTAP_HID_ERR_INVALID_CHANNEL   0x0b
 CID is not valid.
 
#define CTAP_HID_ERR_OTHER   0x7f
 Unspecified error.
 

CTAP_HID status codes

#define CTAP_HID_STATUS_PROCESSING   0x01
 processing status code
 
#define CTAP_HID_STATUS_UPNEEDED   0x02
 user presence needed status code
 

CTAP_HID buffer status

#define CTAP_HID_BUFFER_STATUS_BUFFERING   0x00
 packets are being buffered
 
#define CTAP_HID_BUFFER_STATUS_DONE   0x01
 packet processing done
 
#define CTAP_HID_BUFFER_STATUS_ERROR   0x02
 error occurred processing packets