gnutls_record_get_state(3)

πŸ’– gnutls_record_get_state β€” the manual page, but make it make sense πŸ’–

okay bestie, this one's from the gnutls manual (section 3, the library-calls girlies), and it's all about grabbing the current record state so you can hand it off to some other lil machine. let's go 🫢


✨ NAME ✨

gnutls_record_get_state β€” literally just an API function, that's the whole name, no notes πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_record_get_state(gnutls_session_t session, unsigned read,
gnutls_datum_t * mac_key, gnutls_datum_t * IV, gnutls_datum_t *
cipher_key, unsigned char [8] seq_number);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” it's a gnutls_session_t type, bestie. the session. the main character. 🌟
  • unsigned read β€” if this is non-zero you get the read parameters back, otherwise you get the write ones. pick your fighter πŸ’…
  • gnutls_datum_t * mac_key β€” the key used for MAC (only if a MAC is actually used, so like, don't be shocked if it's giving nothing) πŸ”
  • gnutls_datum_t * IV β€” the initialization vector or nonce that's in use ✨
  • gnutls_datum_t * cipher_key β€” the cipher key, periodt πŸ”‘
  • unsigned char [8] seq_number β€” a 64-bit sequence number, exactly 8 bytes of it, no more no less πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function returns the parameters of the current record state. and honestly? these are only useful when you're feeding them to an external off-loading device or subsystem β€” like if some other chip is doing the crypto for you and you're just the messenger 🧚

the returned values should be considered constant and valid for the lifetime of the session. so don't go editing them, don't go expecting them to change, they're set. iconic behaviour tbh.

in that case (the off-loading one, iykyk), to sync the state back you must call gnutls_record_set_state(). mandatory. no skipping. it's giving two-step dance and you need both steps πŸ•Ί


⭐ RETURNS ⭐

GNUTLS_E_SUCCESS on success, or an error code if the universe said no 😭

since 3.4.0 β€” so this has been around a minute, it's not new new πŸ’œ

πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? tell the girlies at <bugs@gnutls.org>. they wanna know 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, but 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 gnutls_record_get_state(3) from the gnutls manual, version 3.8.13 πŸ’– mwah, go sync those states responsibly 🫢🌸

πŸ“¦ where this page comes from