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 agnutls_psk_server_credentials_ttype. 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()forusernameandkey->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 π
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms