gnutls_prf_rfc5705(3)
β¨ gnutls_prf_rfc5705 β the glow-up edition β¨
okay so bestie, welcome to the gnutls_prf_rfc5705(3) page π this one lives in the gnutls manual, and it's literally the function you call when you want to ~export keying material~ out of a TLS/DTLS session and hand it to your app. no cap. let's get into it π«Ά
πΈ NAME πΈ
gnutls_prf_rfc5705 β API function. that's the whole vibe. it's giving "cryptographic key exporter, but make it RFC-compliant" π
π SYNOPSIS π
#include <gnutls/gnutls.h>
int gnutls_prf_rfc5705(gnutls_session_t session, size_t label_size,
const char * label, size_t context_size, const char * context, size_t
outsize, char * out);
yes queen, that's the whole signature, verbatim, don't @ me β¨
π¦ ARGUMENTS π¦
gnutls_session_t sessionβ this is agnutls_session_ttype. that's it, that's the argument. your actual live session, the main character πsize_t label_sizeβ the length of thelabelvariable. how many bytes of label are we working with, bestie πconst char * labelβ the label used in the PRF computation. typically a short string, like a lil nickname for what this data is for π·οΈsize_t context_sizeβ the length of the extra variable.context's byte count, fr frconst char * contextβ optional extra data to seed the PRF with. optional, but iconic when present πsize_t outsizeβ size of the pre-allocated output buffer that's gonna hold the output. you gotta tell it how much room there is π«char * outβ the pre-allocated buffer itself that holds the generated data. this is where the magic lands β¨
π DESCRIPTION π
So basically: this function exports keying material from a TLS/DTLS session to an application, exactly as specified in RFC5705. periodt.
In TLS versions prior to 1.3, it applies the TLS Pseudo-Random-Function (PRF) on the master secret and the provided data, seeded with the client and server random fields. classic behavior, lowkey nostalgic π
In TLS 1.3, it applies HKDF on the exporter master secret derived from the master secret. new era, new algorithm, still slaying π₯
The label variable usually contains a string denoting the purpose for the generated data β like a lil name tag for your bytes π·οΈ
The context variable can be used to add more data to the seed, after the random variables. It can be used to make sure the generated output is strongly connected to some additional data (e.g., a string used in user authentication). so like, bind that output to your auth flow, iykyk π
The output is placed in out, which must be pre-allocated. gnutls is not doing that for you, bestie, you gotta bring your own buffer π«Ά
β οΈ Note that, to provide the RFC5705 context, the context variable must be non-null. don't be out here passing null and expecting context magic, it's not happening π
π RETURNS π
GNUTLS_E_SUCCESS on success, or an error code. that's the whole deal β check your return value, always, no exceptions π
β SINCE β
3.4.4 β it's been here since 3.4.4, a whole legend π
π REPORTING BUGS π
Found a bug? Don't suffer in silence, 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.
(that's the license, and it's genuinely generous of them, we love to see it π«Ά)
π 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 page, bestie π this was gnutls version 3.8.13, dropping the gnutls_prf_rfc5705(3) knowledge straight into your terminal. go forth and export your keying material responsibly β¨ππ¦
π¦ 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