gnutls_certificate_set_dh_params(3)

πŸ’… gnutls_certificate_set_dh_params(3) πŸ’…

okay bestie, welcome to the gnutls manual, specifically the page for gnutls_certificate_set_dh_params(3). it's an API function and it's giving "short but important", so let's get into it 🫢


✨ NAME ✨

gnutls_certificate_set_dh_params β€” it's an API function, bestie. that's the whole name. no notes. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/gnutls.h>

void gnutls_certificate_set_dh_params(gnutls_certificate_credentials_t
res, gnutls_dh_params_t dh_params);

like, it's a void function, so it doesn't hand you anything back. it just does the thing. very "no thoughts, just vibes" of it honestly ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_certificate_credentials_t res β€” this one is a gnutls_certificate_credentials_t type. it's the credentials handle you're blessing with these parameters πŸ’–
  • gnutls_dh_params_t dh_params β€” the Diffie-Hellman parameters. the actual DH lore. 🌸

πŸ’œ DESCRIPTION πŸ’œ

so what does this even do? this function sets the Diffie-Hellman parameters for a certificate server to use. those parameters get used in Ephemeral Diffie-Hellman cipher suites. iconic behavior, truly. πŸ‘‘

but okay, listen, this part matters and i need you to actually read it:

Note that only a pointer to the parameters is stored in the certificate handle. so you must not deallocate the parameters before the certificate is deallocated. like, do NOT free that thing early, bestie, i am begging 😭 that's a whole use-after-free situation and we do not claim that energy.

πŸ’€ DEPRECATED πŸ’€

yeah so... this function is unnecessary and discouraged on GnuTLS 3.6.0 or later. it's giving legacy. πŸ™ˆ

since 3.6.0, DH parameters are negotiated following RFC7919. so if you're on a newer GnuTLS, this whole function is basically a "thanks, but no thanks" situation. periodt. πŸ’…


πŸ› REPORTING BUGS πŸ›

found a bug? don't be shy, tell the gnutls girlies:


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.

(translation: share it, remix it, just keep the receipts. that's the license, bestie, it's very generous of them 🫢)


πŸ‘€ 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!! you made it to the end, i'm so proud of you πŸ₯Ή this was gnutls 3.8.13, from the gnutls manual set, and honestly? she ate. go read the Texinfo manual if you want the full saga. mwah πŸ’‹βœ¨πŸ’–

πŸ“¦ where this page comes from