xref: /freebsd/contrib/libfido2/man/fido_dev_largeblob_get.3 (revision 3e696dfb7009cd8ffa12e36f48f4339bb7a2048d)
10afa8e06SEd Maste.\" Copyright (c) 2020 Yubico AB. All rights reserved.
20afa8e06SEd Maste.\" Use of this source code is governed by a BSD-style
30afa8e06SEd Maste.\" license that can be found in the LICENSE file.
40afa8e06SEd Maste.\"
50afa8e06SEd Maste.Dd $Mdocdate: October 26 2020 $
60afa8e06SEd Maste.Dt FIDO_LARGEBLOB_GET 3
70afa8e06SEd Maste.Os
80afa8e06SEd Maste.Sh NAME
90afa8e06SEd Maste.Nm fido_dev_largeblob_get ,
100afa8e06SEd Maste.Nm fido_dev_largeblob_set ,
110afa8e06SEd Maste.Nm fido_dev_largeblob_remove ,
120afa8e06SEd Maste.Nm fido_dev_largeblob_get_array ,
130afa8e06SEd Maste.Nm fido_dev_largeblob_set_array
140afa8e06SEd Maste.Nd FIDO2 large blob API
150afa8e06SEd Maste.Sh SYNOPSIS
160afa8e06SEd Maste.In fido.h
170afa8e06SEd Maste.Ft int
180afa8e06SEd 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"
190afa8e06SEd Maste.Ft int
200afa8e06SEd 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"
210afa8e06SEd Maste.Ft int
220afa8e06SEd Maste.Fn fido_dev_largeblob_remove "fido_dev_t *dev" "const unsigned char *key_ptr" "size_t key_len" "const char *pin"
230afa8e06SEd Maste.Ft int
240afa8e06SEd Maste.Fn fido_dev_largeblob_get_array "fido_dev_t *dev" "unsigned char **cbor_ptr" "size_t *cbor_len"
250afa8e06SEd Maste.Ft int
260afa8e06SEd Maste.Fn fido_dev_largeblob_set_array "fido_dev_t *dev" "const unsigned char *cbor_ptr" "size_t cbor_len" "const char *pin"
270afa8e06SEd Maste.Sh DESCRIPTION
280afa8e06SEd MasteThe
290afa8e06SEd Maste.Dq largeBlobs
300afa8e06SEd MasteAPI of
310afa8e06SEd Maste.Em libfido2
32*3e696dfbSEd Masteallows binary blobs residing on a CTAP 2.1 authenticator to be
330afa8e06SEd Masteread, written, and inspected.
340afa8e06SEd Maste.Dq largeBlobs
35*3e696dfbSEd Masteis a CTAP 2.1 extension.
360afa8e06SEd Maste.Pp
370afa8e06SEd Maste.Dq largeBlobs
380afa8e06SEd Masteare stored as elements of a CBOR array.
390afa8e06SEd MasteConfidentiality is ensured by encrypting each element with a
400afa8e06SEd Mastedistinct, credential-bound 256-bit AES-GCM key.
410afa8e06SEd MasteThe array is otherwise shared between different credentials and
420afa8e06SEd MasteFIDO2 relying parties.
430afa8e06SEd Maste.Pp
440afa8e06SEd MasteRetrieval of a credential's encryption key is possible during
450afa8e06SEd Masteenrollment with
460afa8e06SEd Maste.Xr fido_cred_set_extensions 3
470afa8e06SEd Masteand
480afa8e06SEd Maste.Xr fido_cred_largeblob_key_ptr 3 ,
490afa8e06SEd Masteduring assertion with
500afa8e06SEd Maste.Xr fido_assert_set_extensions 3
510afa8e06SEd Masteand
520afa8e06SEd Maste.Xr fido_assert_largeblob_key_ptr 3 ,
530afa8e06SEd Masteor, in the case of a resident credential, via
540afa8e06SEd Maste.Em libfido2's
550afa8e06SEd Mastecredential management API.
560afa8e06SEd Maste.Pp
570afa8e06SEd MasteThe
580afa8e06SEd Maste.Dq largeBlobs
590afa8e06SEd MasteCBOR array is opaque to the authenticator.
600afa8e06SEd MasteManagement of the array is left at the discretion of FIDO2 clients.
61*3e696dfbSEd MasteFor further details on CTAP 2.1's
620afa8e06SEd Maste.Dq largeBlobs
63*3e696dfbSEd Masteextension, please refer to the CTAP 2.1 spec.
640afa8e06SEd Maste.Pp
650afa8e06SEd MasteThe
660afa8e06SEd Maste.Fn fido_dev_largeblob_get
670afa8e06SEd Mastefunction retrieves the authenticator's
680afa8e06SEd Maste.Dq largeBlobs
690afa8e06SEd MasteCBOR array and, on success, returns the first blob
700afa8e06SEd Maste.Pq iterating from array index zero
710afa8e06SEd Mastethat can be
720afa8e06SEd Mastedecrypted by
730afa8e06SEd Maste.Fa key_ptr ,
740afa8e06SEd Mastewhere
750afa8e06SEd Maste.Fa key_ptr
760afa8e06SEd Mastepoints to
770afa8e06SEd Maste.Fa key_len
780afa8e06SEd Mastebytes.
790afa8e06SEd MasteOn success,
800afa8e06SEd Maste.Fn fido_dev_largeblob_get
810afa8e06SEd Mastesets
820afa8e06SEd Maste.Fa blob_ptr
830afa8e06SEd Masteto the body of the decrypted blob, and
840afa8e06SEd Maste.Fa blob_len
850afa8e06SEd Masteto the length of the decrypted blob in bytes.
860afa8e06SEd MasteIt is the caller's responsibility to free
870afa8e06SEd Maste.Fa blob_ptr .
880afa8e06SEd Maste.Pp
890afa8e06SEd MasteThe
900afa8e06SEd Maste.Fn fido_dev_largeblob_set
910afa8e06SEd Mastefunction uses
920afa8e06SEd Maste.Fa key_ptr
930afa8e06SEd Masteto encrypt
940afa8e06SEd Maste.Fa blob_ptr
950afa8e06SEd Masteand inserts the result in the authenticator's
960afa8e06SEd Maste.Dq largeBlobs
970afa8e06SEd MasteCBOR array.
980afa8e06SEd MasteInsertion happens at the end of the array if no existing element
990afa8e06SEd Mastecan be decrypted by
1000afa8e06SEd Maste.Fa key_ptr ,
1010afa8e06SEd Masteor at the position of the first element
1020afa8e06SEd Maste.Pq iterating from array index zero
1030afa8e06SEd Mastethat can be decrypted by
1040afa8e06SEd Maste.Fa key_ptr .
1050afa8e06SEd Maste.Fa key_len
1060afa8e06SEd Masteholds the length of
1070afa8e06SEd Maste.Fa key_ptr
1080afa8e06SEd Mastein bytes, and
1090afa8e06SEd Maste.Fa blob_len
1100afa8e06SEd Mastethe length of
1110afa8e06SEd Maste.Fa blob_ptr
1120afa8e06SEd Mastein bytes.
1130afa8e06SEd MasteA
1140afa8e06SEd Maste.Fa pin
1150afa8e06SEd Masteor equivalent user-verification gesture is required.
1160afa8e06SEd Maste.Pp
1170afa8e06SEd MasteThe
1180afa8e06SEd Maste.Fn fido_dev_largeblob_remove
1190afa8e06SEd Mastefunction retrieves the authenticator's
1200afa8e06SEd Maste.Dq largeBlobs
1210afa8e06SEd MasteCBOR array and, on success, drops the first blob
1220afa8e06SEd Maste.Pq iterating from array index zero
1230afa8e06SEd Mastethat can be decrypted by
1240afa8e06SEd Maste.Fa key_ptr ,
1250afa8e06SEd Mastewhere
1260afa8e06SEd Maste.Fa key_ptr
1270afa8e06SEd Mastepoints to
1280afa8e06SEd Maste.Fa key_len
1290afa8e06SEd Mastebytes.
1300afa8e06SEd MasteA
1310afa8e06SEd Maste.Fa pin
1320afa8e06SEd Masteor equivalent user-verification gesture is required.
1330afa8e06SEd Maste.Pp
1340afa8e06SEd MasteThe
1350afa8e06SEd Maste.Fn fido_dev_largeblob_get_array
1360afa8e06SEd Mastefunction retrieves the authenticator's
1370afa8e06SEd Maste.Dq largeBlobs
1380afa8e06SEd MasteCBOR array and, on success,
1390afa8e06SEd Mastesets
1400afa8e06SEd Maste.Fa cbor_ptr
1410afa8e06SEd Masteto the body of the CBOR array, and
1420afa8e06SEd Maste.Fa cbor_len
1430afa8e06SEd Masteto its corresponding length in bytes.
1440afa8e06SEd MasteIt is the caller's responsibility to free
1450afa8e06SEd Maste.Fa cbor_ptr .
1460afa8e06SEd Maste.Pp
1470afa8e06SEd MasteFinally, the
1480afa8e06SEd Maste.Fn fido_dev_largeblob_set_array
1490afa8e06SEd Mastefunction sets the authenticator's
1500afa8e06SEd Maste.Dq largeBlobs
1510afa8e06SEd MasteCBOR array to the data pointed to by
1520afa8e06SEd Maste.Fa cbor_ptr ,
1530afa8e06SEd Mastewhere
1540afa8e06SEd Maste.Fa cbor_ptr
1550afa8e06SEd Mastepoints to
1560afa8e06SEd Maste.Fa cbor_len
1570afa8e06SEd Mastebytes.
1580afa8e06SEd MasteA
1590afa8e06SEd Maste.Fa pin
1600afa8e06SEd Masteor equivalent user-verification gesture is required.
1610afa8e06SEd Maste.Sh RETURN VALUES
1620afa8e06SEd MasteThe functions
1630afa8e06SEd Maste.Fn fido_dev_largeblob_set ,
1640afa8e06SEd Maste.Fn fido_dev_largeblob_get ,
1650afa8e06SEd Maste.Fn fido_dev_largeblob_remove ,
1660afa8e06SEd Maste.Fn fido_dev_largeblob_get_array ,
1670afa8e06SEd Masteand
1680afa8e06SEd Maste.Fn fido_dev_largeblob_set_array
1690afa8e06SEd Mastereturn
1700afa8e06SEd Maste.Dv FIDO_OK
1710afa8e06SEd Masteon success.
1720afa8e06SEd MasteOn error, an error code defined in
1730afa8e06SEd Maste.In fido/err.h
1740afa8e06SEd Masteis returned.
1750afa8e06SEd Maste.Sh SEE ALSO
1760afa8e06SEd Maste.Xr fido_assert_largeblob_key_len 3 ,
1770afa8e06SEd Maste.Xr fido_assert_largeblob_key_ptr 3 ,
1780afa8e06SEd Maste.Xr fido_assert_set_extensions 3 ,
1790afa8e06SEd Maste.Xr fido_cred_largeblob_key_len 3 ,
1800afa8e06SEd Maste.Xr fido_cred_largeblob_key_ptr 3 ,
1810afa8e06SEd Maste.Xr fido_cred_set_extensions 3 ,
1820afa8e06SEd Maste.Xr fido_credman_dev_get_rk 3 ,
1830afa8e06SEd Maste.Xr fido_credman_dev_get_rp 3 ,
1840afa8e06SEd Maste.Xr fido_dev_get_assert 3 ,
1850afa8e06SEd Maste.Xr fido_dev_make_cred 3
1860afa8e06SEd Maste.Sh CAVEATS
1870afa8e06SEd MasteThe
1880afa8e06SEd Maste.Dq largeBlobs
1890afa8e06SEd Masteextension is not meant to be used to store sensitive data.
1900afa8e06SEd MasteWhen retrieved, a credential's
1910afa8e06SEd Maste.Dq largeBlobs
1920afa8e06SEd Masteencryption key is transmitted in the clear, and an authenticator's
1930afa8e06SEd Maste.Dq largeBlobs
1940afa8e06SEd MasteCBOR array can be read without user interaction or verification.
195