FIDO_DEV_INFO_MANIFEST(3)
π FIDO_DEV_INFO_MANIFEST β the FIDO2 device discovery functions, bestie edition π
okay so this is the FIDO_DEV_INFO_MANIFEST(3) page from the Library Functions Manual, and it's literally all about finding your FIDO2 devices and poking at their little info cards. sit down, grab a boba, we're doing this π§β¨
β¨ NAME β¨
fido_dev_info_manifest, fido_dev_info_new, fido_dev_info_free, fido_dev_info_ptr, fido_dev_info_path, fido_dev_info_product, fido_dev_info_vendor, fido_dev_info_manufacturer_string, fido_dev_info_product_string, fido_dev_info_set β FIDO2 device discovery functions π¦
like. the whole friend group. all ten of them. slay.
πΈ SYNOPSIS πΈ
#include <fido.h>
int
fido_dev_info_manifest(fido_dev_info_t *devlist, size_t ilen,
size_t *olen);
fido_dev_info_t *
fido_dev_info_new(size_t n);
void
fido_dev_info_free(fido_dev_info_t **devlist_p, size_t n);
const fido_dev_info_t *
fido_dev_info_ptr(const fido_dev_info_t *devlist, size_t i);
const char *
fido_dev_info_path(const fido_dev_info_t *di);
int16_t
fido_dev_info_product(const fido_dev_info_t *di);
int16_t
fido_dev_info_vendor(const fido_dev_info_t *di);
const char *
fido_dev_info_manufacturer_string(const fido_dev_info_t *di);
const char *
fido_dev_info_product_string(const fido_dev_info_t *di);
int
fido_dev_info_set(fido_dev_info_t *devlist, size_t i, const char *path,
const char *manufacturer, const char *product,
const fido_dev_io_t *io, const fido_dev_transport_t *transport);
π DESCRIPTION π
π finding devices: fido_dev_info_manifest()
okay so fido_dev_info_manifest() fills up devlist with up to ilen FIDO2 devices that the underlying operating system managed to find. and rn? only USB HID devices are supported. that's it. that's the roster. π
the number of discovered devices comes back in olen, and olen has to be an addressable pointer. no cap.
π making a list: fido_dev_info_new()
fido_dev_info_new() returns a pointer to a freshly allocated, empty device list with n available slots. and if memory isn't available? it returns NULL. tragic. π
π§Ή cleaning up: fido_dev_info_free()
fido_dev_info_free() releases the memory backing *devlist_p, where *devlist_p must have been previously allocated by fido_dev_info_new(). you also gotta hand over the number n of allocated slots. on return, *devlist_p gets set to NULL.
and here's the cute part: either devlist_p or *devlist_p may be NULL, and in that case fido_dev_info_free() is a NOP. it just... doesn't do anything. iconic, honestly. π«Ά
π¦ grabbing a slot: fido_dev_info_ptr()
fido_dev_info_ptr() returns a pointer to slot number i of devlist. and it is the caller's responsibility to ensure that i is bounded. that's on you, bestie. also pls note: the first slot has index 0. zero-indexed, as the universe intended. β¨
π the getters π
fido_dev_info_path()returns the filesystem path or subsystem-specific identification string ofdi.fido_dev_info_product()returns the product ID ofdi.fido_dev_info_vendor()returns the vendor ID ofdi.fido_dev_info_manufacturer_string()returns the manufacturer string ofdi. ifdidoes not have an associated manufacturer string,fido_dev_info_manufacturer_string()returns an empty string. (an empty string, not a sad littleNULL. she's polite.)fido_dev_info_product_string()returns the product string ofdi. and same vibe β ifdidoes not have an associated product string,fido_dev_info_product_string()returns an empty string.
π« the example
an example of how to use the functions described in this document can be found in the examples/manifest.c file shipped with libfido2. go read it, it's giving tutorial energy. π
π§ setting it up yourself: fido_dev_info_set()
fido_dev_info_set() initializes an entry in a device list allocated by fido_dev_info_new() with the specified path, manufacturer, and product strings, and with the specified I/O handlers and, optionally, transport functions, as described in fido_dev_set_io_functions(3).
the io argument must be specified; the transport argument may be NULL.
the path, I/O handlers, and transport functions will be used automatically by fido_dev_new_with_info(3) and fido_dev_open_with_info(3). so an application can use this, for example, to substitute mock FIDO2 devices in testing for the real ones that fido_dev_info_manifest() would discover. fake devices in the group chat. pretending. it's a bit of a moment. π
β RETURN VALUES β
fido_dev_info_manifest() always returns FIDO_OK. and if a discovery error occurs? the olen pointer is set to 0. that's your little signal. π¨
fido_dev_info_set() returns FIDO_OK on success. on error, a different error code defined in <fido/err.h> is returned. check the header, bestie.
and the pointers returned by fido_dev_info_ptr(), fido_dev_info_path(), fido_dev_info_manufacturer_string(), and fido_dev_info_product_string() are guaranteed to exist until fido_dev_info_free() is called on the corresponding device list. so like, don't free the list and then go poking at the pointers. that would be a vibe check you fail. π
friendly lil reminder: keep thatibounded, keep yourolenaddressable, and free your lists. main character energy requires memory hygiene. π
and that's the whole page, bestie!! this one came from the Debian build, dated March 30, 2022 π go manifest some devices, you're gonna do great. mwah. πβ¨π¦
π¦ where this page comes from
- alpine 3.22: libfido2-doc 1.16.0-r0 Β· BSD-2-Clause
- alpine 3.23: libfido2-doc 1.16.0-r2 Β· BSD-2-Clause
- alpine 3.24: libfido2-doc 1.16.0-r4 Β· BSD-2-Clause
- arch rolling: libfido2 1.17.0-1 Β· BSD-2-Clause
- centos-stream 10: libfido2-devel 1.14.0-7.el10 Β· BSD-2-Clause
- centos-stream 9: libfido2-devel 1.13.0-2.el9 Β· BSD
- centos-stream 9: libfido2-devel 1.13.0-2.el9 Β· BSD
- debian bookworm: libfido2-doc 1.12.0-2 Β· BSD-2-Clause
- debian trixie: libfido2-doc 1.15.0-1 Β· BSD-2-Clause
- fedora 43: libfido2-devel 1.16.0-3.fc43 Β· BSD-2-Clause
- fedora 43: libfido2-devel 1.16.0-3.fc43 Β· BSD-2-Clause
- fedora 44: libfido2-devel 1.16.0-5.fc44 Β· BSD-2-Clause
- fedora 44: libfido2-devel 1.16.0-5.fc44 Β· BSD-2-Clause
- nixos 26.05: fido2-manage 0-unstable-2025-06-06
- nixpkgs unstable: fido2-manage 0-unstable-2025-06-06
- nixpkgs unstable: libfido2 1.17.0
- opensuse-leap 16.0: libfido2-devel 1.15.0-160000.3.2 Β· BSD-2-Clause
- opensuse-leap 16.0: libfido2-devel 1.15.0-160000.3.2 Β· BSD-2-Clause
- opensuse-leap 16.0: libfido2-devel 1.15.0-160000.3.2 Β· BSD-2-Clause
- opensuse-leap 16.0: libfido2-devel 1.15.0-160000.3.2 Β· BSD-2-Clause
- ubuntu noble: libfido2-doc 1.14.0-1build3 Β· BSD-2-Clause
- ubuntu questing: libfido2-doc 1.16.0-2
- ubuntu resolute: libfido2-doc 1.16.0-2build1 Β· BSD-2-Clause
- ubuntu stonking: libfido2-doc 1.17.0-2build1 Β· BSD-2-Clause
- π the page's license: BSD-2-Clause
- Copyright (c) 2018 Yubico AB. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms