FIDO_INIT(3)

πŸ“¦
version 1.17.0 Β· 2 versions
  • 1.17.0 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.10.0 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ FIDO_INIT(3) ✨ β€” the one where we wake libfido2 up πŸ’–

okay bestie, sit down, hydrate, because this is the page you read first. It's FIDO_INIT(3) from the Library Functions Manual and it's literally just "how do I turn libfido2 on" πŸŽ€


🌸 NAME 🌸

fido_init, fido_set_log_handler β€” initialise the FIDO2 library πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <fido.h>

typedef void fido_log_handler_t(const char *);

void
fido_init(int flags);

void
fido_set_log_handler(fido_log_handler_t *handler);

✨ DESCRIPTION ✨

So. fido_init() is the function that initialises the libfido2 library, and the vibes are very strict about this one: you have to call it before you call literally any other libfido2 function, and that's specifically in the context of the executing thread. No skipping the line, no "I'll do it later", it's giving "first day of school attendance" πŸ“‹. It's the main character of setup and everyone else is waiting on it.

Then we have the flags, and there are exactly two of them to know about, no cap:

  • If FIDO_DEBUG is set in flags, then libfido2 will emit debug output on stderr. That's your "tell me everything, I want the tea" mode πŸ«–. And as an alternative β€” a little choose-your-own-adventure β€” the FIDO_DEBUG environment variable may be set instead.
  • If FIDO_DISABLE_U2F_FALLBACK is set in flags, then libfido2 will not fallback to U2F in fido_dev_open(3) when a device claims to support FIDO2 but then fails to respond to a CTAP 2.0 greeting. Basically: the device said "yes I'm FIDO2 certified πŸ’" and then ghosted πŸ‘», and this flag is you saying "we're not doing the U2F backup plan, I don't play that game."

And then fido_set_log_handler() πŸ’– β€” this one causes handler to be called for each log line generated in the context of the executing thread. Yes bestie, your very own callback, eating log lines one by one. Two lil' details you need to know and they both matter:

  • the lines passed to handler include a trailing newline character, so don't go adding another one, she's already dressed ✨
  • those lines are not printed by libfido2 on stderr β€” once you take the logs, they're yours, the library is not double-dipping πŸ™…β€β™€οΈ

πŸ‘‘ SEE ALSO πŸ‘‘

Go read these next, they're the friend group: fido_assert_new(3), fido_cred_new(3), fido_dev_info_manifest(3), fido_dev_open(3) 🌈


that's the whole page, and honestly? iconic. no notes. πŸ’œ

This one came from Debian, dated May 25, 2018, and the page is FIDO_INIT(3). go init ur library bestie, ily, mwah πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from