From 173bfbf7886608a4a7abbfac6a42ac4bf4a3432d Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 20 Sep 2020 16:14:20 +0100 Subject: New upstream version 1.5.0 --- src/fido/err.h | 2 ++ src/fido/param.h | 12 +++++++++--- src/fido/types.h | 20 +++++++++++++------- 3 files changed, 24 insertions(+), 10 deletions(-) (limited to 'src/fido') 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 @@ #define FIDO_ERR_MISSING_PARAMETER 0x14 #define FIDO_ERR_LIMIT_EXCEEDED 0x15 #define FIDO_ERR_UNSUPPORTED_EXTENSION 0x16 +#define FIDO_ERR_FP_DATABASE_FULL 0x17 #define FIDO_ERR_CREDENTIAL_EXCLUDED 0x19 #define FIDO_ERR_PROCESSING 0x21 #define FIDO_ERR_INVALID_CREDENTIAL 0x22 @@ -49,6 +50,7 @@ #define FIDO_ERR_REQUEST_TOO_LARGE 0x39 #define FIDO_ERR_ACTION_TIMEOUT 0x3a #define FIDO_ERR_UP_REQUIRED 0x3b +#define FIDO_ERR_UV_BLOCKED 0x3c #define FIDO_ERR_ERR_OTHER 0x7f #define FIDO_ERR_SPEC_LAST 0xdf 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 @@ /* HID Broadcast channel ID. */ #define CTAP_CID_BROADCAST 0xffffffff -/* Expected size of a HID report in bytes. */ -#define CTAP_RPT_SIZE 64 +#define CTAP_INIT_HEADER_LEN 7 +#define CTAP_CONT_HEADER_LEN 5 + +/* Maximum length of a CTAP HID report in bytes. */ +#define CTAP_MAX_REPORT_LEN 64 + +/* Minimum length of a CTAP HID report in bytes. */ +#define CTAP_MIN_REPORT_LEN (CTAP_INIT_HEADER_LEN + 1) /* Randomness device on UNIX-like platforms. */ #ifndef FIDO_RANDOM_DEV @@ -60,7 +66,7 @@ /* Maximum message size in bytes. */ #ifndef FIDO_MAXMSG -#define FIDO_MAXMSG 1200 +#define FIDO_MAXMSG 2048 #endif /* 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 { } fido_byte_array_t; typedef struct fido_cbor_info { - fido_str_array_t versions; /* supported versions: fido2|u2f */ - fido_str_array_t extensions; /* list of supported extensions */ - unsigned char aaguid[16]; /* aaguid */ - fido_opt_array_t options; /* list of supported options */ - uint64_t maxmsgsiz; /* maximum message size */ - fido_byte_array_t protocols; /* supported pin protocols */ - uint64_t fwversion; /* firmware version */ + fido_str_array_t versions; /* supported versions: fido2|u2f */ + fido_str_array_t extensions; /* list of supported extensions */ + unsigned char aaguid[16]; /* aaguid */ + fido_opt_array_t options; /* list of supported options */ + uint64_t maxmsgsiz; /* maximum message size */ + fido_byte_array_t protocols; /* supported pin protocols */ + uint64_t maxcredcntlst; /* max number of credentials in list */ + uint64_t maxcredidlen; /* max credential ID length */ + uint64_t fwversion; /* firmware version */ } fido_cbor_info_t; typedef struct fido_dev_info { @@ -213,6 +215,10 @@ typedef struct fido_dev { char *path; /* device path */ void *io_handle; /* abstract i/o handle */ fido_dev_io_t io; /* i/o functions */ + bool io_own; /* device has own io/transport */ + size_t rx_len; /* length of HID input reports */ + size_t tx_len; /* length of HID output reports */ + int flags; /* internal flags; see FIDO_DEV_* */ fido_dev_transport_t transport; /* transport functions */ } fido_dev_t; -- cgit v1.2.3