gnutls_srtp_get_keys(3)

✨ gnutls_srtp_get_keys(3) ✨

okay so bestie, welcome to the gnutls manual πŸ’– this one's all about gnutls_srtp_get_keys, and yes it's the SRTP key-material helper you've been looking for, no cap.


🌸 NAME 🌸

gnutls_srtp_get_keys β€” it's an API function, periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/gnutls.h>

int gnutls_srtp_get_keys(gnutls_session_t session, void * key_material,
unsigned int key_material_size, gnutls_datum_t * client_key,
gnutls_datum_t * client_salt, gnutls_datum_t * server_key,
gnutls_datum_t * server_salt);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie this is a gnutls_session_t type, that's the whole vibe 🌈
  • void * key_material β€” the space where the generated key material goes 🫢
  • unsigned int key_material_size β€” the maximum size of the key material, like the ceiling, the limit, the moment πŸ™ˆ
  • gnutls_datum_t * client_key β€” the master client write key, and it points inside the key material πŸ‘‘
  • gnutls_datum_t * client_salt β€” the master client write salt, also pointing inside the key material ✨
  • gnutls_datum_t * server_key β€” the master server write key, pointing inside the key material too πŸ’œ
  • gnutls_datum_t * server_salt β€” the master server write salt, yep, pointing inside the key material πŸ“

πŸ’– DESCRIPTION πŸ’–

so this is a lil helper function that generates the keying material for SRTP 🌸 it's giving "let me handle the keys for you" energy.

the way that it works: you gotta pre-allocate the space for the key material yourself. and it should be at least 2x the maximum key size and salt size β€” do not skimp on the buffer, bestie, that's the vibe check right there.

then client_key, client_salt, server_key and server_salt are convenience datums that point inside the key material. lowkey iconic. and plot twist: they may be NULL πŸ’…


⭐ RETURNS ⭐

on success, the size of the key material is returned πŸŽ‰ slay.

otherwise you get GNUTLS_E_SHORT_MEMORY_BUFFER if the buffer you gave is not sufficient (oof, not enough room 😭), or a negative error code.

since 3.1.4 β€” an OG, fr fr.

πŸ› REPORTING BUGS πŸ›

found a bug? don't be shy, report it to <bugs@gnutls.org> 🫢

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. (basically: be nice, 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 ✨ that was gnutls manual, version 3.8.13, for gnutls_srtp_get_keys(3) β€” go forth and generate that key material, you absolute main character πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from