gnutls_ocsp_resp_get_responder(3)

✨ NAME ✨

gnutls_ocsp_resp_get_responder β€” bestie it's an API function, and it's here to pull the responder's name out of an OCSP response πŸ’… (this lives in the gnutls manual, btw)


🌸 SYNOPSIS 🌸

#include <gnutls/ocsp.h>

int gnutls_ocsp_resp_get_responder(gnutls_ocsp_resp_const_t resp,
gnutls_datum_t * dn);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_ocsp_resp_const_t resp β€” this one should contain a gnutls_ocsp_resp_t type, like that's its whole job 🫢
  • gnutls_datum_t * dn β€” a newly allocated buffer with the name in it. fresh out the box ✨

πŸ’– DESCRIPTION πŸ’–

Okay so, the way this works: this function extracts the name of the Basic OCSP Response and drops it into the buffer you gave it. The name comes out looking like "C=xxxx,O=yyyy,CN=zzzz", exactly as described in RFC2253. And the output string is gonna be ASCII or UTF-8 encoded, depending on the certificate data. iykyk 🌈

Now, plot twist πŸ‘€ β€” if the responder ID isn't a name but a hash, this function returns zero and the dn elements get set to NULL. not a bug, just the vibe.

And bestie, listen: the caller needs to deallocate the memory by calling gnutls_free() on dn->data. do NOT forget, that's a leak and leaks are not the moment 😭

One more thing β€” this function does not output a fully RFC4514 compliant string. If you need that, go see gnutls_ocsp_resp_get_responder2(). she's the overachiever sibling πŸ’…


⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error code comes back. And when no data exists it will still return success and set the dn elements to zero. so like, no data isn't a fail, it's just a chill nothing πŸ¦‹


πŸ”₯ REPORTING BUGS πŸ”₯

Found a bug? spill it to <bugs@gnutls.org>. and the home page is right here: https://www.gnutls.org β€” go be nosy, it's encouraged 🌸


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. periodt πŸ’…


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


okay that's the whole page bestie, go read it, it's giving documentation, it's giving slay πŸ’–βœ¨

this was gnutls 3.8.13, the gnutls_ocsp_resp_get_responder(3) page β€” mwah, take care of your memory allocations πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from