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 Β© 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