GNUTLS_X509_TRUST_LIST_VERIFY_CRT2(3)

πŸ’– gnutls_x509_trust_list_verify_crt2 πŸ’–

okay bestie, pull up a chair πŸŽ€ this one lives in the gnutls manual, section 3, and it's the moment where you actually get to check whether a certificate chain is legit or a whole mess. no cap.


✨ NAME ✨

gnutls_x509_trust_list_verify_crt2 β€” API function

like, that's the whole name. it verifies stuff. we love a descriptive queen πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/x509.h>

int gnutls_x509_trust_list_verify_crt2(gnutls_x509_trust_list_t list,
gnutls_x509_crt_t * cert_list, unsigned int cert_list_size,
gnutls_typed_vdata_st * data, unsigned int elements, unsigned int flags,
unsigned int * voutput, gnutls_verify_output_function func);

🌸 ARGUMENTS 🌸

  • gnutls_x509_trust_list_t list β€” the list. that's it, that's the whole vibe. it's your trust list 🫢
  • gnutls_x509_crt_t * cert_list β€” this is the certificate list that's gonna get verified ✨
  • unsigned int cert_list_size β€” the size of that certificate list, bestie, we gotta know how many we're working with
  • gnutls_typed_vdata_st * data β€” an array of typed data πŸ‘‘
  • unsigned int elements β€” how many data elements are in there
  • unsigned int flags β€” flags that can change the verification algorithm. OR together the gnutls_certificate_verify_flags enumerations πŸ”₯
  • unsigned int * voutput β€” will hold the certificate verification output. this is where the tea gets spilled β˜•
  • gnutls_verify_output_function func β€” if it's non-null it'll be called on each chain element verification with the output. very main character of it

πŸ’œ DESCRIPTION πŸ’œ

so this function will attempt to verify the given certificate chain and return its status. the voutput parameter will hold an OR'ed sequence of gnutls_certificate_status_t flags. periodt.

when a certificate chain of cert_list_size with more than one certificates is provided, the verification status will apply to the first certificate in the chain that failed verification. and here's the lil plot twist: the verification process starts from the end of the chain (from CA to end certificate). the first certificate in the chain must be the end-certificate, while the rest of the members may be sorted or not. no sorting drama required, she's flexible 🧚

additionally a certificate verification profile can be specified from the ones in gnutls_certificate_verification_profiles_t by ORing the result of GNUTLS_PROFILE_TO_VFLAGS() to the verification flags. yes, you read that right, OR it in πŸ’…

additional verification parameters are possible via the data types; the acceptable types are GNUTLS_DT_DNS_HOSTNAME, GNUTLS_DT_IP_ADDRESS and GNUTLS_DT_KEY_PURPOSE_OID. the former accepts as data a null-terminated hostname, and the latter a null-terminated object identifier (e.g., GNUTLS_KP_TLS_WWW_SERVER). if a DNS hostname is provided then this function will compare the hostname in the end certificate against the given. if names do not match, the GNUTLS_CERT_UNEXPECTED_OWNER status flag will be set. in addition it will consider certificates provided with gnutls_x509_trust_list_add_named_crt(). it's giving thorough πŸ”

if a key purpose OID is provided and the end-certificate contains the extended key usage PKIX extension, it will be required to match the provided OID or be marked for any purpose, otherwise verification will fail with GNUTLS_CERT_PURPOSE_MISMATCH status. sorry babe, rules are rules 😭


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. and here's the important bit bestie, don't get it twisted: verification failure will not result to an error code, only voutput will be updated. so like, check voutput, okay? πŸ‘€


🌈 SINCE 🌈

3.3.8 β€” vintage but still iconic, we stan a legacy baddie


πŸ™ˆ REPORTING BUGS πŸ™ˆ

report bugs to <bugs@gnutls.org>.

home page: https://www.gnutls.org

(they want to hear from you, fr fr, don't be shy 🫢)


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.


πŸ’€ 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/


ok literally that's the whole page, nothing skipped, every flag accounted for πŸ’– go verify some chains and slay ✨

this has been your girl, signing off from the gnutls 3.8.13 manual era β€” stay certified, bestie πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from