gnutls_store_commitment(3)

✨ gnutls_store_commitment(3) ✨

okay bestie, welcome to the gnutls manual πŸ’– this one's a lil function called gnutls_store_commitment and it's lowkey the bouncer at the club door of your trusted keys list. let's get into it 🫢


πŸŽ€ NAME πŸŽ€

gnutls_store_commitment β€” the API function that saves a hash commitment into your stored public keys πŸ—οΈβœ¨


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_store_commitment(const char * db_name, gnutls_tdb_t tdb,
const char * host, const char * service, gnutls_digest_algorithm_t
hash_algo, const gnutls_datum_t * hash, time_t expiration, unsigned int
flags);

like look at all those arguments, she's got range πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • const char * db_name β€” a file that specifies the stored keys. pass NULL if you wanna use the default, no stress πŸ’–
  • gnutls_tdb_t tdb β€” a storage structure, or NULL to just use the default one
  • const char * host β€” the peer's name, aka who we're talking about πŸ‘€
  • const char * service β€” non-NULL if this key is specific to a service (think http), otherwise leave it be
  • gnutls_digest_algorithm_t hash_algo β€” the hash algorithm type, pick your fave πŸŽ€
  • const gnutls_datum_t * hash β€” the raw hash, straight up, no filter
  • time_t expiration β€” the expiration time. use 0 to disable expiration entirely ⏰
  • unsigned int flags β€” should be 0 or GNUTLS_SCOMMIT_FLAG_ALLOW_BROKEN. that's it, those are the options, periodt

πŸ’œ DESCRIPTION πŸ’œ

so what does she actually do? this function will store the provided hash commitment to the list of stored public keys πŸ“ the key with the given hash will be considered valid until the provided expiration time. it's giving "you're on the list, you're good until closing time" πŸ•Ί

the tdb variable, if non-null, specifies a custom backend for the storage of entries. if it's NULL then the default file backend will be used. so basically you either bring your own storage or you get the house default, no in-between 🏠

⚠️ heads up bestie: note that this function is not thread safe with the default backend. like, do NOT let multiple threads fight over this at the same time, that's a whole mess πŸ’€

🌈 RETURNS 🌈

on success, GNUTLS_E_SUCCESS (0) is returned πŸŽ‰ otherwise you get a negative error value β€” which is the code equivalent of a sad trombone 😭


⭐ SINCE ⭐

3.0 β€” she's been around, an OG, an icon, a legend πŸ‘‘


πŸ’Œ REPORTING BUGS πŸ’Œ

found a bug? tell the devs, they wanna know fr fr:


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. slay, free software rights πŸ’–


πŸ”₯ 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, you ate it up πŸ“ this was gnutls version 3.8.13, page gnutls_store_commitment(3) β€” go forth and store those commitments, ily πŸ’œπŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from