diff options
Diffstat (limited to 'src/fido')
-rw-r--r-- | src/fido/err.h | 2 | ||||
-rw-r--r-- | src/fido/param.h | 12 | ||||
-rw-r--r-- | src/fido/types.h | 20 |
3 files changed, 24 insertions, 10 deletions
diff --git a/src/fido/err.h b/src/fido/err.h index d7453fc..253914f 100644 --- a/src/fido/err.h +++ b/src/fido/err.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define FIDO_ERR_MISSING_PARAMETER 0x14 | 21 | #define FIDO_ERR_MISSING_PARAMETER 0x14 |
22 | #define FIDO_ERR_LIMIT_EXCEEDED 0x15 | 22 | #define FIDO_ERR_LIMIT_EXCEEDED 0x15 |
23 | #define FIDO_ERR_UNSUPPORTED_EXTENSION 0x16 | 23 | #define FIDO_ERR_UNSUPPORTED_EXTENSION 0x16 |
24 | #define FIDO_ERR_FP_DATABASE_FULL 0x17 | ||
24 | #define FIDO_ERR_CREDENTIAL_EXCLUDED 0x19 | 25 | #define FIDO_ERR_CREDENTIAL_EXCLUDED 0x19 |
25 | #define FIDO_ERR_PROCESSING 0x21 | 26 | #define FIDO_ERR_PROCESSING 0x21 |
26 | #define FIDO_ERR_INVALID_CREDENTIAL 0x22 | 27 | #define FIDO_ERR_INVALID_CREDENTIAL 0x22 |
@@ -49,6 +50,7 @@ | |||
49 | #define FIDO_ERR_REQUEST_TOO_LARGE 0x39 | 50 | #define FIDO_ERR_REQUEST_TOO_LARGE 0x39 |
50 | #define FIDO_ERR_ACTION_TIMEOUT 0x3a | 51 | #define FIDO_ERR_ACTION_TIMEOUT 0x3a |
51 | #define FIDO_ERR_UP_REQUIRED 0x3b | 52 | #define FIDO_ERR_UP_REQUIRED 0x3b |
53 | #define FIDO_ERR_UV_BLOCKED 0x3c | ||
52 | #define FIDO_ERR_ERR_OTHER 0x7f | 54 | #define FIDO_ERR_ERR_OTHER 0x7f |
53 | #define FIDO_ERR_SPEC_LAST 0xdf | 55 | #define FIDO_ERR_SPEC_LAST 0xdf |
54 | 56 | ||
diff --git a/src/fido/param.h b/src/fido/param.h index 7d3c0cc..14ee74e 100644 --- a/src/fido/param.h +++ b/src/fido/param.h | |||
@@ -50,8 +50,14 @@ | |||
50 | /* HID Broadcast channel ID. */ | 50 | /* HID Broadcast channel ID. */ |
51 | #define CTAP_CID_BROADCAST 0xffffffff | 51 | #define CTAP_CID_BROADCAST 0xffffffff |
52 | 52 | ||
53 | /* Expected size of a HID report in bytes. */ | 53 | #define CTAP_INIT_HEADER_LEN 7 |
54 | #define CTAP_RPT_SIZE 64 | 54 | #define CTAP_CONT_HEADER_LEN 5 |
55 | |||
56 | /* Maximum length of a CTAP HID report in bytes. */ | ||
57 | #define CTAP_MAX_REPORT_LEN 64 | ||
58 | |||
59 | /* Minimum length of a CTAP HID report in bytes. */ | ||
60 | #define CTAP_MIN_REPORT_LEN (CTAP_INIT_HEADER_LEN + 1) | ||
55 | 61 | ||
56 | /* Randomness device on UNIX-like platforms. */ | 62 | /* Randomness device on UNIX-like platforms. */ |
57 | #ifndef FIDO_RANDOM_DEV | 63 | #ifndef FIDO_RANDOM_DEV |
@@ -60,7 +66,7 @@ | |||
60 | 66 | ||
61 | /* Maximum message size in bytes. */ | 67 | /* Maximum message size in bytes. */ |
62 | #ifndef FIDO_MAXMSG | 68 | #ifndef FIDO_MAXMSG |
63 | #define FIDO_MAXMSG 1200 | 69 | #define FIDO_MAXMSG 2048 |
64 | #endif | 70 | #endif |
65 | 71 | ||
66 | /* CTAP capability bits. */ | 72 | /* CTAP capability bits. */ |
diff --git a/src/fido/types.h b/src/fido/types.h index 5df5e36..cce1a44 100644 --- a/src/fido/types.h +++ b/src/fido/types.h | |||
@@ -175,13 +175,15 @@ typedef struct fido_byte_array { | |||
175 | } fido_byte_array_t; | 175 | } fido_byte_array_t; |
176 | 176 | ||
177 | typedef struct fido_cbor_info { | 177 | typedef struct fido_cbor_info { |
178 | fido_str_array_t versions; /* supported versions: fido2|u2f */ | 178 | fido_str_array_t versions; /* supported versions: fido2|u2f */ |
179 | fido_str_array_t extensions; /* list of supported extensions */ | 179 | fido_str_array_t extensions; /* list of supported extensions */ |
180 | unsigned char aaguid[16]; /* aaguid */ | 180 | unsigned char aaguid[16]; /* aaguid */ |
181 | fido_opt_array_t options; /* list of supported options */ | 181 | fido_opt_array_t options; /* list of supported options */ |
182 | uint64_t maxmsgsiz; /* maximum message size */ | 182 | uint64_t maxmsgsiz; /* maximum message size */ |
183 | fido_byte_array_t protocols; /* supported pin protocols */ | 183 | fido_byte_array_t protocols; /* supported pin protocols */ |
184 | uint64_t fwversion; /* firmware version */ | 184 | uint64_t maxcredcntlst; /* max number of credentials in list */ |
185 | uint64_t maxcredidlen; /* max credential ID length */ | ||
186 | uint64_t fwversion; /* firmware version */ | ||
185 | } fido_cbor_info_t; | 187 | } fido_cbor_info_t; |
186 | 188 | ||
187 | typedef struct fido_dev_info { | 189 | typedef struct fido_dev_info { |
@@ -213,6 +215,10 @@ typedef struct fido_dev { | |||
213 | char *path; /* device path */ | 215 | char *path; /* device path */ |
214 | void *io_handle; /* abstract i/o handle */ | 216 | void *io_handle; /* abstract i/o handle */ |
215 | fido_dev_io_t io; /* i/o functions */ | 217 | fido_dev_io_t io; /* i/o functions */ |
218 | bool io_own; /* device has own io/transport */ | ||
219 | size_t rx_len; /* length of HID input reports */ | ||
220 | size_t tx_len; /* length of HID output reports */ | ||
221 | int flags; /* internal flags; see FIDO_DEV_* */ | ||
216 | fido_dev_transport_t transport; /* transport functions */ | 222 | fido_dev_transport_t transport; /* transport functions */ |
217 | } fido_dev_t; | 223 | } fido_dev_t; |
218 | 224 | ||