xref: /freebsd/contrib/libfido2/man/fido_assert_set_authdata.3 (revision 3e696dfb7009cd8ffa12e36f48f4339bb7a2048d)
10afa8e06SEd Maste.\" Copyright (c) 2018 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: May 23 2018 $
60afa8e06SEd Maste.Dt FIDO_ASSERT_SET_AUTHDATA 3
70afa8e06SEd Maste.Os
80afa8e06SEd Maste.Sh NAME
90afa8e06SEd Maste.Nm fido_assert_set_authdata ,
100afa8e06SEd Maste.Nm fido_assert_set_authdata_raw ,
110afa8e06SEd Maste.Nm fido_assert_set_clientdata ,
120afa8e06SEd Maste.Nm fido_assert_set_clientdata_hash ,
130afa8e06SEd Maste.Nm fido_assert_set_count ,
140afa8e06SEd Maste.Nm fido_assert_set_extensions ,
150afa8e06SEd Maste.Nm fido_assert_set_hmac_salt ,
160afa8e06SEd Maste.Nm fido_assert_set_hmac_secret ,
170afa8e06SEd Maste.Nm fido_assert_set_up ,
180afa8e06SEd Maste.Nm fido_assert_set_uv ,
190afa8e06SEd Maste.Nm fido_assert_set_rp ,
200afa8e06SEd Maste.Nm fido_assert_set_sig
210afa8e06SEd Maste.Nd set parameters of a FIDO2 assertion
220afa8e06SEd Maste.Sh SYNOPSIS
230afa8e06SEd Maste.In fido.h
240afa8e06SEd Maste.Bd -literal
250afa8e06SEd Mastetypedef enum {
260afa8e06SEd Maste	FIDO_OPT_OMIT = 0, /* use authenticator's default */
270afa8e06SEd Maste	FIDO_OPT_FALSE,    /* explicitly set option to false */
280afa8e06SEd Maste        FIDO_OPT_TRUE,     /* explicitly set option to true */
290afa8e06SEd Maste} fido_opt_t;
300afa8e06SEd Maste.Ed
310afa8e06SEd Maste.Ft int
320afa8e06SEd Maste.Fn fido_assert_set_authdata "fido_assert_t *assert" "size_t idx" "const unsigned char *ptr" "size_t len"
330afa8e06SEd Maste.Ft int
340afa8e06SEd Maste.Fn fido_assert_set_authdata_raw "fido_assert_t *assert" "size_t idx" "const unsigned char *ptr" "size_t len"
350afa8e06SEd Maste.Ft int
360afa8e06SEd Maste.Fn fido_assert_set_clientdata "fido_assert_t *assert" "const unsigned char *ptr" "size_t len"
370afa8e06SEd Maste.Ft int
380afa8e06SEd Maste.Fn fido_assert_set_clientdata_hash "fido_assert_t *assert" "const unsigned char *ptr" "size_t len"
390afa8e06SEd Maste.Ft int
400afa8e06SEd Maste.Fn fido_assert_set_count "fido_assert_t *assert" "size_t n"
410afa8e06SEd Maste.Ft int
420afa8e06SEd Maste.Fn fido_assert_set_extensions "fido_assert_t *assert" "int flags"
430afa8e06SEd Maste.Ft int
440afa8e06SEd Maste.Fn fido_assert_set_hmac_salt "fido_assert_t *assert" "const unsigned char *ptr" "size_t len"
450afa8e06SEd Maste.Ft int
46*3e696dfbSEd Maste.Fn fido_assert_set_hmac_secret "fido_assert_t *assert" "size_t idx" "const unsigned char *ptr" "size_t len"
470afa8e06SEd Maste.Ft int
480afa8e06SEd Maste.Fn fido_assert_set_up "fido_assert_t *assert" "fido_opt_t up"
490afa8e06SEd Maste.Ft int
500afa8e06SEd Maste.Fn fido_assert_set_uv "fido_assert_t *assert" "fido_opt_t uv"
510afa8e06SEd Maste.Ft int
520afa8e06SEd Maste.Fn fido_assert_set_rp "fido_assert_t *assert" "const char *id"
530afa8e06SEd Maste.Ft int
540afa8e06SEd Maste.Fn fido_assert_set_sig "fido_assert_t *assert" "size_t idx" "const unsigned char *ptr" "size_t len"
550afa8e06SEd Maste.Sh DESCRIPTION
560afa8e06SEd MasteThe
570afa8e06SEd Maste.Nm
580afa8e06SEd Masteset of functions define the various parameters of a FIDO2
590afa8e06SEd Masteassertion, allowing a
600afa8e06SEd Maste.Fa fido_assert_t
610afa8e06SEd Mastetype to be prepared for a subsequent call to
620afa8e06SEd Maste.Xr fido_dev_get_assert 3
630afa8e06SEd Masteor
640afa8e06SEd Maste.Xr fido_assert_verify 3 .
650afa8e06SEd MasteFor the complete specification of a FIDO2 assertion and the format
660afa8e06SEd Masteof its constituent parts, please refer to the Web Authentication
670afa8e06SEd Maste(webauthn) standard.
680afa8e06SEd Maste.Pp
690afa8e06SEd MasteThe
700afa8e06SEd Maste.Fn fido_assert_set_count
710afa8e06SEd Mastefunction sets the number of assertion statements in
720afa8e06SEd Maste.Fa assert
730afa8e06SEd Masteto
740afa8e06SEd Maste.Fa n .
750afa8e06SEd Maste.Pp
760afa8e06SEd MasteThe
770afa8e06SEd Maste.Fn fido_assert_set_authdata
780afa8e06SEd Masteand
790afa8e06SEd Maste.Fn fido_assert_set_sig
800afa8e06SEd Mastefunctions set the authenticator data and signature parts of the
810afa8e06SEd Mastestatement with index
820afa8e06SEd Maste.Fa idx
830afa8e06SEd Masteof
840afa8e06SEd Maste.Fa assert
850afa8e06SEd Masteto
860afa8e06SEd Maste.Fa ptr ,
870afa8e06SEd Mastewhere
880afa8e06SEd Maste.Fa ptr
890afa8e06SEd Mastepoints to
900afa8e06SEd Maste.Fa len
910afa8e06SEd Mastebytes.
920afa8e06SEd MasteA copy of
930afa8e06SEd Maste.Fa ptr
940afa8e06SEd Masteis made, and no references to the passed pointer are kept.
950afa8e06SEd MastePlease note that the first assertion statement of
960afa8e06SEd Maste.Fa assert
970afa8e06SEd Mastehas an
980afa8e06SEd Maste.Fa idx
990afa8e06SEd Masteof
1000afa8e06SEd Maste.Em 0 .
1010afa8e06SEd MasteThe authenticator data passed to
1020afa8e06SEd Maste.Fn fido_assert_set_authdata
1030afa8e06SEd Mastemust be a CBOR-encoded byte string, as obtained from
1040afa8e06SEd Maste.Fn fido_assert_authdata_ptr .
1050afa8e06SEd MasteAlternatively, a raw binary blob may be passed to
1060afa8e06SEd Maste.Fn fido_assert_set_authdata_raw .
1070afa8e06SEd Maste.Pp
1080afa8e06SEd MasteThe
109*3e696dfbSEd Maste.Fn fido_assert_set_clientdata_hash
110*3e696dfbSEd Mastefunction sets the client data hash of
1110afa8e06SEd Maste.Fa assert
1120afa8e06SEd Masteto
1130afa8e06SEd Maste.Fa ptr ,
1140afa8e06SEd Mastewhere
1150afa8e06SEd Maste.Fa ptr
1160afa8e06SEd Mastepoints to
1170afa8e06SEd Maste.Fa len
1180afa8e06SEd Mastebytes.
1190afa8e06SEd MasteA copy of
1200afa8e06SEd Maste.Fa ptr
1210afa8e06SEd Masteis made, and no references to the passed pointer are kept.
1220afa8e06SEd Maste.Pp
1230afa8e06SEd MasteThe
1240afa8e06SEd Maste.Fn fido_assert_set_clientdata
1250afa8e06SEd Mastefunction allows an application to set the client data hash of
1260afa8e06SEd Maste.Fa assert
1270afa8e06SEd Masteby specifying the assertion's unhashed client data.
1280afa8e06SEd MasteThis is required by Windows Hello, which calculates the client data
1290afa8e06SEd Mastehash internally.
1300afa8e06SEd MasteFor compatibility with Windows Hello, applications should use
1310afa8e06SEd Maste.Fn fido_assert_set_clientdata
1320afa8e06SEd Masteinstead of
1330afa8e06SEd Maste.Fn fido_assert_set_clientdata_hash .
1340afa8e06SEd Maste.Pp
1350afa8e06SEd MasteThe
1360afa8e06SEd Maste.Fn fido_assert_set_rp
1370afa8e06SEd Mastefunction sets the relying party
1380afa8e06SEd Maste.Fa id
1390afa8e06SEd Masteof
1400afa8e06SEd Maste.Fa assert ,
1410afa8e06SEd Mastewhere
1420afa8e06SEd Maste.Fa id
1430afa8e06SEd Masteis a NUL-terminated UTF-8 string.
1440afa8e06SEd MasteThe content of
1450afa8e06SEd Maste.Fa id
1460afa8e06SEd Masteis copied, and no references to the passed pointer are kept.
1470afa8e06SEd Maste.Pp
1480afa8e06SEd MasteThe
1490afa8e06SEd Maste.Fn fido_assert_set_extensions
1500afa8e06SEd Mastefunction sets the extensions of
1510afa8e06SEd Maste.Fa assert
1520afa8e06SEd Masteto the bitmask
1530afa8e06SEd Maste.Fa flags .
1540afa8e06SEd MasteAt the moment, only the
1550afa8e06SEd Maste.Dv FIDO_EXT_CRED_BLOB ,
1560afa8e06SEd Maste.Dv FIDO_EXT_HMAC_SECRET ,
1570afa8e06SEd Masteand
1580afa8e06SEd Maste.Dv FIDO_EXT_LARGEBLOB_KEY
1590afa8e06SEd Masteextensions are supported.
1600afa8e06SEd MasteIf
1610afa8e06SEd Maste.Fa flags
1620afa8e06SEd Masteis zero, the extensions of
1630afa8e06SEd Maste.Fa assert
1640afa8e06SEd Masteare cleared.
1650afa8e06SEd Maste.Pp
1660afa8e06SEd MasteThe
167*3e696dfbSEd Maste.Fn fido_assert_set_hmac_salt
168*3e696dfbSEd Masteand
169*3e696dfbSEd Maste.Fn fido_assert_set_hmac_secret
170*3e696dfbSEd Mastefunctions set the hmac-salt and hmac-secret parts of
171*3e696dfbSEd Maste.Fa assert
172*3e696dfbSEd Masteto
173*3e696dfbSEd Maste.Fa ptr ,
174*3e696dfbSEd Mastewhere
175*3e696dfbSEd Maste.Fa ptr
176*3e696dfbSEd Mastepoints to
177*3e696dfbSEd Maste.Fa len
178*3e696dfbSEd Mastebytes.
179*3e696dfbSEd MasteA copy of
180*3e696dfbSEd Maste.Fa ptr
181*3e696dfbSEd Masteis made, and no references to the passed pointer are kept.
182*3e696dfbSEd MasteThe HMAC Secret
183*3e696dfbSEd Maste.Pq hmac-secret
184*3e696dfbSEd MasteExtension is a CTAP 2.0 extension.
185*3e696dfbSEd MasteThe
186*3e696dfbSEd Maste.Fn fido_assert_set_hmac_secret
187*3e696dfbSEd Mastefunction is normally only useful when writing tests.
188*3e696dfbSEd Maste.Pp
189*3e696dfbSEd MasteThe
1900afa8e06SEd Maste.Fn fido_assert_set_up
1910afa8e06SEd Masteand
1920afa8e06SEd Maste.Fn fido_assert_set_uv
1930afa8e06SEd Mastefunctions set the
1940afa8e06SEd Maste.Fa up
1950afa8e06SEd Maste(user presence) and
1960afa8e06SEd Maste.Fa uv
1970afa8e06SEd Maste(user verification)
1980afa8e06SEd Masteattributes of
1990afa8e06SEd Maste.Fa assert .
2000afa8e06SEd MasteBoth are
2010afa8e06SEd Maste.Dv FIDO_OPT_OMIT
2020afa8e06SEd Masteby default, allowing the authenticator to use its default settings.
2030afa8e06SEd Maste.Pp
2040afa8e06SEd MasteUse of the
2050afa8e06SEd Maste.Nm
2060afa8e06SEd Masteset of functions may happen in two distinct situations:
207*3e696dfbSEd Mastewhen asking a FIDO2 device to produce a series of assertion
2080afa8e06SEd Mastestatements, prior to
2090afa8e06SEd Maste.Xr fido_dev_get_assert 3
210*3e696dfbSEd Maste(i.e, in the context of a FIDO2 client), or when verifying assertion
2110afa8e06SEd Mastestatements using
2120afa8e06SEd Maste.Xr fido_assert_verify 3
213*3e696dfbSEd Maste(i.e, in the context of a FIDO2 server).
2140afa8e06SEd Maste.Pp
2150afa8e06SEd MasteFor a complete description of the generation of a FIDO2 assertion
2160afa8e06SEd Masteand its verification, please refer to the FIDO2 specification.
2170afa8e06SEd MasteAn example of how to use the
2180afa8e06SEd Maste.Nm
2190afa8e06SEd Masteset of functions can be found in the
2200afa8e06SEd Maste.Pa examples/assert.c
2210afa8e06SEd Mastefile shipped with
2220afa8e06SEd Maste.Em libfido2 .
2230afa8e06SEd Maste.Sh RETURN VALUES
2240afa8e06SEd MasteThe
2250afa8e06SEd Maste.Nm
2260afa8e06SEd Mastefunctions return
2270afa8e06SEd Maste.Dv FIDO_OK
2280afa8e06SEd Masteon success.
2290afa8e06SEd MasteThe error codes returned by the
2300afa8e06SEd Maste.Nm
2310afa8e06SEd Masteset of functions are defined in
2320afa8e06SEd Maste.In fido/err.h .
2330afa8e06SEd Maste.Sh SEE ALSO
2340afa8e06SEd Maste.Xr fido_assert_allow_cred 3 ,
2350afa8e06SEd Maste.Xr fido_assert_verify 3 ,
2360afa8e06SEd Maste.Xr fido_dev_get_assert 3
237