gnutls_psk_set...tials_function2(3)

✨ NAME ✨

gnutls_psk_set_client_credentials_function2 β€” it's an API function, bestie πŸ’– (this whole page lives in the gnutls manual, in case the header vibe didn't tip you off πŸ‘‘)


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

void
gnutls_psk_set_client_credentials_function2(gnutls_psk_client_credentials_t
cred, gnutls_psk_client_credentials_function2 * func);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_psk_client_credentials_t cred β€” okay so this one is a gnutls_psk_server_credentials_t type. yes fr, that's what it says, no cap πŸ™ˆ
  • gnutls_psk_client_credentials_function2 * func β€” this is the callback function, the little star of the show ⭐

πŸ’… DESCRIPTION πŸ’…

So this function is how you set a callback that goes and fetches the username and password for client PSK authentication. The callback's function form is literally:

int (*callback)(gnutls_session_t, gnutls_datum_t* username,
gnutls_datum_t* key);

This callback has the same semantics as the one from gnutls_psk_set_client_credentials_function(), except β€” and this is the glow-up β€” it lets you use non-string usernames. iconic behavior tbh πŸ¦‹

The username and key ->data must be allocated using gnutls_malloc(). Do not skip that part, I'm begging 😭

The username should be an ASCII string or a UTF-8 string. And if it's UTF-8, it's recommended that it follows the PRECIS framework for usernames (rfc8265) β€” iykyk ✨

The callback function will be called once per handshake. Once. That's it. That's the whole vibe.

The callback function should return 0 on success. Returning -1 indicates an error. πŸ’€

Not me reminding you again: gnutls_malloc() for username and key ->data. That's a hard requirement, not a suggestion, periodt. πŸ’…

🫢 REPORTING BUGS 🫢

Found a bug? Tell the gnutls girlies: report bugs to <bugs@gnutls.org>. 🌈

Home page: https://www.gnutls.org


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. (slay, very generous of them πŸ’œ)


🌟 SEE ALSO 🌟

The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/


okay that's the whole page bestie, go forth and authenticate 🧚

version 3.8.13 of the gnutls manual, page gnutls_psk_set...tials_function2(3) β€” signing off, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from