1FIDO_ASSERT_SET_AUTHD... BSD Library Functions Manual FIDO_ASSERT_SET_AUTHD...
2

NAME

4     fido_assert_set_authdata, fido_assert_set_authdata_raw,
5     fido_assert_set_clientdata_hash, fido_assert_set_count,
6     fido_assert_set_extensions, fido_assert_set_hmac_salt,
7     fido_assert_set_up, fido_assert_set_uv, fido_assert_set_rp,
8     fido_assert_set_sig — set parameters of a FIDO 2 assertion
9

SYNOPSIS

11     #include <fido.h>
12
13     typedef enum {
14             FIDO_OPT_OMIT = 0, /* use authenticator's default */
15             FIDO_OPT_FALSE,    /* explicitly set option to false */
16             FIDO_OPT_TRUE,     /* explicitly set option to true */
17     } fido_opt_t;
18
19     int
20     fido_assert_set_authdata(fido_assert_t *assert, size_t idx,
21         const unsigned char *ptr, size_t len);
22
23     int
24     fido_assert_set_authdata_raw(fido_assert_t *assert, size_t idx,
25         const unsigned char *ptr, size_t len);
26
27     int
28     fido_assert_set_clientdata_hash(fido_assert_t *assert,
29         const unsigned char *ptr, size_t len);
30
31     int
32     fido_assert_set_count(fido_assert_t *assert, size_t n);
33
34     int
35     fido_assert_set_extensions(fido_assert_t *assert, int flags);
36
37     int
38     fido_assert_set_hmac_salt(fido_assert_t *assert,
39         const unsigned char *ptr, size_t len);
40
41     int
42     fido_assert_set_up(fido_assert_t *assert, fido_opt_t up);
43
44     int
45     fido_assert_set_uv(fido_assert_t *assert, fido_opt_t uv);
46
47     int
48     fido_assert_set_rp(fido_assert_t *assert, const char *id);
49
50     int
51     fido_assert_set_sig(fido_assert_t *assert, size_t idx,
52         const unsigned char *ptr, size_t len);
53

DESCRIPTION

55     The fido_assert_set_authdata set of functions define the various parame‐
56     ters of a FIDO 2 assertion, allowing a fido_assert_t type to be prepared
57     for a subsequent call to fido_dev_get_assert(3) or fido_assert_verify(3).
58     For the complete specification of a FIDO 2 assertion and the format of
59     its constituent parts, please refer to the Web Authentication (webauthn)
60     standard.
61
62     The fido_assert_set_count() function sets the number of assertion state‐
63     ments in assert to n.
64
65     The fido_assert_set_authdata() and fido_assert_set_sig() functions set
66     the authenticator data and signature parts of the statement with index
67     idx of assert to ptr, where ptr points to len bytes.  A copy of ptr is
68     made, and no references to the passed pointer are kept.  Please note that
69     the first assertion statement of assert has an idx of 0.  The authentica‐
70     tor data passed to fido_assert_set_authdata() must be a CBOR-encoded byte
71     string, as obtained from fido_assert_authdata_ptr().  Alternatively, a
72     raw binary blob may be passed to fido_assert_set_authdata_raw().
73
74     The fido_assert_set_clientdata_hash() and fido_assert_set_hmac_salt()
75     functions set the client data hash and hmac-salt parts of assert to ptr,
76     where ptr points to len bytes.  A copy of ptr is made, and no references
77     to the passed pointer are kept.
78
79     The fido_assert_set_rp() function sets the relying party id of assert,
80     where id is a NUL-terminated UTF-8 string.  The content of id is copied,
81     and no references to the passed pointer are kept.
82
83     The fido_assert_set_extensions() function sets the extensions of assert
84     to the bitmask flags.  At the moment, only the FIDO_EXT_HMAC_SECRET
85     extension is supported.  If flags is zero, the extensions of assert are
86     cleared.
87
88     The fido_assert_set_up() and fido_assert_set_uv() functions set the up
89     (user presence) and uv (user verification) attributes of assert.  Both
90     are FIDO_OPT_OMIT by default, allowing the authenticator to use its
91     default settings.
92
93     Use of the fido_assert_set_authdata set of functions may happen in two
94     distinct situations: when asking a FIDO device to produce a series of
95     assertion statements, prior to fido_dev_get_assert(3) (i.e, in the con‐
96     text of a FIDO client), or when verifying assertion statements using
97     fido_assert_verify(3) (i.e, in the context of a FIDO server).
98
99     For a complete description of the generation of a FIDO 2 assertion and
100     its verification, please refer to the FIDO 2 specification.  An example
101     of how to use the fido_assert_set_authdata set of functions can be found
102     in the examples/assert.c file shipped with libfido2.
103

RETURN VALUES

105     The fido_assert_set_authdata functions return FIDO_OK on success.  The
106     error codes returned by the fido_assert_set_authdata set of functions are
107     defined in <fido/err.h>.
108

SEE ALSO

110     fido_assert_allow_cred(3), fido_assert_verify(3), fido_dev_get_assert(3)
111
112BSD                              May 10, 2020                              BSD
Impressum