gnutls_x509_cr...bject_alt_name2(3)

✨ NAME ✨

gnutls_x509_crt_get_subject_alt_name2 β€” an API function, bestie πŸ’…

okay so first things first, this page lives in the gnutls manual (you know, the 3.8.13 era of it), and if you've been squinting at the title bar going "what is gnutls_x509_cr...bject_alt_name2" β€” that's just the truncated header being dramatic. The real one is the full name up there. πŸŽ€


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_get_subject_alt_name2(gnutls_x509_crt_t cert,
unsigned int seq, void * san, size_t * san_size, unsigned int *
san_type, unsigned int * critical);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_crt_t cert β€” should contain a gnutls_x509_crt_t type. it's the cert you're snooping on, periodt πŸ‘‘
  • unsigned int seq β€” specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.). yes queen, we're counting from zero, it's giving very index-energy πŸ”’
  • void * san β€” is the place where the alternative name will be copied to. empty bucket, ready to receive πŸͺ£
  • size_t * san_size β€” holds the size of ret. (that's the size of the buffer you handed over in san, and it gets updated if things go sideways)
  • unsigned int * san_type β€” holds the type of the alternative name (one of gnutls_x509_subject_alt_name_t). this is the spicy one, more on that in a sec 😌
  • unsigned int * critical β€” will be non-zero if the extension is marked as critical (may be null). so like, pass a real pointer if you care, or NULL if you don't πŸ’€

πŸ’– DESCRIPTION πŸ’–

This function will return the alternative names, contained in the given certificate. πŸŽ€

It is the same as gnutls_x509_crt_get_subject_alt_name() except for the fact that it will return the type of the alternative name in san_type even if the function fails for some reason (i.e. the buffer provided is not enough).

that last bit is the whole entire plot twist, no cap β€” the type info still comes through even when everything else refuses. main character energy fr fr ✨


πŸ”₯ RETURNS πŸ”₯

the alternative subject name type on success, one of the enumerated gnutls_x509_subject_alt_name_t. πŸ’…

  • It will return GNUTLS_E_SHORT_MEMORY_BUFFER if san_size is not large enough to hold the value. In that case san_size will be updated with the required size. (so it's not a failure-failure, it's a "here's how much room you actually need, bestie" πŸ“)
  • If the certificate does not have an Alternative name with the specified sequence number then GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned. πŸ™ˆ

😭 REPORTING BUGS 😭

Report bugs to <bugs@gnutls.org>.

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

not me asking you to actually file the bug instead of just complaining in the group chat 🫢

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/

and that's the whole page, slay πŸ’œ this was gnutls 3.8.13, from the gnutls manual β€” go forth and read those subject alt names, icon of you 🧚✨

πŸ“¦ where this page comes from