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 agnutls_ocsp_resp_ttype. 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, orGNUTLS_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 callinggnutls_free()ondn->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:
- Report bugs to <bugs@gnutls.org>.
- Home page: https://www.gnutls.org
π COPYRIGHT π
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms