FIDO_DEV_MAKE_CRED(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

πŸ’– NAME πŸ’–

fido_dev_make_cred β€” bestie, this is the one that generates a brand new credential on a FIDO2 device. like, literally makes a whole new identity key on your little hardware key. iconic behavior ✨


🌸 SYNOPSIS 🌸

#include <fido.h>

int
fido_dev_make_cred(fido_dev_t *dev, fido_cred_t *cred, const char *pin);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. fido_dev_make_cred() walks up to the FIDO2 device that dev is representing and is like "hey babe, make me a new credential pls" β€” and it builds it according to all these parameters that live inside cred:

  • type;
  • client data hash;
  • relying party;
  • user attributes;
  • list of excluded credential IDs;
  • resident/discoverable key and user verification attributes.

ngl if you wanna know how all those values get set in the first place, go read fido_cred_set_authdata(3) β€” that's the lore. πŸ“–

Now about that PIN situation 🫢 β€” if a PIN is not needed to authenticate the request against dev, then pin can just be NULL, no stress, she's fine. But if a PIN is needed, then pin must point to a NUL-terminated UTF-8 string. like it's not optional at that point, bestie, it's giving mandatory. πŸ’…

After a successful call to fido_dev_make_cred(), you can hit up fido_cred_authdata_ptr(3), fido_cred_pubkey_ptr(3), fido_cred_x5c_ptr(3), and fido_cred_sig_ptr(3) on cred to scoop out all the different parts of the credential that just got generated. it's like opening a lil gift box of cryptographic goodness πŸŽ€βœ¨

⚠️ heads up girlypop: fido_dev_make_cred() is synchronous β€” she will block if necessary. so don't be out here acting surprised when your thread just. sits there. waiting. she said "i'll get there when i get there" 😭

πŸ‘‘ RETURN VALUES πŸ‘‘

the error codes that fido_dev_make_cred() hands back are defined in <fido/err.h>. and on success? you get FIDO_OK. that's the good ending fr fr πŸ“


🌈 SEE ALSO 🌈


and that's the whole page bestie, no cap πŸ’œ β€” this one came from Debian, dated May 23, 2018, and it lives under the name FIDO_DEV_MAKE_CRED(3). go make some credentials, you got this 🧚✨

πŸ“¦ where this page comes from