gnutls_x509_cr...crl_dist_points(3)

✨ gnutls_x509_cr...crl_dist_points β€” the gnutls_x509_crt_get_crl_dist_points(3) glow-up ✨

okay bestie, gather round, because we're diving into the gnutls manual (yes, that gnutls) and today's main character is gnutls_x509_crt_get_crl_dist_points. it's giving very much "where do I go to find out if this cert got revoked" energy. let's get into it πŸ’…


🌸 NAME 🌸

gnutls_x509_crt_get_crl_dist_points β€” an API function, no cap. that's literally it. that's the whole name section. iconic.


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/x509.h>

int gnutls_x509_crt_get_crl_dist_points(gnutls_x509_crt_t cert, unsigned
int seq, void * san, size_t * san_size, unsigned int * reason_flags,
unsigned int * critical);

so yeah, that's the whole call signature. she's a little long but she's worth it, fr fr. πŸ¦‹


πŸ’– ARGUMENTS πŸ’–

  • gnutls_x509_crt_t cert β€” should contain a gnutls_x509_crt_t type. that's your cert, the whole point of this whole operation. she's the moment.
  • unsigned int seq β€” specifies the sequence number of the distribution point (0 for the first one, 1 for the second etc.). so like, they're numbered. starting at zero, because of course they are. classic zero-indexing behavior 😭
  • void * san β€” is the place where the distribution point will be copied to. this is your lil output bucket. bring a big enough one or she WILL complain (see RETURNS, it's a whole thing).
  • size_t * san_size β€” holds the size of ret. yes bestie, the manpage says ret here and the parameter is called san, and honestly we're just going to let that be. it holds the size. that's the vibe. πŸ™ˆ
  • unsigned int * reason_flags β€” revocation reasons. an ORed sequence of flags from gnutls_x509_crl_reason_flags_t. so you get to know why someone might be revoked. spicy. πŸ”₯
  • unsigned int * critical β€” will be non-zero if the extension is marked as critical (may be null). may be null! so if you don't care, you can just pass NULL and move on with your day. lowkey convenient.

🌈 DESCRIPTION 🌈

so what does this actually DO? this function retrieves the CRL distribution points (2.5.29.31), contained in the given certificate in the X509v3 Certificate Extensions.

translating: certificates can carry a lil list of "hey, if you wanna check whether I've been revoked, go look here" URLs/addresses. this function pulls those out of the X509v3 Certificate Extensions for you. the OID is 2.5.29.31, in case you needed to know her government name. πŸ‘‘


⭐ RETURNS ⭐

okay so this is the part where you gotta pay attention, because there's a gotcha:

  • GNUTLS_E_SHORT_MEMORY_BUFFER and updates ret_size if ret_size is not enough to hold the distribution point. your buffer was too small, babe. she's telling you the size you actually need via ret_size, so you can come back with a bigger one. it's giving "let me speak to the manager" but like, in a helpful way.
  • otherwise, the type of the distribution point if everything was ok. the type is one of the enumerated gnutls_x509_subject_alt_name_t. ✨
  • and if the certificate does not have an Alternative name with the specified sequence number, then GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned. so basically "she's not here, girl." πŸ’€
ngl, that GNUTLS_E_SHORT_MEMORY_BUFFER β†’ resize β†’ retry loop is the standard pattern here. you're not doing it wrong, that's just how she works. 🫢

😭 REPORTING BUGS 😭

found a bug? first of all, relatable. second of all, report bugs to bugs@gnutls.org.

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


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. so like, take her, share her, just keep the receipts. πŸ’–


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

go read the rest of the lore, iykyk. πŸ“šβœ¨


and that's the whole page, bestie. this one's from gnutls 3.8.13, page gnutls_x509_cr...crl_dist_points(3), dated with the 3.8.13 era energy. mwah. πŸ’…πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from