gnutls_tdb_set_verify_func(3)

πŸ’– gnutls_tdb_set_verify_func(3) πŸ’–

okay bestie, welcome to the gnutls manual, page gnutls_tdb_set_verify_func(3). sit down, hydrate, and let's get into it 🫢


✨ NAME ✨

gnutls_tdb_set_verify_func β€” API function. that's it, that's the name, short and iconic πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

void gnutls_tdb_set_verify_func(gnutls_tdb_t tdb, gnutls_tdb_verify_func verify);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_tdb_t tdb β€” the trust storage. yes, the whole vibe holder πŸ—„οΈ
  • gnutls_tdb_verify_func verify β€” the verification function. the little guy that does the actual checking ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this function does is, it associates a retrieval function with the trust storage structure. like, you're setting up the trust storage and telling it "hey, when you need to verify something, use this function, mwah πŸ’‹".

and the function you hand over has to be in this exact form:

int gnutls_tdb_verify_func(const char* db_name, const char* host, const char* service, const gnutls_datum_t* pubkey);

okay now listen closely because this part is important, no cap πŸ‘‘

your verify function should return:

  • zero on a match πŸŽ‰
  • GNUTLS_E_CERTIFICATE_KEY_MISMATCH if there is a mismatch πŸ’€
  • any other negative error code otherwise

and bestie β€” the db_name is the one you use to pass any private data to this function. that's literally its whole job. iykyk πŸ™ˆ


😭 REPORTING BUGS 😭

found a bug? don't suffer in silence, tell the devs:


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


ngl, if you read all of that, you're genuinely the main character. go set up your verify function, you ate πŸ“

and that's the whole page, bestie β€” brought to you by gnutls version 3.8.13, from the gnutls manual set 🧚 stay slaying, drink water, and may all your returns be zero on a match πŸ’œ

πŸ“¦ where this page comes from