gnutls_ocsp_resp_get_responder2(3)

πŸ’… gnutls_ocsp_resp_get_responder2(3) β€” bestie edition

okay so this is a page from the gnutls manual, and today's main character is gnutls_ocsp_resp_get_responder2(3). she's a little API function with big "who even IS the responder" energy. let's get into it 🫢


✨ NAME ✨

gnutls_ocsp_resp_get_responder2 β€” API function

no cap, that's the whole name section. she's an API function. iconic behavior.


🌸 SYNOPSIS 🌸

#include <gnutls/ocsp.h>

int gnutls_ocsp_resp_get_responder2(gnutls_ocsp_resp_const_t resp,
gnutls_datum_t * dn, unsigned flags);

that's the whole vibe. include the header, call the function, get a name back (maybe).


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_ocsp_resp_const_t resp β€” this is the OCSP response you're passing in, and bestie it should contain a gnutls_ocsp_resp_t type. it's giving "hand me the goods".
  • gnutls_datum_t * dn β€” a newly allocated buffer with the name. yes, newly allocated, so don't you dare forget about it (more on that in a sec 😭).
  • unsigned flags β€” either zero, or GNUTLS_X509_DN_FLAG_COMPAT. that's it, that's the choices. pick your fighter.

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she actually do? she extracts the name of the Basic OCSP Response and drops it in the buffer you provided. the name will be in the form "C=xxxx,O=yyyy,CN=zzzz" β€” as described in RFC2253, iykyk. and the output string will be ASCII or UTF-8 encoded, depending on the certificate data. it literally just depends on what the cert's serving.

now here's the plot twist: if the responder ID is not a name but a hash, this function will return zero and the dn elements will be set to NULL. so like... no name, no problem, but also no name. πŸ’€

⚠️ the caller needs to deallocate memory by calling gnutls_free() on dn->data. this is NOT optional, bestie. you allocated it, you free it. periodt.

and one more thing β€” when the flag GNUTLS_X509_DN_FLAG_COMPAT is specified, the output format will match the format output by versions of GnuTLS previous to 3.5.6, which was not fully RFC4514-compliant. so if you want that retro legacy format, that flag is your girl. otherwise, stay modern. 🧚


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. slay. otherwise a negative error code is returned. and when no data exist, it will return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE. so if you get that one, it's not you, it's just... there's no data. πŸ™ˆ


πŸ’– REPORTING BUGS πŸ’–

found a bug? report it, fr fr, they wanna know:


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, bestie πŸ’œ this was gnutls 3.8.13 of the gnutls manual, and honestly? she ate. go forth and get those responders. πŸŽ€βœ¨

πŸ“¦ where this page comes from