1*0afa8e06SEd Maste.\" Copyright (c) 2018 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: May 23 2018 $ 6*0afa8e06SEd Maste.Dt FIDO_ASSERT_SET_AUTHDATA 3 7*0afa8e06SEd Maste.Os 8*0afa8e06SEd Maste.Sh NAME 9*0afa8e06SEd Maste.Nm fido_assert_set_authdata , 10*0afa8e06SEd Maste.Nm fido_assert_set_authdata_raw , 11*0afa8e06SEd Maste.Nm fido_assert_set_clientdata , 12*0afa8e06SEd Maste.Nm fido_assert_set_clientdata_hash , 13*0afa8e06SEd Maste.Nm fido_assert_set_count , 14*0afa8e06SEd Maste.Nm fido_assert_set_extensions , 15*0afa8e06SEd Maste.Nm fido_assert_set_hmac_salt , 16*0afa8e06SEd Maste.Nm fido_assert_set_hmac_secret , 17*0afa8e06SEd Maste.Nm fido_assert_set_up , 18*0afa8e06SEd Maste.Nm fido_assert_set_uv , 19*0afa8e06SEd Maste.Nm fido_assert_set_rp , 20*0afa8e06SEd Maste.Nm fido_assert_set_sig 21*0afa8e06SEd Maste.Nd set parameters of a FIDO 2 assertion 22*0afa8e06SEd Maste.Sh SYNOPSIS 23*0afa8e06SEd Maste.In fido.h 24*0afa8e06SEd Maste.Bd -literal 25*0afa8e06SEd Mastetypedef enum { 26*0afa8e06SEd Maste FIDO_OPT_OMIT = 0, /* use authenticator's default */ 27*0afa8e06SEd Maste FIDO_OPT_FALSE, /* explicitly set option to false */ 28*0afa8e06SEd Maste FIDO_OPT_TRUE, /* explicitly set option to true */ 29*0afa8e06SEd Maste} fido_opt_t; 30*0afa8e06SEd Maste.Ed 31*0afa8e06SEd Maste.Ft int 32*0afa8e06SEd Maste.Fn fido_assert_set_authdata "fido_assert_t *assert" " size_t idx" "const unsigned char *ptr" "size_t len" 33*0afa8e06SEd Maste.Ft int 34*0afa8e06SEd Maste.Fn fido_assert_set_authdata_raw "fido_assert_t *assert" " size_t idx" "const unsigned char *ptr" "size_t len" 35*0afa8e06SEd Maste.Ft int 36*0afa8e06SEd Maste.Fn fido_assert_set_clientdata "fido_assert_t *assert" "const unsigned char *ptr" "size_t len" 37*0afa8e06SEd Maste.Ft int 38*0afa8e06SEd Maste.Fn fido_assert_set_clientdata_hash "fido_assert_t *assert" "const unsigned char *ptr" "size_t len" 39*0afa8e06SEd Maste.Ft int 40*0afa8e06SEd Maste.Fn fido_assert_set_count "fido_assert_t *assert" "size_t n" 41*0afa8e06SEd Maste.Ft int 42*0afa8e06SEd Maste.Fn fido_assert_set_extensions "fido_assert_t *assert" "int flags" 43*0afa8e06SEd Maste.Ft int 44*0afa8e06SEd Maste.Fn fido_assert_set_hmac_salt "fido_assert_t *assert" "const unsigned char *ptr" "size_t len" 45*0afa8e06SEd Maste.Ft int 46*0afa8e06SEd Maste.Fn fido_assert_set_hmac_secret "fido_assert_t *assert" "const unsigned char *ptr" "size_t len" 47*0afa8e06SEd Maste.Ft int 48*0afa8e06SEd Maste.Fn fido_assert_set_up "fido_assert_t *assert" "fido_opt_t up" 49*0afa8e06SEd Maste.Ft int 50*0afa8e06SEd Maste.Fn fido_assert_set_uv "fido_assert_t *assert" "fido_opt_t uv" 51*0afa8e06SEd Maste.Ft int 52*0afa8e06SEd Maste.Fn fido_assert_set_rp "fido_assert_t *assert" "const char *id" 53*0afa8e06SEd Maste.Ft int 54*0afa8e06SEd Maste.Fn fido_assert_set_sig "fido_assert_t *assert" "size_t idx" "const unsigned char *ptr" "size_t len" 55*0afa8e06SEd Maste.Sh DESCRIPTION 56*0afa8e06SEd MasteThe 57*0afa8e06SEd Maste.Nm 58*0afa8e06SEd Masteset of functions define the various parameters of a FIDO 2 59*0afa8e06SEd Masteassertion, allowing a 60*0afa8e06SEd Maste.Fa fido_assert_t 61*0afa8e06SEd Mastetype to be prepared for a subsequent call to 62*0afa8e06SEd Maste.Xr fido_dev_get_assert 3 63*0afa8e06SEd Masteor 64*0afa8e06SEd Maste.Xr fido_assert_verify 3 . 65*0afa8e06SEd MasteFor the complete specification of a FIDO 2 assertion and the format 66*0afa8e06SEd Masteof its constituent parts, please refer to the Web Authentication 67*0afa8e06SEd Maste(webauthn) standard. 68*0afa8e06SEd Maste.Pp 69*0afa8e06SEd MasteThe 70*0afa8e06SEd Maste.Fn fido_assert_set_count 71*0afa8e06SEd Mastefunction sets the number of assertion statements in 72*0afa8e06SEd Maste.Fa assert 73*0afa8e06SEd Masteto 74*0afa8e06SEd Maste.Fa n . 75*0afa8e06SEd Maste.Pp 76*0afa8e06SEd MasteThe 77*0afa8e06SEd Maste.Fn fido_assert_set_authdata 78*0afa8e06SEd Masteand 79*0afa8e06SEd Maste.Fn fido_assert_set_sig 80*0afa8e06SEd Mastefunctions set the authenticator data and signature parts of the 81*0afa8e06SEd Mastestatement with index 82*0afa8e06SEd Maste.Fa idx 83*0afa8e06SEd Masteof 84*0afa8e06SEd Maste.Fa assert 85*0afa8e06SEd Masteto 86*0afa8e06SEd Maste.Fa ptr , 87*0afa8e06SEd Mastewhere 88*0afa8e06SEd Maste.Fa ptr 89*0afa8e06SEd Mastepoints to 90*0afa8e06SEd Maste.Fa len 91*0afa8e06SEd Mastebytes. 92*0afa8e06SEd MasteA copy of 93*0afa8e06SEd Maste.Fa ptr 94*0afa8e06SEd Masteis made, and no references to the passed pointer are kept. 95*0afa8e06SEd MastePlease note that the first assertion statement of 96*0afa8e06SEd Maste.Fa assert 97*0afa8e06SEd Mastehas an 98*0afa8e06SEd Maste.Fa idx 99*0afa8e06SEd Masteof 100*0afa8e06SEd Maste.Em 0 . 101*0afa8e06SEd MasteThe authenticator data passed to 102*0afa8e06SEd Maste.Fn fido_assert_set_authdata 103*0afa8e06SEd Mastemust be a CBOR-encoded byte string, as obtained from 104*0afa8e06SEd Maste.Fn fido_assert_authdata_ptr . 105*0afa8e06SEd MasteAlternatively, a raw binary blob may be passed to 106*0afa8e06SEd Maste.Fn fido_assert_set_authdata_raw . 107*0afa8e06SEd Maste.Pp 108*0afa8e06SEd MasteThe 109*0afa8e06SEd Maste.Fn fido_assert_set_clientdata_hash , 110*0afa8e06SEd Maste.Fn fido_assert_set_hmac_salt , 111*0afa8e06SEd Masteand 112*0afa8e06SEd Maste.Fn fido_assert_set_hmac_secret 113*0afa8e06SEd Mastefunctions set the client data hash and hmac-salt parts of 114*0afa8e06SEd Maste.Fa assert 115*0afa8e06SEd Masteto 116*0afa8e06SEd Maste.Fa ptr , 117*0afa8e06SEd Mastewhere 118*0afa8e06SEd Maste.Fa ptr 119*0afa8e06SEd Mastepoints to 120*0afa8e06SEd Maste.Fa len 121*0afa8e06SEd Mastebytes. 122*0afa8e06SEd MasteA copy of 123*0afa8e06SEd Maste.Fa ptr 124*0afa8e06SEd Masteis made, and no references to the passed pointer are kept. 125*0afa8e06SEd Maste.Pp 126*0afa8e06SEd MasteThe 127*0afa8e06SEd Maste.Fn fido_assert_set_clientdata 128*0afa8e06SEd Mastefunction allows an application to set the client data hash of 129*0afa8e06SEd Maste.Fa assert 130*0afa8e06SEd Masteby specifying the assertion's unhashed client data. 131*0afa8e06SEd MasteThis is required by Windows Hello, which calculates the client data 132*0afa8e06SEd Mastehash internally. 133*0afa8e06SEd MasteFor compatibility with Windows Hello, applications should use 134*0afa8e06SEd Maste.Fn fido_assert_set_clientdata 135*0afa8e06SEd Masteinstead of 136*0afa8e06SEd Maste.Fn fido_assert_set_clientdata_hash . 137*0afa8e06SEd Maste.Pp 138*0afa8e06SEd MasteThe 139*0afa8e06SEd Maste.Fn fido_assert_set_rp 140*0afa8e06SEd Mastefunction sets the relying party 141*0afa8e06SEd Maste.Fa id 142*0afa8e06SEd Masteof 143*0afa8e06SEd Maste.Fa assert , 144*0afa8e06SEd Mastewhere 145*0afa8e06SEd Maste.Fa id 146*0afa8e06SEd Masteis a NUL-terminated UTF-8 string. 147*0afa8e06SEd MasteThe content of 148*0afa8e06SEd Maste.Fa id 149*0afa8e06SEd Masteis copied, and no references to the passed pointer are kept. 150*0afa8e06SEd Maste.Pp 151*0afa8e06SEd MasteThe 152*0afa8e06SEd Maste.Fn fido_assert_set_extensions 153*0afa8e06SEd Mastefunction sets the extensions of 154*0afa8e06SEd Maste.Fa assert 155*0afa8e06SEd Masteto the bitmask 156*0afa8e06SEd Maste.Fa flags . 157*0afa8e06SEd MasteAt the moment, only the 158*0afa8e06SEd Maste.Dv FIDO_EXT_CRED_BLOB , 159*0afa8e06SEd Maste.Dv FIDO_EXT_HMAC_SECRET , 160*0afa8e06SEd Masteand 161*0afa8e06SEd Maste.Dv FIDO_EXT_LARGEBLOB_KEY 162*0afa8e06SEd Masteextensions are supported. 163*0afa8e06SEd MasteIf 164*0afa8e06SEd Maste.Fa flags 165*0afa8e06SEd Masteis zero, the extensions of 166*0afa8e06SEd Maste.Fa assert 167*0afa8e06SEd Masteare cleared. 168*0afa8e06SEd Maste.Pp 169*0afa8e06SEd MasteThe 170*0afa8e06SEd Maste.Fn fido_assert_set_up 171*0afa8e06SEd Masteand 172*0afa8e06SEd Maste.Fn fido_assert_set_uv 173*0afa8e06SEd Mastefunctions set the 174*0afa8e06SEd Maste.Fa up 175*0afa8e06SEd Maste(user presence) and 176*0afa8e06SEd Maste.Fa uv 177*0afa8e06SEd Maste(user verification) 178*0afa8e06SEd Masteattributes of 179*0afa8e06SEd Maste.Fa assert . 180*0afa8e06SEd MasteBoth are 181*0afa8e06SEd Maste.Dv FIDO_OPT_OMIT 182*0afa8e06SEd Masteby default, allowing the authenticator to use its default settings. 183*0afa8e06SEd Maste.Pp 184*0afa8e06SEd MasteUse of the 185*0afa8e06SEd Maste.Nm 186*0afa8e06SEd Masteset of functions may happen in two distinct situations: 187*0afa8e06SEd Mastewhen asking a FIDO device to produce a series of assertion 188*0afa8e06SEd Mastestatements, prior to 189*0afa8e06SEd Maste.Xr fido_dev_get_assert 3 190*0afa8e06SEd Maste(i.e, in the context of a FIDO client), or when verifying assertion 191*0afa8e06SEd Mastestatements using 192*0afa8e06SEd Maste.Xr fido_assert_verify 3 193*0afa8e06SEd Maste(i.e, in the context of a FIDO server). 194*0afa8e06SEd Maste.Pp 195*0afa8e06SEd MasteFor a complete description of the generation of a FIDO 2 assertion 196*0afa8e06SEd Masteand its verification, please refer to the FIDO 2 specification. 197*0afa8e06SEd MasteAn example of how to use the 198*0afa8e06SEd Maste.Nm 199*0afa8e06SEd Masteset of functions can be found in the 200*0afa8e06SEd Maste.Pa examples/assert.c 201*0afa8e06SEd Mastefile shipped with 202*0afa8e06SEd Maste.Em libfido2 . 203*0afa8e06SEd Maste.Pp 204*0afa8e06SEd Maste.Fn fido_assert_set_hmac_secret 205*0afa8e06SEd Masteis not normally useful in a FIDO client or server \(em it is provided 206*0afa8e06SEd Masteto enable testing other functionality that relies on retrieving the 207*0afa8e06SEd MasteHMAC secret from an assertion obtained from an authenticator. 208*0afa8e06SEd Maste.Sh RETURN VALUES 209*0afa8e06SEd MasteThe 210*0afa8e06SEd Maste.Nm 211*0afa8e06SEd Mastefunctions return 212*0afa8e06SEd Maste.Dv FIDO_OK 213*0afa8e06SEd Masteon success. 214*0afa8e06SEd MasteThe error codes returned by the 215*0afa8e06SEd Maste.Nm 216*0afa8e06SEd Masteset of functions are defined in 217*0afa8e06SEd Maste.In fido/err.h . 218*0afa8e06SEd Maste.Sh SEE ALSO 219*0afa8e06SEd Maste.Xr fido_assert_allow_cred 3 , 220*0afa8e06SEd Maste.Xr fido_assert_verify 3 , 221*0afa8e06SEd Maste.Xr fido_dev_get_assert 3 222