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 withgnutls_typed_vdata_st * dataβ an array of typed data πunsigned int elementsβ how many data elements are in thereunsigned int flagsβ flags that can change the verification algorithm. OR together thegnutls_certificate_verify_flagsenumerations π₯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 π
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
- 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