gnutls_ocsp_resp_get_extension(3)
π gnutls_ocsp_resp_get_extension β the gnutls manual, bestie edition β¨
okay so real talk, this one lives in the gnutls manual and it's about digging extension info out of an OCSP response. it's giving "detective but make it TLS" ππ
πΈ NAME πΈ
gnutls_ocsp_resp_get_extension β bestie, this is an API function π«Ά
β¨ SYNOPSIS β¨
#include <gnutls/ocsp.h>
int gnutls_ocsp_resp_get_extension(gnutls_ocsp_resp_const_t resp,
unsigned indx, gnutls_datum_t * oid, unsigned int * critical,
gnutls_datum_t * data);
like yes, that's the whole vibe. copy it exactly, don't freestyle it π
π ARGUMENTS π
gnutls_ocsp_resp_const_t respβ this one should contain agnutls_ocsp_resp_ttype. it's the response you're snooping through, no cap.unsigned indxβ tells the function which extension OID you want. use(0)to get the very first one. literally zero-indexed, iykyk πgnutls_datum_t * oidβ this will hold a newly allocated buffer with the OID of the extension. it may beNULLif you're not about that life.unsigned int * criticalβ an output variable with the critical flag, and yes, it may beNULLtoo.gnutls_datum_t * dataβ will hold a newly allocated buffer with the extension data. also may beNULL. so manyNULLs, so little time π
π¦ DESCRIPTION π¦
this function will return all the information about the requested extension in the OCSP response. the information you get back is the OID, the critical flag, and the data itself. the extension OID gets stored as a string. periodt. π
any of oid, critical, and data may be NULL, which basically means the caller is not interested in getting that info back. so if you only want one thing, just say that. main character energy: only take what you need β¨
the caller needs to deallocate memory by calling gnutls_free() on oid->data and data->data. do NOT forget this one bestie, that's a memory leak and it's not cute π
since3.7.0,oid->sizedoes not account for the terminating null byte. noted, moving on. π
π RETURNS π
on success, GNUTLS_E_SUCCESS (0) is returned. otherwise a negative error code comes back, which is giving "something went wrong" π
and if you've reached the last extension available, GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned. that's your sign to stop looping, bestie. you ate the whole list. π
π REPORTING BUGS π
found a bug? spill the tea, respectfully:
- 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. so like, go off, just keep the receipts. π«Ά
π 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 one came straight from the gnutls manual, version 3.8.13. slay responsibly. π
β¨π
π¦ 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