gnutls_dh_set_prime_bits(3)
π gnutls_dh_set_prime_bits(3) π
okay bestie, sit down, we're doing a gnutls page from the gnutls manual (v3.8.13, she's giving vintage-but-current π
) and honestly? this one is short, deprecated, and a little dramatic. let's go π¦
β¨ NAME β¨
gnutls_dh_set_prime_bits β the API function that sets your DH prime size, no cap πΈ
π SYNOPSIS π
#include <gnutls/gnutls.h>
void gnutls_dh_set_prime_bits(gnutls_session_t session, unsigned int bits);
like, look at her. two arguments. returns nothing. zero drama in the signature, maximum drama in the DESCRIPTION π«Ά
π§ ARGUMENTS π§
gnutls_session_t sessionβ bestie this is agnutls_session_ttype. that's it, that's the whole vibe.unsigned int bitsβ and this one? this is the number of bits β
π DESCRIPTION π
so here's the tea β β this function sets the number of bits, for use in a Diffie-Hellman key exchange. it's used both in DH ephemeral and DH anonymous cipher suites, which is lowkey iconic of it. what it actually does is set the minimum size of the prime that's gonna be used for the handshake.
on the client side it sets the minimum accepted number of bits. so if a server sends a prime with fewer bits than that? boom, GNUTLS_E_DH_PRIME_UNACCEPTABLE gets returned by the handshake. not me getting rejected by a handshake π
heads up: this function will warn via the audit log for values that are believed to be weak. so if you're out here choosing tiny numbers, the audit log is gonna side-eye you and say something π«£
and on the server side? the function has no effect. literally nothing. it's giving decorative. π
now the big one, and I need you to actually read this part bestie:
since 3.1.7 this function is deprecated. the minimum number of bits is set by the priority string level instead. also β and this is important β this function must be called after gnutls_priority_set_direct(), or the value you set may be overridden by the selected priority options. periodt.
π€ REPORTING BUGS π€
found a bug? don't suffer in silence, tell the people:
- 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. slay, honestly π«Ά
π 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, we ate and left no crumbs β¨ this was gnutls version 3.8.13 doing the absolute most for gnutls_dh_set_prime_bits(3) β mwah, bye πππ¦
π¦ 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