FIDO_DEV_GET_PUAT(3)
π FIDO_DEV_GET_PUAT π
okay so bestie, we're in fido_dev_get_puat(3) territory β that's the Library Functions Manual, section 3, and it's literally all about FIDO2 PIN/UV Auth token management. like, the four functions that handle your token era. no cap. π
β¨ NAME β¨
fido_dev_get_puat, fido_dev_set_puat, fido_dev_puat_ptr, fido_dev_puat_len β the FIDO2 PIN/UV Auth token management functions. that's the whole squad. π«Ά
πΈ SYNOPSIS πΈ
#include <fido.h>
int
fido_dev_get_puat(fido_dev_t *dev, unsigned int perm, const char *rpid,
const char *pin);
int
fido_dev_set_puat(fido_dev_t *dev, const unsigned char *ptr,
size_t len);
const unsigned char *
fido_dev_puat_ptr(const fido_dev_t *dev);
size_t
fido_dev_puat_len(const fido_dev_t *dev);
π¦ DESCRIPTION π¦
okay so first up, fido_dev_get_puat() negotiates a FIDO2 PIN/UV Auth token with the permission bitmask you pass in perm, and then associates it with dev. matching them up fr fr. π
here's the tea on the args:
- if perm does not require you to specify a relying party ID, then rpid can be
NULL. easy. - but if it does need one, rpid has to point to a NUL-terminated UTF-8 string. non-negotiable.
- if a PIN isn't needed to authenticate against dev, then pin can be
NULL. - otherwise pin must point to a NUL-terminated UTF-8 string.
and the supported flags for perm are, in order:
FIDO_PUAT_MAKECREDβ permission forfido_dev_make_cred(). an rpid is required.FIDO_PUAT_GETASSERTβ permission forfido_dev_get_assert(). an rpid is required.FIDO_PUAT_CREDMANβ permission for the credential management API. an rpid is optional.FIDO_PUAT_BIOENROLLβ permission for the biometric enrollment API. the rpid is ignored.FIDO_PUAT_LARGEBLOBβ permission for the large blobs API. the rpid is ignored.FIDO_PUAT_CONFIGβ permission for the authenticator config API. the rpid is ignored.FIDO_PUAT_CREDMAN_ROβ persistent read-only permission for the credential management API. the rpid is ignored.
fido_dev_set_puat() is your girl for associating a token you retrieved out-of-band with dev. and listen β no references to ptr are kept. like, none. it does not hold onto your pointer, bestie. π
if ptr is NULL, or len is zero, the token gets cleared from dev. bye bye token. π
fido_dev_puat_ptr() returns a pointer to the PIN/UV Auth token currently associated with dev. and the matching length? you get that by calling fido_dev_puat_len(). they're a duo. π
π why even associate a token tho
associating a token with dev has one main glow-up benefit: it reduces user interaction to a minimum in a sequence of operations where each one would otherwise demand some form of UV. iconic behaviour, honestly.
likewise β if multiple operations in a sequence need to be authenticated by a PIN, using a token avoids the need to cache the PIN for the duration of the whole sequence. so you're not out here storing your PIN the whole time. that's the vibe. β¨
β οΈ token precedence & validity (read this part pls)
once a token is associated with dev, it takes precedence over the regular PIN/UV Authentication for all operations that support the use of a token β until it's cleared from dev. periodt.
the validity of the token is determined by the authenticator. it may expire, and its permissions may be affected by its use. π
an invalid token is not automatically cleared from dev. so don't just assume it ghosted you β it's still there.
applications can call fido_dev_set_puat() or fido_dev_get_puat() to discard or obtain a new PIN/UV Auth token, and then retry the failed operation as appropriate. that's your recovery arc. π
for further details on token semantics, please refer to the FIDO Client to Authenticator Protocol (CTAP) standard. iykyk. π
π₯ RETURN VALUES π₯
- on success,
fido_dev_get_puat()andfido_dev_set_puat()returnFIDO_OK. slay. β - on error, a different error code defined in
<fido/err.h>is returned. check it, don't guess.
fido_dev_puat_ptr() may return NULL if there is no PIN/UV Auth token associated with dev. and if it's not NULL, the returned pointer is guaranteed to exist until either fido_dev_get_puat(), fido_dev_set_puat(), or fido_dev_free() is invoked. so like, don't go freeing stuff and then using that pointer. π
π SEE ALSO π
that's the whole page bestie, go forth and manage your tokens responsibly. πβ¨ππ¦πΈπ π«Ά
this came to you from Debian, dated April 8, 2026, living under the name FIDO_DEV_GET_PUAT(3) β mwah, take care of her. π
π¦ where this page comes from
- arch rolling: libfido2 1.17.0-1 Β· BSD-2-Clause
- nixpkgs unstable: libfido2 1.17.0
- ubuntu stonking: libfido2-doc 1.17.0-2build1 Β· BSD-2-Clause
- π the page's license: BSD-2-Clause
- Copyright (c) 2026 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