gnutls_psk_server_get_username2(3)
π gnutls_psk_server_get_username2(3) π
okay bestie, so this one lives in the gnutls manual (yes, that gnutls, the TLS library, we're being β¨secureβ¨ today), and it's genuinely such a handy little function, you're gonna love her.
πΈ NAME πΈ
gnutls_psk_server_get_username2 β it's an API function, and it's the one you call when you're the server and you wanna know who just showed up with a PSK π
β¨ SYNOPSIS β¨
#include <gnutls/gnutls.h>
int gnutls_psk_server_get_username2(gnutls_session_t session,
gnutls_datum_t * username);
π ARGUMENTS π
gnutls_session_t sessionβ it's a gnutls session, babe. that's the whole vibe. it's the session you're asking about.gnutls_datum_t * usernameβ a datum that this function is gonna fill in for you. you hand it over empty, she hands it back with the goods π«Ά
π¦ DESCRIPTION π¦
So here's the tea: this function returns a pointer to the username of the peer, tucked into the datum you supplied. And no, it does not need to be null-terminated β do not come for her about that, she's fine as she is π
Heads up bestie: you should only call this in case of PSK authentication, and only in case of a server. Like, if you're the client, this is not your moment. Read the room π«
Also important, and I need you to hear me on this one: the returned pointer should be considered constant β as in do not free it β and it stays valid for the lifetime of the session. So don't you dare free() her, she's not yours to free, she's a guest in the session's house π β¨
β RETURNS β
You get GNUTLS_E_SUCCESS when everything slays, or a negative value in case of an error. Negative = bad vibes = go check your error handling, fr fr π
π REPORTING BUGS π
Found something cursed? Report bugs to <bugs@gnutls.org>.
Home page: https://www.gnutls.org
(they actually wanna hear about it, no gatekeeping π₯)
π 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. periodt. π
π 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, you ate that π this was gnutls version 3.8.13, and like every good group chat, this manual page is signed off with love and also with the exact same name it came in with β gnutls_psk_server_get_username2(3). 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