xref: /freebsd/contrib/libfido2/man/fido_dev_largeblob_get.3 (revision 0afa8e065e14bb8fd338d75690e0238c00167d40)
1*0afa8e06SEd Maste.\" Copyright (c) 2020 Yubico AB. All rights reserved.
2*0afa8e06SEd Maste.\" Use of this source code is governed by a BSD-style
3*0afa8e06SEd Maste.\" license that can be found in the LICENSE file.
4*0afa8e06SEd Maste.\"
5*0afa8e06SEd Maste.Dd $Mdocdate: October 26 2020 $
6*0afa8e06SEd Maste.Dt FIDO_LARGEBLOB_GET 3
7*0afa8e06SEd Maste.Os
8*0afa8e06SEd Maste.Sh NAME
9*0afa8e06SEd Maste.Nm fido_dev_largeblob_get ,
10*0afa8e06SEd Maste.Nm fido_dev_largeblob_set ,
11*0afa8e06SEd Maste.Nm fido_dev_largeblob_remove ,
12*0afa8e06SEd Maste.Nm fido_dev_largeblob_get_array ,
13*0afa8e06SEd Maste.Nm fido_dev_largeblob_set_array
14*0afa8e06SEd Maste.Nd FIDO 2 large blob API
15*0afa8e06SEd Maste.Sh SYNOPSIS
16*0afa8e06SEd Maste.In fido.h
17*0afa8e06SEd Maste.Ft int
18*0afa8e06SEd Maste.Fn fido_dev_largeblob_get "fido_dev_t *dev" "const unsigned char *key_ptr" "size_t key_len" "unsigned char **blob_ptr" "size_t *blob_len"
19*0afa8e06SEd Maste.Ft int
20*0afa8e06SEd Maste.Fn fido_dev_largeblob_set "fido_dev_t *dev" "const unsigned char *key_ptr" "size_t key_len" "const unsigned char *blob_ptr" "size_t blob_len" "const char *pin"
21*0afa8e06SEd Maste.Ft int
22*0afa8e06SEd Maste.Fn fido_dev_largeblob_remove "fido_dev_t *dev" "const unsigned char *key_ptr" "size_t key_len" "const char *pin"
23*0afa8e06SEd Maste.Ft int
24*0afa8e06SEd Maste.Fn fido_dev_largeblob_get_array "fido_dev_t *dev" "unsigned char **cbor_ptr" "size_t *cbor_len"
25*0afa8e06SEd Maste.Ft int
26*0afa8e06SEd Maste.Fn fido_dev_largeblob_set_array "fido_dev_t *dev" "const unsigned char *cbor_ptr" "size_t cbor_len" "const char *pin"
27*0afa8e06SEd Maste.Sh DESCRIPTION
28*0afa8e06SEd MasteThe
29*0afa8e06SEd Maste.Dq largeBlobs
30*0afa8e06SEd MasteAPI of
31*0afa8e06SEd Maste.Em libfido2
32*0afa8e06SEd Masteallows binary blobs residing on a FIDO 2.1 authenticator to be
33*0afa8e06SEd Masteread, written, and inspected.
34*0afa8e06SEd Maste.Dq largeBlobs
35*0afa8e06SEd Masteis a FIDO 2.1 extension.
36*0afa8e06SEd Maste.Pp
37*0afa8e06SEd Maste.Dq largeBlobs
38*0afa8e06SEd Masteare stored as elements of a CBOR array.
39*0afa8e06SEd MasteConfidentiality is ensured by encrypting each element with a
40*0afa8e06SEd Mastedistinct, credential-bound 256-bit AES-GCM key.
41*0afa8e06SEd MasteThe array is otherwise shared between different credentials and
42*0afa8e06SEd MasteFIDO2 relying parties.
43*0afa8e06SEd Maste.Pp
44*0afa8e06SEd MasteRetrieval of a credential's encryption key is possible during
45*0afa8e06SEd Masteenrollment with
46*0afa8e06SEd Maste.Xr fido_cred_set_extensions 3
47*0afa8e06SEd Masteand
48*0afa8e06SEd Maste.Xr fido_cred_largeblob_key_ptr 3 ,
49*0afa8e06SEd Masteduring assertion with
50*0afa8e06SEd Maste.Xr fido_assert_set_extensions 3
51*0afa8e06SEd Masteand
52*0afa8e06SEd Maste.Xr fido_assert_largeblob_key_ptr 3 ,
53*0afa8e06SEd Masteor, in the case of a resident credential, via
54*0afa8e06SEd Maste.Em libfido2's
55*0afa8e06SEd Mastecredential management API.
56*0afa8e06SEd Maste.Pp
57*0afa8e06SEd MasteThe
58*0afa8e06SEd Maste.Dq largeBlobs
59*0afa8e06SEd MasteCBOR array is opaque to the authenticator.
60*0afa8e06SEd MasteManagement of the array is left at the discretion of FIDO2 clients.
61*0afa8e06SEd MasteFor further details on FIDO 2.1's
62*0afa8e06SEd Maste.Dq largeBlobs
63*0afa8e06SEd Masteextension, please refer to the FIDO 2.1 spec.
64*0afa8e06SEd Maste.Pp
65*0afa8e06SEd MasteThe
66*0afa8e06SEd Maste.Fn fido_dev_largeblob_get
67*0afa8e06SEd Mastefunction retrieves the authenticator's
68*0afa8e06SEd Maste.Dq largeBlobs
69*0afa8e06SEd MasteCBOR array and, on success, returns the first blob
70*0afa8e06SEd Maste.Pq iterating from array index zero
71*0afa8e06SEd Mastethat can be
72*0afa8e06SEd Mastedecrypted by
73*0afa8e06SEd Maste.Fa key_ptr ,
74*0afa8e06SEd Mastewhere
75*0afa8e06SEd Maste.Fa key_ptr
76*0afa8e06SEd Mastepoints to
77*0afa8e06SEd Maste.Fa key_len
78*0afa8e06SEd Mastebytes.
79*0afa8e06SEd MasteOn success,
80*0afa8e06SEd Maste.Fn fido_dev_largeblob_get
81*0afa8e06SEd Mastesets
82*0afa8e06SEd Maste.Fa blob_ptr
83*0afa8e06SEd Masteto the body of the decrypted blob, and
84*0afa8e06SEd Maste.Fa blob_len
85*0afa8e06SEd Masteto the length of the decrypted blob in bytes.
86*0afa8e06SEd MasteIt is the caller's responsibility to free
87*0afa8e06SEd Maste.Fa blob_ptr .
88*0afa8e06SEd Maste.Pp
89*0afa8e06SEd MasteThe
90*0afa8e06SEd Maste.Fn fido_dev_largeblob_set
91*0afa8e06SEd Mastefunction uses
92*0afa8e06SEd Maste.Fa key_ptr
93*0afa8e06SEd Masteto encrypt
94*0afa8e06SEd Maste.Fa blob_ptr
95*0afa8e06SEd Masteand inserts the result in the authenticator's
96*0afa8e06SEd Maste.Dq largeBlobs
97*0afa8e06SEd MasteCBOR array.
98*0afa8e06SEd MasteInsertion happens at the end of the array if no existing element
99*0afa8e06SEd Mastecan be decrypted by
100*0afa8e06SEd Maste.Fa key_ptr ,
101*0afa8e06SEd Masteor at the position of the first element
102*0afa8e06SEd Maste.Pq iterating from array index zero
103*0afa8e06SEd Mastethat can be decrypted by
104*0afa8e06SEd Maste.Fa key_ptr .
105*0afa8e06SEd Maste.Fa key_len
106*0afa8e06SEd Masteholds the length of
107*0afa8e06SEd Maste.Fa key_ptr
108*0afa8e06SEd Mastein bytes, and
109*0afa8e06SEd Maste.Fa blob_len
110*0afa8e06SEd Mastethe length of
111*0afa8e06SEd Maste.Fa blob_ptr
112*0afa8e06SEd Mastein bytes.
113*0afa8e06SEd MasteA
114*0afa8e06SEd Maste.Fa pin
115*0afa8e06SEd Masteor equivalent user-verification gesture is required.
116*0afa8e06SEd Maste.Pp
117*0afa8e06SEd MasteThe
118*0afa8e06SEd Maste.Fn fido_dev_largeblob_remove
119*0afa8e06SEd Mastefunction retrieves the authenticator's
120*0afa8e06SEd Maste.Dq largeBlobs
121*0afa8e06SEd MasteCBOR array and, on success, drops the first blob
122*0afa8e06SEd Maste.Pq iterating from array index zero
123*0afa8e06SEd Mastethat can be decrypted by
124*0afa8e06SEd Maste.Fa key_ptr ,
125*0afa8e06SEd Mastewhere
126*0afa8e06SEd Maste.Fa key_ptr
127*0afa8e06SEd Mastepoints to
128*0afa8e06SEd Maste.Fa key_len
129*0afa8e06SEd Mastebytes.
130*0afa8e06SEd MasteA
131*0afa8e06SEd Maste.Fa pin
132*0afa8e06SEd Masteor equivalent user-verification gesture is required.
133*0afa8e06SEd Maste.Pp
134*0afa8e06SEd MasteThe
135*0afa8e06SEd Maste.Fn fido_dev_largeblob_get_array
136*0afa8e06SEd Mastefunction retrieves the authenticator's
137*0afa8e06SEd Maste.Dq largeBlobs
138*0afa8e06SEd MasteCBOR array and, on success,
139*0afa8e06SEd Mastesets
140*0afa8e06SEd Maste.Fa cbor_ptr
141*0afa8e06SEd Masteto the body of the CBOR array, and
142*0afa8e06SEd Maste.Fa cbor_len
143*0afa8e06SEd Masteto its corresponding length in bytes.
144*0afa8e06SEd MasteIt is the caller's responsibility to free
145*0afa8e06SEd Maste.Fa cbor_ptr .
146*0afa8e06SEd Maste.Pp
147*0afa8e06SEd MasteFinally, the
148*0afa8e06SEd Maste.Fn fido_dev_largeblob_set_array
149*0afa8e06SEd Mastefunction sets the authenticator's
150*0afa8e06SEd Maste.Dq largeBlobs
151*0afa8e06SEd MasteCBOR array to the data pointed to by
152*0afa8e06SEd Maste.Fa cbor_ptr ,
153*0afa8e06SEd Mastewhere
154*0afa8e06SEd Maste.Fa cbor_ptr
155*0afa8e06SEd Mastepoints to
156*0afa8e06SEd Maste.Fa cbor_len
157*0afa8e06SEd Mastebytes.
158*0afa8e06SEd MasteA
159*0afa8e06SEd Maste.Fa pin
160*0afa8e06SEd Masteor equivalent user-verification gesture is required.
161*0afa8e06SEd Maste.Sh RETURN VALUES
162*0afa8e06SEd MasteThe functions
163*0afa8e06SEd Maste.Fn fido_dev_largeblob_set ,
164*0afa8e06SEd Maste.Fn fido_dev_largeblob_get ,
165*0afa8e06SEd Maste.Fn fido_dev_largeblob_remove ,
166*0afa8e06SEd Maste.Fn fido_dev_largeblob_get_array ,
167*0afa8e06SEd Masteand
168*0afa8e06SEd Maste.Fn fido_dev_largeblob_set_array
169*0afa8e06SEd Mastereturn
170*0afa8e06SEd Maste.Dv FIDO_OK
171*0afa8e06SEd Masteon success.
172*0afa8e06SEd MasteOn error, an error code defined in
173*0afa8e06SEd Maste.In fido/err.h
174*0afa8e06SEd Masteis returned.
175*0afa8e06SEd Maste.Sh SEE ALSO
176*0afa8e06SEd Maste.Xr fido_assert_largeblob_key_len 3 ,
177*0afa8e06SEd Maste.Xr fido_assert_largeblob_key_ptr 3 ,
178*0afa8e06SEd Maste.Xr fido_assert_set_extensions 3 ,
179*0afa8e06SEd Maste.Xr fido_cred_largeblob_key_len 3 ,
180*0afa8e06SEd Maste.Xr fido_cred_largeblob_key_ptr 3 ,
181*0afa8e06SEd Maste.Xr fido_cred_set_extensions 3 ,
182*0afa8e06SEd Maste.Xr fido_credman_dev_get_rk 3 ,
183*0afa8e06SEd Maste.Xr fido_credman_dev_get_rp 3 ,
184*0afa8e06SEd Maste.Xr fido_dev_get_assert 3 ,
185*0afa8e06SEd Maste.Xr fido_dev_make_cred 3
186*0afa8e06SEd Maste.Sh CAVEATS
187*0afa8e06SEd MasteThe
188*0afa8e06SEd Maste.Dq largeBlobs
189*0afa8e06SEd Masteextension is not meant to be used to store sensitive data.
190*0afa8e06SEd MasteWhen retrieved, a credential's
191*0afa8e06SEd Maste.Dq largeBlobs
192*0afa8e06SEd Masteencryption key is transmitted in the clear, and an authenticator's
193*0afa8e06SEd Maste.Dq largeBlobs
194*0afa8e06SEd MasteCBOR array can be read without user interaction or verification.
195