gnutls_dh_get_group(3)
π gnutls_dh_get_group β bestie, let's go get that group π
okay so this is one of the gnutls girlies, aka the API function gnutls_dh_get_group. it's giving "i need the receipts on our last Diffie-Hellman moment" β¨
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
int gnutls_dh_get_group(gnutls_session_t session, gnutls_datum_t *
raw_gen, gnutls_datum_t * raw_prime);
like literally that's the whole call. three little arguments and she's ready π
π¦ ARGUMENTS π¦
gnutls_session_t sessionβ bestie, this is a gnutls session. the actual session. the one you've been yapping with the peer on. no session, no group, no nothing πgnutls_datum_t * raw_genβ this is where the generator is gonna live. she'll hold it for you π«Άgnutls_datum_t * raw_primeβ and this one will hold the prime. the big one. the iconic one π
β¨ DESCRIPTION β¨
so what does she actually DO? this function returns the group parameters that were used in the last Diffie-Hellman key exchange with the peer. that's the prime and the generator, both of them, handed to you. no cap. π₯
and listen β this works for both anonymous and ephemeral Diffie-Hellman. so whichever flavor of DH you were doing, she's got you. π§
β οΈ the output parameters must be freed with gnutls_free(). do not forget this. not me letting you leak memory. free your data, bestie, it's self care π
also, heads up: the prime and generator come out as non-negative integers, and they may include a leading zero byte. so don't be shook when you see it. that's just how she is. π
π RETURNS π
on success you get GNUTLS_E_SUCCESS (which is 0, iconic), otherwise you get an error code back. if it's not a zero, something went sideways and you should look at that error code fr fr π
π REPORTING BUGS π
found a bug? spill it to <bugs@gnutls.org>. they want to know. π
home page is right here: https://www.gnutls.org β go say hi β¨
π 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. so like, go off, just keep the receipts π«Ά
π 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/
that's the spot. iykyk π
and that's the whole page, bestie!! this one's from gnutls 3.8.13, gnutls_dh_get_group(3), and she ate. go free your datums and stay hydrated πβ¨
π¦ 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