FIDO_DEV_OPEN(3)
π FIDO_DEV_OPEN(3) β Library Functions Manual π
okay bestie, gather round, because today we're talking about fido_dev_open(3) and its whole entourage of device-handling functions β this is from the Library Functions Manual, and honestly? it's giving "backstage pass to your security key." π
β¨ NAME β¨
Here's the full squad, no one gets left out, periodt:
fido_dev_open, fido_dev_open_with_info, fido_dev_close, fido_dev_cancel, fido_dev_new, fido_dev_new_with_info, fido_dev_free, fido_dev_force_fido2, fido_dev_force_u2f, fido_dev_is_fido2, fido_dev_is_winhello, fido_dev_supports_credman, fido_dev_supports_cred_prot, fido_dev_supports_permissions, fido_dev_supports_pin, fido_dev_supports_uv, fido_dev_has_pin, fido_dev_has_uv, fido_dev_protocol, fido_dev_build, fido_dev_flags, fido_dev_major, fido_dev_minor
β which is a very long way of saying: FIDO2 device open/close and related functions. π
πΈ SYNOPSIS πΈ
first things first, you gotta include the header, bestie:
#include <fido.h>
then here's every single one of these cuties, verbatim, because I do not play with signatures:
int
fido_dev_open(fido_dev_t *dev, const char *path);
int
fido_dev_open_with_info(fido_dev_t *dev);
int
fido_dev_close(fido_dev_t *dev);
int
fido_dev_cancel(fido_dev_t *dev);
fido_dev_t *
fido_dev_new(void);
fido_dev_t *
fido_dev_new_with_info(const fido_dev_info_t *);
void
fido_dev_free(fido_dev_t **dev_p);
void
fido_dev_force_fido2(fido_dev_t *dev);
void
fido_dev_force_u2f(fido_dev_t *dev);
bool
fido_dev_is_fido2(const fido_dev_t *dev);
bool
fido_dev_is_winhello(const fido_dev_t *dev);
bool
fido_dev_supports_credman(const fido_dev_t *dev);
bool
fido_dev_supports_cred_prot(const fido_dev_t *dev);
bool
fido_dev_supports_permissions(const fido_dev_t *dev);
bool
fido_dev_supports_pin(const fido_dev_t *dev);
bool
fido_dev_supports_uv(const fido_dev_t *dev);
bool
fido_dev_has_pin(const fido_dev_t *dev);
bool
fido_dev_has_uv(const fido_dev_t *dev);
uint8_t
fido_dev_protocol(const fido_dev_t *dev);
uint8_t
fido_dev_build(const fido_dev_t *dev);
uint8_t
fido_dev_flags(const fido_dev_t *dev);
uint8_t
fido_dev_major(const fido_dev_t *dev);
uint8_t
fido_dev_minor(const fido_dev_t *dev);
π DESCRIPTION π
okay so, deep breath, let's go function by function because there are a lot of them and every single one matters.
The fido_dev_open() function opens the device pointed to by path, where dev is a freshly allocated or otherwise closed fido_dev_t. If dev claims to be FIDO2, libfido2 will attempt to speak FIDO2 to dev. If that fails, libfido2 will fallback to U2F unless the FIDO_DISABLE_U2F_FALLBACK flag was set in fido_init(3). π¦
The fido_dev_open_with_info() function opens dev as previously allocated using fido_dev_new_with_info().
The fido_dev_close() function closes the device represented by dev. If dev is already closed, fido_dev_close() is a NOP β like, it literally just shrugs and moves on. π
The fido_dev_cancel() function cancels any pending requests on dev. no more waiting around, bestie.
The fido_dev_new() function returns a pointer to a newly allocated, empty fido_dev_t. If memory cannot be allocated, NULL is returned. π
The fido_dev_new_with_info() function returns a pointer to a newly allocated fido_dev_t with fido_dev_info_t parameters, for use with fido_dev_info_manifest(3) and fido_dev_open_with_info(). If memory cannot be allocated, NULL is returned. π
The fido_dev_free() function releases the memory backing *dev_p, where *dev_p must have been previously allocated by fido_dev_new(). On return, *dev_p is set to NULL. Either dev_p or *dev_p* may be NULL, in which case fido_dev_free() is a NOP. β¨
The fido_dev_force_fido2() function can be used to force CTAP2 communication with dev, where dev is an open device.
The fido_dev_force_u2f() function can be used to force CTAP1 (U2F) communication with dev, where dev is an open device.
The fido_dev_is_fido2() function returns true if dev is a FIDO2 device. π
The fido_dev_is_winhello() function returns true if dev is a Windows Hello device. πͺ
The fido_dev_supports_credman() function returns true if dev supports CTAP 2.1 Credential Management.
The fido_dev_supports_cred_prot() function returns true if dev supports CTAP 2.1 Credential Protection.
The fido_dev_supports_permissions() function returns true if dev supports CTAP 2.1 UV token permissions.
The fido_dev_supports_pin() function returns true if dev supports CTAP 2.0 Client PINs. π
The fido_dev_supports_uv() function returns true if dev supports a built-in user verification method.
The fido_dev_has_pin() function returns true if dev has a CTAP 2.0 Client PIN set.
The fido_dev_has_uv() function returns true if dev supports built-in user verification and its user verification feature is configured. (yes, both. it's an and situation. π)
The fido_dev_protocol() function returns the CTAPHID protocol version identifier of dev.
The fido_dev_build() function returns the CTAPHID build version number of dev.
The fido_dev_flags() function returns the CTAPHID capabilities flags of dev.
The fido_dev_major() function returns the CTAPHID major version number of dev.
The fido_dev_minor() function returns the CTAPHID minor version number of dev.
For the format and meaning of the CTAPHID parameters returned by the functions above, please refer to the FIDO Client to Authenticator Protocol (CTAP) specification. π iykyk.
π RETURN VALUES π
On success, fido_dev_open(), fido_dev_open_with_info(), and fido_dev_close() return FIDO_OK. π
On error, a different error code defined in <fido/err.h> is returned. so like, check your header, bestie, don't guess. π
note: those are the only three with documented return values here β the rest of the squad returnsvoid,bool, oruint8_tas shown up in the synopsis. π
π«Ά SEE ALSO π«Ά
and that's the whole thing, bestie!! this page came from Debian, dated May 25, 2018 β go forth and open some devices, you absolute icon. πβ¨π
π¦ 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