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