FIDO_DEV_SET_PIN(3)
π fido_dev_set_pin(3) π
okay bestie, gather round, because this is the Library Functions Manual page for fido_dev_set_pin(3) and it's literally the FIDO2 device-management glow-up you've been waiting for. four functions, one page, zero boring vibes. let's go π¦
β¨ NAME β¨
fido_dev_set_pin, fido_dev_get_retry_count, fido_dev_get_uv_retry_count, fido_dev_reset β FIDO2 device management functions
likeβ¦ the whole squad. the PIN girlies, the retry-count girlies, and the reset icon. π
πΈ SYNOPSIS πΈ
#include <fido.h>
int
fido_dev_set_pin(fido_dev_t *dev, const char *pin, const char *oldpin);
int
fido_dev_get_retry_count(fido_dev_t *dev, int *retries);
int
fido_dev_get_uv_retry_count(fido_dev_t *dev, int *retries);
int
fido_dev_reset(fido_dev_t *dev);
π DESCRIPTION π
fido_dev_set_pin() π
this one sets the PIN of device dev to pin, and pin is a NUL-terminated UTF-8 string β no cap, UTF-8 only, bestie. if oldpin is not NULL, then the device's PIN gets changed from oldpin to pin, where both pin and oldpin are NUL-terminated UTF-8 strings. it's giving "changing your password but make it a hardware key". π
fido_dev_get_retry_count() π’
this fills retries with the number of PIN retries left in dev before lock-out, where retries is an addressable pointer. yes, addressable β hand it a real pointer, not a vibe. β¨
fido_dev_get_uv_retry_count() ποΈ
same energy, different counter: this fills retries with the number of built-in UV retries left in dev before built-in UV is disabled, where retries is an addressable pointer. built-in UV said "i have a limit and i'm not afraid to use it". π
fido_dev_reset() π
this performs a reset on dev, which resets the device's PIN and erases credentials stored on the device. big red button energy. it's iconic but it does not play. π¨
not me reminding you again:fido_dev_set_pin(),fido_dev_get_retry_count(),fido_dev_get_uv_retry_count(), andfido_dev_reset()are synchronous and will block if necessary. they will simply wait. patiently. main character patience. π«Ά
β RETURN VALUES β
the error codes returned by fido_dev_set_pin(), fido_dev_get_retry_count(), fido_dev_get_uv_retry_count(), and fido_dev_reset() are defined in <fido/err.h>. on success, FIDO_OK is returned. that's the slay outcome. β
π¦ SEE ALSO π¦
iykyk. go read that one next, bestie. π
π CAVEATS π
okay this is the important part, so listen up fr fr.
regarding fido_dev_reset(): the actual user-flow to perform a reset is outside the scope of the FIDO2 specification, and may therefore vary depending on the authenticator. so likeβ¦ every key does its own little dance. no universal choreography. π
Yubico authenticators specifically will return FIDO_ERR_NOT_ALLOWED if a reset is issued later than 5 seconds after power-up, and FIDO_ERR_ACTION_TIMEOUT if the user fails to confirm the reset by touching the key within 30 seconds. so you've got 5 seconds to ask nicely and 30 seconds to actually touch the thing. no pressure, but alsoβ¦ pressure. β±οΈπ
and that's the whole page, bestie!! written by the Debian crew, dated May 25, 2018, and shipped in the Library Functions Manual β love that for them. 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