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. passNULLif you wanna use the default, no stress πgnutls_tdb_t tdbβ a storage structure, orNULLto just use the default oneconst char * hostβ the peer's name, aka who we're talking about πconst char * serviceβ non-NULLif this key is specific to a service (thinkhttp), otherwise leave it begnutls_digest_algorithm_t hash_algoβ the hash algorithm type, pick your fave πconst gnutls_datum_t * hashβ the raw hash, straight up, no filtertime_t expirationβ the expiration time. use0to disable expiration entirely β°unsigned int flagsβ should be0orGNUTLS_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:
- report bugs to
<bugs@gnutls.org>π§ - home page:
https://www.gnutls.org
π COPYRIGHT π
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms