xref: /netbsd-src/external/bsd/libfido2/dist/man/fido_init.3 (revision 2d40c4512a84c0d064ec30a492c5e2a14d230bc3)
1ba9bdd8bSchristos.\" Copyright (c) 2018 Yubico AB. All rights reserved.
2*2d40c451Schristos.\"
3*2d40c451Schristos.\" Redistribution and use in source and binary forms, with or without
4*2d40c451Schristos.\" modification, are permitted provided that the following conditions are
5*2d40c451Schristos.\" met:
6*2d40c451Schristos.\"
7*2d40c451Schristos.\"    1. Redistributions of source code must retain the above copyright
8*2d40c451Schristos.\"       notice, this list of conditions and the following disclaimer.
9*2d40c451Schristos.\"    2. Redistributions in binary form must reproduce the above copyright
10*2d40c451Schristos.\"       notice, this list of conditions and the following disclaimer in
11*2d40c451Schristos.\"       the documentation and/or other materials provided with the
12*2d40c451Schristos.\"       distribution.
13*2d40c451Schristos.\"
14*2d40c451Schristos.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15*2d40c451Schristos.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16*2d40c451Schristos.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17*2d40c451Schristos.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18*2d40c451Schristos.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19*2d40c451Schristos.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20*2d40c451Schristos.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*2d40c451Schristos.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*2d40c451Schristos.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*2d40c451Schristos.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24*2d40c451Schristos.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*2d40c451Schristos.\"
26*2d40c451Schristos.\" SPDX-License-Identifier: BSD-2-Clause
27ba9bdd8bSchristos.\"
28ba9bdd8bSchristos.Dd $Mdocdate: May 25 2018 $
29ba9bdd8bSchristos.Dt FIDO_INIT 3
30ba9bdd8bSchristos.Os
31ba9bdd8bSchristos.Sh NAME
32*2d40c451Schristos.Nm fido_init ,
33*2d40c451Schristos.Nm fido_set_log_handler
34ba9bdd8bSchristos.Nd initialise the FIDO2 library
35ba9bdd8bSchristos.Sh SYNOPSIS
36ba9bdd8bSchristos.In fido.h
37*2d40c451Schristos.Bd -literal
38*2d40c451Schristostypedef void fido_log_handler_t(const char *);
39*2d40c451Schristos.Ed
40*2d40c451Schristos.Pp
41ba9bdd8bSchristos.Ft void
42ba9bdd8bSchristos.Fn fido_init "int flags"
43*2d40c451Schristos.Ft void
44*2d40c451Schristos.Fn fido_set_log_handler "fido_log_handler_t *handler"
45ba9bdd8bSchristos.Sh DESCRIPTION
46ba9bdd8bSchristosThe
47ba9bdd8bSchristos.Fn fido_init
48ba9bdd8bSchristosfunction initialises the
49ba9bdd8bSchristos.Em libfido2
50ba9bdd8bSchristoslibrary.
51ba9bdd8bSchristosIts invocation must precede that of any other
52ba9bdd8bSchristos.Em libfido2
5395dbdf32Schristosfunction in the context of the executing thread.
5495dbdf32Schristos.Pp
55ba9bdd8bSchristosIf
56ba9bdd8bSchristos.Dv FIDO_DEBUG
57ba9bdd8bSchristosis set in
58ba9bdd8bSchristos.Fa flags ,
59ba9bdd8bSchristosthen
60ba9bdd8bSchristosdebug output will be emitted by
61ba9bdd8bSchristos.Em libfido2
62ba9bdd8bSchristoson
63ba9bdd8bSchristos.Em stderr .
64ba9bdd8bSchristosAlternatively, the
65ba9bdd8bSchristos.Ev FIDO_DEBUG
66ba9bdd8bSchristosenvironment variable may be set.
6795dbdf32Schristos.Pp
6895dbdf32SchristosIf
6995dbdf32Schristos.Dv FIDO_DISABLE_U2F_FALLBACK
7095dbdf32Schristosis set in
7195dbdf32Schristos.Fa flags ,
7295dbdf32Schristosthen
7395dbdf32Schristos.Em libfido2
7495dbdf32Schristoswill not fallback to U2F in
7595dbdf32Schristos.Xr fido_dev_open 3
76*2d40c451Schristosif a device claims to support FIDO2 but fails to respond to
77*2d40c451Schristosa CTAP 2.0 greeting.
78*2d40c451Schristos.Pp
79*2d40c451SchristosThe
80*2d40c451Schristos.Fn fido_set_log_handler
81*2d40c451Schristosfunction causes
82*2d40c451Schristos.Fa handler
83*2d40c451Schristosto be called for each log line generated in the context of the
84*2d40c451Schristosexecuting thread.
85*2d40c451SchristosLines passed to
86*2d40c451Schristos.Fa handler
87*2d40c451Schristosinclude a trailing newline character and are not printed by
88*2d40c451Schristos.Em libfido2
89*2d40c451Schristoson
90*2d40c451Schristos.Em stderr .
91ba9bdd8bSchristos.Sh SEE ALSO
92ba9bdd8bSchristos.Xr fido_assert_new 3 ,
93ba9bdd8bSchristos.Xr fido_cred_new 3 ,
94ba9bdd8bSchristos.Xr fido_dev_info_manifest 3 ,
95ba9bdd8bSchristos.Xr fido_dev_open 3
96