19#ifndef __U2F_TRANSPORT_H__
21#define __U2F_TRANSPORT_H__
26#define U2F_CMD_PING 0x81
27#define U2F_CMD_MSG 0x83
28#define CTAP2_CMD_CBOR 0x90
29#define CTAP2_CMD_CANCEL 0x91
32#define U2F_CMD_INIT 0x86
33#define U2F_CMD_LOCK 0x84
34#define U2F_CMD_WINK 0x88
37#define U2F_CMD_KEEPALIVE 0x82
38#define KEEPALIVE_REASON_PROCESSING 0x01
39#define KEEPALIVE_REASON_TUP_NEEDED 0x02
41#define U2F_STATUS_ERROR 0xBF
42#define CTAP2_STATUS_KEEPALIVE 0xBB
45#define ERROR_NONE 0x00
46#define ERROR_INVALID_CMD 0x01
47#define ERROR_INVALID_PAR 0x02
48#define ERROR_INVALID_LEN 0x03
49#define ERROR_INVALID_SEQ 0x04
50#define ERROR_MSG_TIMEOUT 0x05
51#define ERROR_OTHER 0x7f
53#define ERROR_CHANNEL_BUSY 0x06
54#define ERROR_LOCK_REQUIRED 0x0a
55#define ERROR_INVALID_CID 0x0b
57#define ERROR_CBOR_UNEXPECTED_TYPE 0x11
58#define ERROR_INVALID_CBOR 0x12
59#define ERROR_MISSING_PARAMETER 0x14
60#define ERROR_LIMIT_EXCEEDED 0x15
61#define ERROR_UNSUPPORTED_EXTENSION 0x16
62#define ERROR_CREDENTIAL_EXCLUDED 0x19
63#define ERROR_PROCESSING 0x21
64#define ERROR_INVALID_CREDENTIAL 0x22
65#define ERROR_USER_ACTION_PENDING 0x23
66#define ERROR_OPERATION_PENDING 0x24
67#define ERROR_NO_OPERATIONS 0x25
68#define ERROR_UNSUPPORTED_ALGORITHM 0x26
69#define ERROR_OPERATION_DENIED 0x27
70#define ERROR_KEY_STORE_FULL 0x28
71#define ERROR_NO_OPERATION_PENDING 0x2A
72#define ERROR_UNSUPPORTED_OPTION 0x2B
73#define ERROR_INVALID_OPTION 0x2C
74#define ERROR_KEEPALIVE_CANCEL 0x2D
75#define ERROR_NO_CREDENTIALS 0x2E
76#define ERROR_USER_ACTION_TIMEOUT 0x2F
77#define ERROR_NOT_ALLOWED 0x30
78#define ERROR_PIN_INVALID 0x31
79#define ERROR_PIN_BLOCKED 0x32
80#define ERROR_PIN_AUTH_INVALID 0x33
81#define ERROR_PIN_AUTH_BLOCKED 0x34
82#define ERROR_PIN_NOT_SET 0x35
83#define ERROR_PIN_REQUIRED 0x36
84#define ERROR_PIN_POLICY_VIOLATION 0x37
85#define ERROR_PIN_TOKEN_EXPIRED 0x38
86#define ERROR_REQUEST_TOO_LARGE 0x39
87#define ERROR_ACTION_TIMEOUT 0x3A
88#define ERROR_UP_REQUIRED 0x3B
90#define ERROR_PROP_UNKNOWN_COMMAND 0x80
91#define ERROR_PROP_COMMAND_TOO_LONG 0x81
92#define ERROR_PROP_INVALID_CONTINUATION 0x82
93#define ERROR_PROP_UNEXPECTED_CONTINUATION 0x83
94#define ERROR_PROP_CONTINUATION_OVERFLOW 0x84
95#define ERROR_PROP_MESSAGE_TOO_SHORT 0x85
96#define ERROR_PROP_UNCONSISTENT_MSG_LENGTH 0x86
97#define ERROR_PROP_UNSUPPORTED_MSG_APDU 0x87
98#define ERROR_PROP_INVALID_DATA_LENGTH_APDU 0x88
99#define ERROR_PROP_INTERNAL_ERROR_APDU 0x89
100#define ERROR_PROP_INVALID_PARAMETERS_APDU 0x8A
101#define ERROR_PROP_INVALID_DATA_APDU 0x8B
102#define ERROR_PROP_DEVICE_NOT_SETUP 0x8C
103#define ERROR_PROP_MEDIA_MIXED 0x8D
104#define ERROR_PROP_RPID_MEDIA_DENIED 0x8E
void u2f_transport_sent(u2f_service_t *service, u2f_transport_media_t media)
bool u2f_is_channel_forbidden(uint8_t *channel)
void u2f_transport_init(u2f_service_t *service, uint8_t *message_buffer, uint16_t message_buffer_length)
bool u2f_is_channel_broadcast(uint8_t *channel)
void u2f_transport_received(u2f_service_t *service, uint8_t *buffer, uint16_t size, u2f_transport_media_t media)
void u2f_transport_ctap2_send_keepalive(u2f_service_t *service, uint8_t reason)