gnutls_ext_raw_parse(3)

✨ gnutls_ext_raw_parse ✨

okay bestie, gather round, because this one is from the gnutls manual and it's literally the API function called gnutls_ext_raw_parse. yes it's a mouthful, no we're not renaming it, it's iconic like that πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_ext_raw_parse(void * ctx, gnutls_ext_raw_process_func cb,
                         const gnutls_datum_t * data, unsigned int flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • void * ctx β€” a pointer that gets handed straight to the callback function. just vibes being passed along, no cap 🫢
  • gnutls_ext_raw_process_func cb β€” the callback function that processes every extension it finds. this is the main character of the operation, fr fr
  • const gnutls_datum_t * data β€” the TLS extension data. the raw material, the moment, the whole point πŸ’–
  • unsigned int flags β€” should be zero, or GNUTLS_EXT_RAW_FLAG_TLS_CLIENT_HELLO, or GNUTLS_EXT_RAW_FLAG_DTLS_CLIENT_HELLO

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this function does is it iterates through the TLS extensions exactly as they're passed in data, and it hands the individual extension data off to the callback. that's the whole arc, bestie ✨

the data has to conform to the Extension extensions<0..2^16-1> format β€” like, that's non-negotiable, it's giving structured data or nothing πŸ™ˆ

now, if flags is GNUTLS_EXT_RAW_TLS_FLAG_CLIENT_HELLO, then this function will parse the extension data from the position, as if the packet in data is a client hello (without record or handshake headers) β€” exactly as provided by gnutls_handshake_set_hook_function(). so yes, it's got that hook-up energy 😌

and listen: the return value of the callback will be propagated. whatever your callback says, this function says. it's loyal like that 🫢


⭐ RETURNS ⭐

  • GNUTLS_E_SUCCESS on success, or an error code. we love a win, but we also respect a graceful L πŸ’€
  • On unknown flags it returns GNUTLS_E_INVALID_REQUEST β€” so like, don't just make up flags, bestie, the vibe check will catch you πŸ‘‘

πŸ’œ SINCE πŸ’œ

3.6.3 β€” an elder, but a legend. it's giving vintage, it's giving classic 🌈


πŸ“ REPORTING BUGS πŸ“

found a bug? not me gatekeeping the feedback loop πŸ’…


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. like, share, remix, just keep the receipts, periodt ✨


🧚 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/

go read the whole thing, it's the extended universe, iykyk πŸ“š


and that's the page, bestie!! πŸŽ€ this was gnutls version 3.8.13, from the gnutls manual, and it's literally called gnutls_ext_raw_parse(3). slay, ate, no crumbs left. mwah πŸ’‹ 🌸✨
πŸ“¦ where this page comes from