FIDO_DEV_GET_TOUCH_BEGIN(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_GET_TOUCH_BEGIN β€” library functions manual, bestie edition πŸ’–

okay so this is the <fido_dev_get_touch_begin> / <fido_dev_get_touch_status> page from section 3 of the library functions manual, and honestly? it's giving "which finger do i tap, and which key" energy. let's get into it ✨

🌸 NAME 🌸

fido_dev_get_touch_begin, fido_dev_get_touch_status β€” asynchronously wait for touch on a FIDO2 authenticator πŸ«΅πŸ”‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <fido.h>

int
fido_dev_get_touch_begin(fido_dev_t *dev);

int
fido_dev_get_touch_status(fido_dev_t *dev, int *touched, int ms);

πŸ¦‹ DESCRIPTION πŸ¦‹

The functions on this page let an app asynchronously wait for a touch on a FIDO2 authenticator. asynchronously, meaning you're not just standing there staring at the key like πŸ‘οΈπŸ‘„πŸ‘οΈ β€” you start the vibe and then check in on it.

Why do you care? because when you've got multiple authenticators plugged in / nearby and your app needs to figure out which one the human actually touched, this is how you find out. it's the "whose turn is it" of the FIDO2 world πŸ’…

  • fido_dev_get_touch_begin() β€” kicks off a touch request on dev. that's it, that's the whole job. starts the request, no blocking, very main character of it.
  • fido_dev_get_touch_status() β€” continues an ongoing touch request on dev, and it will block for up to ms milliseconds while it waits. on success, touched gets updated to reflect where the touch request is at ✨
    • if touched is 1, bestie the device was touched β€” the touch request is now terminated. done. slayed. πŸŽ‰
    • if touched is 0, no touch yet, and the app may either call fido_dev_get_touch_status() again to keep the request rolling, or call fido_dev_cancel() to terminate it. your call, your journey 🌈

⭐ RETURN VALUES ⭐

The error codes that come back from fido_dev_get_touch_begin() and fido_dev_get_touch_status() are defined in <fido/err.h>. On success, you get FIDO_OK back, which is the little green checkmark moment we all deserve 🫢


🌈 EXAMPLES 🌈

Please refer to examples/select.c in libfido2's source tree. go look, it's right there, i promise πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’€ CAVEATS πŸ’€

not me dropping the important part at the bottom: fido_dev_get_touch_status() will cause a command to be transmitted to U2F authenticators. Those transmissions should not exceed a frequency of 5Hz. fr fr, do not spam your U2F key. it's not that kind of relationship 😭

and that's the page!! brought to you by the Debian crew, dated August 5, 2020 β€” ty for coming to my ted talk, now go touch some hardware πŸ’…βœ¨

πŸ“¦ where this page comes from