gnutls_dtls_cookie_send(3)
π gnutls_dtls_cookie_send(3) π
okay bestie, welcome to the gnutls manual, page for gnutls_dtls_cookie_send(3) β¨ this one's a whole vibe β it's the bouncer at the DTLS club door and she does NOT let just anybody in π«Ά
β¨ NAME β¨
gnutls_dtls_cookie_send β API function π
π SYNOPSIS π
#include <gnutls/dtls.h>
int gnutls_dtls_cookie_send(gnutls_datum_t * key, void * client_data,
size_t client_data_size, gnutls_dtls_prestate_st * prestate,
gnutls_transport_ptr_t ptr, gnutls_push_func push_func);
πΈ ARGUMENTS πΈ
gnutls_datum_t * keyβ bestie this is a random key, and it's the one doing the heavy lifting at cookie generation time πvoid * client_dataβ the data that tells you who the client is, like their address π (it's the client's identity, fr fr)size_t client_data_sizeβ the size of the client's data, literally just how big that thing is πgnutls_dtls_prestate_st * prestateβ the cookie you already got handed back fromgnutls_dtls_cookie_verify()πͺgnutls_transport_ptr_t ptrβ a transport pointer, andpush_funcis gonna use it to do its thing πgnutls_push_func push_funcβ the function that's gonna be used to reply, she's the one who talks back π£
π DESCRIPTION π
so here's the tea β this function is your anti-DoS armor. It's how you protect a DTLS server from denial of service attacks by making the client reply with a cookie that this function sent. Sneaky? No, iconic. π
The way that works: it makes sure that the client you allocated resources for (i.e. gnutls_session_t) is literally the same one the original incoming packet came from. no catfishing allowed π
ok and this part MATTERS: this function must be called at the very first incoming packet, prior to allocating any resources, and it must be followed up by gnutls_dtls_cookie_verify(). That's the order, periodt. Don't freestyle it π
β RETURNS β
the number of bytes sent π or a negative error code if things went sideways π
π¦ SINCE π¦
3.0 β she's been around, a true veteran π
π₯ REPORTING BUGS π₯
found a bug? tell the girlies:
- 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. π«Ά (yes bestie, keep the notice, it's the rules)
π 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, no cap π this was gnutls 3.8.13 talking, mwah, go protect your servers bestie πβ¨π
π¦ 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