13#ifndef ZEPHYR_INCLUDE_AUTHENTICATION_FIDO2_FIDO2_TYPES_H_
14#define ZEPHYR_INCLUDE_AUTHENTICATION_FIDO2_FIDO2_TYPES_H_
32#define FIDO2_CREDENTIAL_ID_MAX_SIZE 128
35#define FIDO2_RP_ID_MAX_LEN 128
38#define FIDO2_RP_NAME_MAX_LEN 64
41#define FIDO2_USER_NAME_MAX_LEN 64
44#define FIDO2_USER_DISPLAY_NAME_MAX_LEN 64
47#define FIDO2_USER_ID_MAX_SIZE 64
50#define FIDO2_AAGUID_SIZE 16
53#define FIDO2_SHA256_SIZE 32
56#define FIDO2_PIN_HASH_SIZE 16
59#define FIDO2_DISCOVERABLE_CRED_ID_SIZE 32
62#define FIDO2_NON_DISCOVERABLE_CRED_ID_SIZE 64
65#define FIDO2_AUTH_DATA_HEADER_SIZE 37
68#define FIDO2_ATTESTED_CRED_DATA_MAX_SIZE \
69 (FIDO2_AAGUID_SIZE + 2 + FIDO2_CREDENTIAL_ID_MAX_SIZE + FIDO2_COSE_KEY_MAX_SIZE)
72#define FIDO2_AUTH_DATA_MAX_SIZE (FIDO2_AUTH_DATA_HEADER_SIZE + FIDO2_ATTESTED_CRED_DATA_MAX_SIZE)
75#define FIDO2_MAX_EXTENSIONS 8
78#define FIDO2_MAX_VERSIONS 4
81#define FIDO2_P256_UNCOMPRESSED_KEY_SIZE 65
84#define FIDO2_P256_COORD_SIZE 32
87#define FIDO2_EC_POINT_UNCOMPRESSED 0x04
90#define FIDO2_ECDSA_SIG_MAX_SIZE 72
93#define FIDO2_EXT_HMAC_SECRET BIT(0)
95#define FIDO2_EXT_LARGE_BLOB_KEY BIT(1)
97#define FIDO2_EXT_CRED_BLOB BIT(2)
99#define FIDO2_EXT_THIRD_PARTY_PAY BIT(3)
102#define FIDO2_TRANSPORT_USB BIT(0)
104#define FIDO2_TRANSPORT_BLE BIT(1)
106#define FIDO2_TRANSPORT_NFC BIT(2)
109#define AUTH_DATA_FLAG_UP BIT(0)
111#define AUTH_DATA_FLAG_UV BIT(2)
113#define AUTH_DATA_FLAG_AT BIT(6)
115#define AUTH_DATA_FLAG_ED BIT(7)
@ FIDO2_ERR_OPERATION_PENDING
Operation pending.
Definition fido2_types.h:139
@ FIDO2_ERR_INVALID_OPTION
Option value invalid for this operation.
Definition fido2_types.h:145
@ FIDO2_ERR_PIN_BLOCKED
PIN blocked.
Definition fido2_types.h:151
@ FIDO2_ERR_REQUEST_TOO_LARGE
Request exceeds maxMsgSize.
Definition fido2_types.h:158
@ FIDO2_ERR_PROCESSING
Processing.
Definition fido2_types.h:136
@ FIDO2_ERR_CBOR_UNEXPECTED_TYPE
Unexpected CBOR type.
Definition fido2_types.h:128
@ FIDO2_ERR_INVALID_CHANNEL
Invalid channel.
Definition fido2_types.h:127
@ FIDO2_ERR_KEEPALIVE_CANCEL
Keepalive cancelled by platform.
Definition fido2_types.h:146
@ FIDO2_ERR_UNSUPPORTED_ALGORITHM
Unsupported algorithm.
Definition fido2_types.h:141
@ FIDO2_ERR_ACTION_TIMEOUT
Platform response timed out.
Definition fido2_types.h:159
@ FIDO2_ERR_NO_OPERATIONS
No operations pending.
Definition fido2_types.h:140
@ FIDO2_ERR_USER_ACTION_TIMEOUT
User action timed out.
Definition fido2_types.h:148
@ FIDO2_ERR_INTEGRITY_FAILURE
Authenticator integrity check failed.
Definition fido2_types.h:162
@ FIDO2_ERR_INVALID_CREDENTIAL
Invalid credential.
Definition fido2_types.h:137
@ FIDO2_ERR_OPERATION_DENIED
Operation denied.
Definition fido2_types.h:142
@ FIDO2_ERR_INVALID_SUBCOMMAND
Invalid subcommand for this command.
Definition fido2_types.h:163
@ FIDO2_ERR_PIN_AUTH_BLOCKED
PIN auth blocked.
Definition fido2_types.h:153
@ FIDO2_ERR_PUAT_REQUIRED
PIN/UV auth token required.
Definition fido2_types.h:155
@ FIDO2_ERR_CREDENTIAL_EXCLUDED
Credential in excludeList found.
Definition fido2_types.h:135
@ FIDO2_ERR_UV_INVALID
User verification failed.
Definition fido2_types.h:164
@ FIDO2_ERR_PIN_AUTH_INVALID
PIN auth verification failed.
Definition fido2_types.h:152
@ FIDO2_ERR_UNAUTHORIZED_PERMISSION
PIN/UV token missing permission.
Definition fido2_types.h:165
@ FIDO2_ERR_PIN_INVALID
Invalid PIN.
Definition fido2_types.h:150
@ FIDO2_ERR_NOT_ALLOWED
Operation not allowed.
Definition fido2_types.h:149
@ FIDO2_ERR_INVALID_SEQ
Invalid sequence number.
Definition fido2_types.h:123
@ FIDO2_ERR_PIN_POLICY_VIOLATION
PIN policy violation.
Definition fido2_types.h:156
@ FIDO2_ERR_USER_ACTION_PENDING
Waiting for user action.
Definition fido2_types.h:138
@ FIDO2_ERR_RESERVED
PIN/UV auth token expired.
Definition fido2_types.h:157
@ FIDO2_OK
Success.
Definition fido2_types.h:119
@ FIDO2_ERR_UP_REQUIRED
User presence required.
Definition fido2_types.h:160
@ FIDO2_ERR_UNSUPPORTED_OPTION
Unsupported option.
Definition fido2_types.h:144
@ FIDO2_ERR_INVALID_COMMAND
Invalid command.
Definition fido2_types.h:120
@ FIDO2_ERR_INVALID_PARAMETER
Invalid parameter.
Definition fido2_types.h:121
@ FIDO2_ERR_OTHER
Other unspecified error.
Definition fido2_types.h:166
@ FIDO2_ERR_PIN_NOT_SET
PIN not set.
Definition fido2_types.h:154
@ FIDO2_ERR_UNSUPPORTED_EXTENSION
Unsupported extension.
Definition fido2_types.h:132
@ FIDO2_ERR_CHANNEL_BUSY
Channel busy.
Definition fido2_types.h:125
@ FIDO2_ERR_INVALID_CBOR
Invalid CBOR encoding.
Definition fido2_types.h:129
@ FIDO2_ERR_KEY_STORE_FULL
Key store full.
Definition fido2_types.h:143
@ FIDO2_ERR_INVALID_LENGTH
Invalid message length.
Definition fido2_types.h:122
@ FIDO2_ERR_FP_DATABASE_FULL
Fingerprint database full.
Definition fido2_types.h:133
@ FIDO2_ERR_LOCK_REQUIRED
Command requires lock.
Definition fido2_types.h:126
@ FIDO2_ERR_MISSING_PARAMETER
Required parameter missing.
Definition fido2_types.h:130
@ FIDO2_ERR_UV_BLOCKED
User verification blocked.
Definition fido2_types.h:161
@ FIDO2_ERR_LIMIT_EXCEEDED
Limit exceeded.
Definition fido2_types.h:131
@ FIDO2_ERR_TIMEOUT
Request timed out.
Definition fido2_types.h:124
@ FIDO2_ERR_NO_CREDENTIALS
No credentials found.
Definition fido2_types.h:147
@ FIDO2_ERR_LARGE_BLOB_STORAGE_FULL
Large blob storage full.
Definition fido2_types.h:134
@ FIDO2_COSE_EDDSA
EdDSA.
Definition fido2_types.h:194
@ FIDO2_COSE_ECDHES_HKDF256
ECDH ES w/ HKDF.
Definition fido2_types.h:195
@ FIDO2_COSE_ES256
ECDSA w/ SHA-256.
Definition fido2_types.h:193
@ FIDO2_COSE_RS256
RSASSA-PKCS1-v1_5 w/ SHA-256.
Definition fido2_types.h:196
@ FIDO2_CRED_PROTECT_UV_OPTIONAL
UV optional; credential usable without verification.
Definition fido2_types.h:184
@ FIDO2_CRED_PROTECT_UV_OPTIONAL_WITH_LIST
UV optional; credential usable only with credential ID list.
Definition fido2_types.h:186
@ FIDO2_CRED_PROTECT_UV_REQUIRED
UV required; credential always requires user verification.
Definition fido2_types.h:188
@ FIDO2_CMD_GET_INFO
Get authenticator info.
Definition fido2_types.h:173
@ FIDO2_CMD_SELECTION
Authenticator selection.
Definition fido2_types.h:178
@ FIDO2_CMD_CREDENTIAL_MGMT
Credential management.
Definition fido2_types.h:177
@ FIDO2_CMD_GET_ASSERTION
Authenticate with a credential.
Definition fido2_types.h:172
@ FIDO2_CMD_CLIENT_PIN
Client PIN operations.
Definition fido2_types.h:174
@ FIDO2_CMD_RESET
Factory reset.
Definition fido2_types.h:175
@ FIDO2_CMD_MAKE_CREDENTIAL
Create a new credential.
Definition fido2_types.h:171
@ FIDO2_CMD_GET_NEXT_ASSERTION
Get next assertion.
Definition fido2_types.h:176
#define FIDO2_MAX_VERSIONS
Maximum number of supported versions.
Definition fido2_types.h:78
#define FIDO2_RP_ID_MAX_LEN
Maximum relying party ID length.
Definition fido2_types.h:35
#define FIDO2_USER_NAME_MAX_LEN
Maximum user name length.
Definition fido2_types.h:41
#define FIDO2_AAGUID_SIZE
AAGUID size in bytes.
Definition fido2_types.h:50
fido2_status
CTAP2 status codes.
Definition fido2_types.h:118
#define FIDO2_MAX_EXTENSIONS
Maximum number of supported extensions.
Definition fido2_types.h:75
#define FIDO2_CREDENTIAL_ID_MAX_SIZE
FIDO2 shared types.
Definition fido2_types.h:32
fido2_cose_alg
COSE algorithm identifiers.
Definition fido2_types.h:192
#define FIDO2_RP_NAME_MAX_LEN
Maximum relying party name length.
Definition fido2_types.h:38
#define FIDO2_USER_DISPLAY_NAME_MAX_LEN
Maximum user display name length.
Definition fido2_types.h:44
fido2_cred_protect
Credential protection levels.
Definition fido2_types.h:182
#define FIDO2_SHA256_SIZE
SHA-256 hash size.
Definition fido2_types.h:53
fido2_cmd
CTAP2 command codes.
Definition fido2_types.h:170
#define FIDO2_USER_ID_MAX_SIZE
Maximum user ID size in bytes.
Definition fido2_types.h:47
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
A stored FIDO2 credential.
Definition fido2_types.h:200
uint8_t user_id[64]
User handle.
Definition fido2_types.h:216
char rp_name[64]
Relying party display name.
Definition fido2_types.h:210
uint32_t sign_count
Signature counter.
Definition fido2_types.h:222
char user_display_name[64]
User display name.
Definition fido2_types.h:214
uint8_t cred_protect
Credential protection level.
Definition fido2_types.h:230
uint8_t rp_id_hash[32]
SHA-256 hash of the relying party ID.
Definition fido2_types.h:206
int32_t algorithm
COSE algorithm identifier.
Definition fido2_types.h:226
bool discoverable
Discoverable (resident) credential.
Definition fido2_types.h:228
uint32_t extensions
Credential extensions bitmask (e.g.
Definition fido2_types.h:224
uint32_t key_id
PSA Crypto key identifier for this credential.
Definition fido2_types.h:220
uint16_t id_len
Credential identifier length.
Definition fido2_types.h:204
char user_name[64]
User account name.
Definition fido2_types.h:212
uint16_t user_id_len
User handle length.
Definition fido2_types.h:218
char rp_id[128]
Relying party identifier.
Definition fido2_types.h:208
Device information returned by authenticatorGetInfo.
Definition fido2_types.h:236
uint8_t num_extensions
Number of supported extensions.
Definition fido2_types.h:244
bool client_pin
Client PIN supported.
Definition fido2_types.h:259
uint8_t min_pin_length
Current minimum PIN length.
Definition fido2_types.h:277
bool uv
Built-in user verification support.
Definition fido2_types.h:261
bool up
User presence support.
Definition fido2_types.h:260
uint8_t transports
Supported transports bitmask.
Definition fido2_types.h:254
const char * versions[4]
Supported protocol versions.
Definition fido2_types.h:238
const char * extensions[8]
Supported extensions.
Definition fido2_types.h:242
bool plat
Platform device.
Definition fido2_types.h:257
uint16_t max_credential_id_length
Maximum credential ID length.
Definition fido2_types.h:250
uint8_t pin_uv_auth_protocols[2]
Supported PIN/UV auth protocol versions.
Definition fido2_types.h:271
uint16_t max_credential_count
Maximum credential count.
Definition fido2_types.h:248
uint8_t pin_retries
Remaining PIN retry attempts.
Definition fido2_types.h:275
uint8_t num_pin_uv_auth_protocols
Number of supported PIN/UV auth protocols.
Definition fido2_types.h:273
bool always_uv
Authenticator always requires UV.
Definition fido2_types.h:265
bool pin_uv_auth_token
pinUvAuthToken support
Definition fido2_types.h:263
uint32_t firmware_version
Firmware version.
Definition fido2_types.h:269
uint8_t aaguid[16]
Authenticator Attestation GUID.
Definition fido2_types.h:246
bool make_cred_uv_not_rqd
makeCredUvNotRqd support
Definition fido2_types.h:264
bool no_mc_ga_permissions_with_client_pin
Only if clientPin present.
Definition fido2_types.h:266
bool rk
Resident key support.
Definition fido2_types.h:258
bool cred_mgmt
Credential management support.
Definition fido2_types.h:262
uint16_t max_msg_size
Maximum CBOR message size in bytes.
Definition fido2_types.h:252
uint8_t num_versions
Number of supported versions.
Definition fido2_types.h:240
struct fido2_device_info::@263367117337362161200252061145100352376301326151 options
CTAP 2.1 Options Map.