FIDO_DEV_SET_PIN(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_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(), and fido_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