gnutls_record_send_range(3)

πŸ’– gnutls_record_send_range β€” the API function ✨

okay bestie, so this is a page from the gnutls manual, and it's all about gnutls_record_send_range(3). Sit down, hydrate, let's get into it 🫢


🌸 NAME 🌸

gnutls_record_send_range β€” it's an API function, periodt.


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

ssize_t gnutls_record_send_range(gnutls_session_t session, const void *
data, size_t data_size, const gnutls_range_st * range);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” it's a gnutls_session_t type, literally what it says on the tin πŸ’…
  • const void * data β€” this holds the data you wanna send, that's the whole vibe
  • size_t data_size β€” the length of that data, yes we're counting
  • const gnutls_range_st * range β€” the range of lengths that the real data length has to hide inside. like a little disguise for your byte count πŸ₯Έ

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea. This function works like gnutls_record_send() does β€” but β€” and this is the part that ate, honestly β€” while gnutls_record_send() only slaps minimal padding onto every TLS record, this one uses the TLS extra-padding feature to hide the actual real data size inside that range of lengths you handed it. length hiding, we love to see it 😌

⚠️ heads up though: some TLS sessions just do NOT support extra padding β€” think stream ciphers in standard TLS, or SSL3 sessions. so rude of them.

If you wanna know whether your current session supports extra padding (and therefore length hiding), go check the gnutls_record_can_use_length_hiding() function. iykyk 🌈


πŸ’€ NOTE πŸ’€

This function is currently limited to blocking sockets only. that's it. that's the note. don't come for me, i don't make the rules 🫠


πŸ‘‘ RETURNS πŸ‘‘

The number of bytes sent β€” which is, on a successful invocation, literally data_size β€” or a negative error code if it went sideways. no in-between, bestie.


πŸ“ REPORTING BUGS πŸ“

Found a bug? Tell the gnutls girlies about it:


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, that's the actual license text, i'm not paraphrasing legal stuff, i'm not reckless 😭)


🌈 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, go visit:

https://www.gnutls.org/manual/


gnutls 3.8.13 β€” that's the version and the source, and this lil page is gnutls_record_send_range(3). mwah, go forth and hide those lengths responsibly πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from