dane_verify_crt(3)

πŸ’– dane_verify_crt β€” the API function ✨

okay bestie, welcome to the dane_verify_crt(3) page from the gnutls manual, no cap. this is the one that checks whether a cert chain actually vibes with what DANE says it should be. buckle up πŸŽ€


πŸ¦‹ SYNOPSIS

#include <gnutls/dane.h>

int dane_verify_crt(dane_state_t s, const gnutls_datum_t * chain,
unsigned chain_size, gnutls_certificate_type_t chain_type, const char *
hostname, const char * proto, unsigned int port, unsigned int sflags,
unsigned int vflags, unsigned int * verify);

🌸 ARGUMENTS

like, here's everybody walking into the function, one by one πŸ’…

  • dane_state_t s β€” a DANE state structure. it's giving optional, because it may be NULL.
  • const gnutls_datum_t * chain β€” a certificate chain. the whole squad.
  • unsigned chain_size β€” the size of the chain, i.e. how many besties are in it.
  • gnutls_certificate_type_t chain_type β€” the type of the certificate chain.
  • const char * hostname β€” the hostname associated with the chain.
  • const char * proto β€” the protocol of the service connecting (e.g. tcp).
  • unsigned int port β€” the port of the service connecting (e.g. 443).
  • unsigned int sflags β€” flags for the initialization of s (if NULL).
  • unsigned int vflags β€” verification flags; an OR'ed list of dane_verify_flags_t.
  • unsigned int * verify β€” an OR'ed list of dane_verify_status_t. this is where the tea gets reported back πŸ«–

πŸ‘‘ DESCRIPTION

so this function will verify the given certificate chain against the CA constrains and/or the certificate available via DANE. literally doing both checks at once, main character energy.

if no information via DANE can be obtained, the flag DANE_VERIFY_NO_DANE_INFO is set. and if a DNSSEC signature is not available for the DANE record then the verify flag DANE_VERIFY_NO_DNSSEC_DATA is set. πŸ”₯

now, real talk β€” due to the many possible options of DANE, there is no single threat model countered. so when you're notifying the user about DANE verification results, it may be better to say: DANE verification did not reject the certificate, rather than mentioning a successful DANE verification. words matter bestie, don't oversell it πŸ™ˆ

note that this function is designed to be run in addition to PKIX β€” certificate chain β€” verification. to be run independently, the DANE_VFLAG_ONLY_CHECK_EE_USAGE flag should be specified; then the function will check whether the key of the peer matches the key advertised in the DANE entry. slay.

⭐ RETURNS

  • a negative error code on error, and
  • DANE_E_SUCCESS (0) when the DANE entries were successfully parsed β€” irrespective of whether they were verified (peep verify for that info, that's literally what it's there for).
  • if no usable entries were encountered, DANE_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.

😭 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. iconic, honestly πŸ’œ


🌈 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 ✨ this was dane_verify_crt(3) from the gnutls manual, version 3.8.13 β€” go forth and verify responsibly, mwah πŸ’…πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from