gnutls_ocsp_resp_get_response(3)

✨ gnutls_ocsp_resp_get_response ✨

okay bestie so this one lives in the gnutls manual, section 3, and it's called gnutls_ocsp_resp_get_response β€” it's the API function that pulls the response type OID and the response data out of an OCSP response. let's get into it πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/ocsp.h>

int gnutls_ocsp_resp_get_response(gnutls_ocsp_resp_const_t resp,
gnutls_datum_t * response_type_oid, gnutls_datum_t * response);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_ocsp_resp_const_t resp β€” this one should contain a gnutls_ocsp_resp_t type, like it's literally holding your OCSP response for you 🫢
  • gnutls_datum_t * response_type_oid β€” a newly allocated output buffer that gets the response type OID dropped into it ✨
  • gnutls_datum_t * response β€” a newly allocated output buffer that gets the DER encoded response πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this function actually does: it extracts the response type OID and the response data from an OCSP response. iconic behaviour, no cap.

normally the response_type_oid is always "1.3.6.1.5.5.7.48.1.1" which means the response should be decoded as a Basic OCSP Response β€” but technically, other response types could be used. the vibes are usually the same but the spec leaves room 🫠

this function is typically only useful when you want to extract the response type OID of a response for diagnostic purposes. otherwise gnutls_ocsp_resp_import() will decode the basic OCSP response part and the caller need not worry about that aspect. so like… if you're just here for the normal flow, go use that one, bestie πŸ’€

since 3.7.0, response_type_oid β†’size does not account for the terminating null byte. remember that. it's giving "tiny detail, big consequences" 😭

⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. slay when it's zero, crying when it's not πŸ₯²


πŸ’œ REPORTING BUGS πŸ’œ

found a bug? don't gatekeep it, report it 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. 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/


and that's the whole page bestie, you ate it πŸ“

this was gnutls_ocsp_resp_get_response(3), from gnutls version 3.8.13 β€” mwah, go read the rest of the manual, ily πŸ’–βœ¨
πŸ“¦ where this page comes from