gnutls_prf(3)
β¨ gnutls_prf β the glow-up edition β¨
okay bestie, buckle up, this one's from the gnutls manual, section 3 π
πΈ NAME πΈ
gnutls_prf β literally just an API function, no cap
π SYNOPSIS π
#include <gnutls/gnutls.h>
int gnutls_prf(gnutls_session_t session, size_t label_size, const char *
label, int server_random_first, size_t extra_size, const char * extra,
size_t outsize, char * out);
π¦ ARGUMENTS π¦
gnutls_session_t sessionβ it's agnutls_session_ttype, that's the whole vibe πsize_t label_sizeβ how long thelabelvariable isconst char * labelβ the label we use in the PRF computation, usually a lil short string πint server_random_firstβ non-zero if the server random field should be first in the seed πsize_t extra_sizeβ how long theextravariable isconst char * extraβ optional extra data to seed the PRF with, if you're feeling extra (which, same)size_t outsizeβ size of the pre-allocated output buffer that's gonna hold the outputchar * outβ pre-allocated buffer to hold the generated data, she's ready and waiting π«Ά
π DESCRIPTION π
So what this does is apply the TLS Pseudo-Random-Function (PRF) on the master secret and the data you handed it, seeded with the client and server random fields. For the key expansion specified in RFC5705, go look at gnutls_prf_rfc5705() instead, iykyk.
The label variable usually contains a string denoting the purpose for the generated data. The server_random_first tells you whether the client random field or the server random field should be first in the seed. Non-zero means the server random field is first, 0 means the client random field is first. Simple as.
The extra variable can be used to add more data to the seed, and it goes after the random variables. Use it to make sure the generated output is strongly connected to some additional data β like, say, a string used in user authentication. Cute, right? π
The output goes in out, which must be pre-allocated. No take-backs, no auto-allocating, she needs her buffer ready before you show up. π
β NOTE β
This function produces identical output to gnutls_prf_rfc5705() when server_random_first is set to 0 and extra is NULL. But under TLS1.3 this function will only operate when these conditions are true β otherwise it returns GNUTLS_E_INVALID_REQUEST. So like, respect the conditions or get told no π
π₯ RETURNS π₯
GNUTLS_E_SUCCESS on success, or an error code. That's it, that's the whole energy.
π REPORTING BUGS π
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.
π 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, mwah π β¨
this masterpiece comes to you courtesy of gnutls 3.8.13 β periodt, stay hydrated, go read your man pages ππ¦
π¦ 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