gnutls_psk_server_get_username(3)
π gnutls_psk_server_get_username(3) π
okay bestie, so this one lives in the gnutls manual, and it's giving "who even are you, mysterious PSK peer" energy. Let's get into it π«Ά
β¨ NAME β¨
gnutls_psk_server_get_username β literally just an API function, no biggie, but it's the one that tells you who's on the other end of a PSK handshake π
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
const char * gnutls_psk_server_get_username(gnutls_session_t session);
look at that signature. clean. iconic. const char * and everything π
π¦ ARGUMENTS π¦
gnutls_session_t sessionβ bestie, this is a gnutls session. that's it, that's the whole argument π
β¨ DESCRIPTION β¨
okay so listen π β you should only call this in case of PSK authentication, and only when you're the server. like, don't just be out here calling it whenever, it's not for that, no cap.
the pointer you get back? treat it as constant. do not free it, i'm so serious π. it stays valid for the lifetime of the session, so just vibe with it and don't touch.
and here's the plot twist π β this function will return NULL if the username has embedded NULL bytes. yeah. awkward. in that case you gotta use gnutls_psk_server_get_username2() instead to actually retrieve the username. that one's built different, it handles it. iykyk.
β RETURNS β
the username of the peer π«Ά β or NULL if there's an error, or if the username has embedded NULLs. so if you get NULL, don't panic, just check why π
π REPORTING BUGS π
found a bug? not me gatekeeping that info β report it 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. so basically, go off, just keep the receipts π§
π 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/
and that's the whole page, bestie π this was gnutls 3.8.13, gnutls_psk_server_get_username(3), signing off β stay constant, don't free, and always check for embedded NULLs πβ¨π
π¦ 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