gnutls_session_set_premaster(3)

✨ gnutls_session_set_premaster β€” the manual page bestie πŸ’…

okay so this is a page from the gnutls manual, and honestly? it's giving "backstage pass to the TLS machine room." let's get into it πŸŽ€


🌸 NAME 🌸

gnutls_session_set_premaster β€” it's an API function, bestie. that's the whole name. iconic, brief, no notes. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/gnutls.h>

int gnutls_session_set_premaster(gnutls_session_t session, unsigned int
entity, gnutls_protocol_t version, gnutls_kx_algorithm_t kx,
gnutls_cipher_algorithm_t cipher, gnutls_mac_algorithm_t mac,
gnutls_compression_method_t comp, const gnutls_datum_t * master, const
gnutls_datum_t * session_id);

look at all those parameters. nine of them. she's high maintenance and she knows it πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • gnutls_session_t session β€” it's a gnutls_session_t type. yeah. that's the description. the session you're doing this whole thing to.
  • unsigned int entity β€” either GNUTLS_SERVER or GNUTLS_CLIENT. pick your side of the conversation, bestie.
  • gnutls_protocol_t version β€” the TLS protocol version. the era of the vibe.
  • gnutls_kx_algorithm_t kx β€” the key exchange method. how the secrets get traded.
  • gnutls_cipher_algorithm_t cipher β€” the cipher. the actual scrambling.
  • gnutls_mac_algorithm_t mac β€” the MAC algorithm. integrity check queen πŸ‘‘
  • gnutls_compression_method_t comp β€” the compression method, and listen: it is ignored. it's there for the aesthetic. we don't use it. it's decorative πŸŽ€
  • const gnutls_datum_t * master β€” the master key to use. the whole point of this function, lowkey.
  • const gnutls_datum_t * session_id β€” the session identifier. the little name tag your session wears.

πŸ”₯ DESCRIPTION πŸ”₯

okay so what this function does: it sets the premaster secret in a session. that's it. that's the job.

but here's the thing, and I need you to hear me on this one:

this is a function intended for exceptional uses. do NOT use this function unless you are implementing a legacy protocol. fr fr. I'm not playing.

if you're not out here building a legacy protocol, use gnutls_session_set_data() instead. she's the normal, well-adjusted option. go talk to her. 🫢


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise? you get an error code back, and it's giving "read the error, bestie." 😭


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? report it to <bugs@gnutls.org>. they wanna know. no cap.

home page: https://www.gnutls.org


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, that's a very chill license πŸ’–


🌈 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!! this one came from the gnutls manual, version 3.8.13, and it's the gnutls_session_set_premaster(3) page. go forth, implement your legacy protocol responsibly, and remember: don't touch the premaster unless you truly have to. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from