gnutls_record_send2(3)

πŸ’– gnutls_record_send2(3) πŸ’–

okay bestie, welcome to the gnutls manual page for gnutls_record_send2. yes it's the sequel. and yes, it ate. πŸŽ€


✨ NAME ✨

gnutls_record_send2 β€” literally just an API function, that's it, that's the name πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

ssize_t gnutls_record_send2(gnutls_session_t session, const void * data,
       size_t data_size, size_t pad, unsigned flags);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_session_t session β€” bestie this is a gnutls_session_t type. the whole vibe of your connection lives here.
  • const void * data β€” contains the data to send. the actual payload, the main character of this whole function fr.
  • size_t data_size β€” is the length of the data. how much of that data we're actually shipping out πŸ“¦
  • size_t pad β€” padding to be added to the record. yes, extra filler bytes, on purpose, we'll explain below.
  • unsigned flags β€” must be zero. not "should be", not "ideally" β€” must be zero. don't try it. 🚫

🌈 DESCRIPTION 🌈

okay so this function is identical to gnutls_record_send() β€” same energy, same job β€” except it takes an extra argument that lets you specify padding to be added to the record. that's the whole glow-up. ✨

to figure out the maximum size of padding you can use, hit up gnutls_record_get_max_size() and gnutls_record_overhead_size(). those two will tell you what you're working with.

🫢 heads up: in order for GnuTLS to provide constant time processing of padding and data in TLS1.3, the flag GNUTLS_SAFE_PADDING_CHECK must be used in gnutls_init(). no cap, this one matters.

⭐ RETURNS ⭐

the number of bytes sent, or a negative error code. 😭

and listen β€” the number of bytes sent might be less than data_size. so don't just assume it all went out in one go, okay?

the maximum number of bytes this function can send in a single call depends on the negotiated maximum record size. so it's giving... situational. it depends. πŸ’€


πŸŽ€ SINCE πŸŽ€

3.6.3 β€” been around since then, iconic behavior honestly πŸ‘‘


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? report it to bugs@gnutls.org. they wanna hear about it fr fr.

home page: https://www.gnutls.org


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/

and that's the whole page, bestie!! this was written for the gnutls manual, version 3.8.13 β€” stay safe out there, keep your flags at zero, and remember: padding is not a personality trait, it's a security feature πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from