gnutls_ocsp_req_set_extension(3)

✨ gnutls_ocsp_req_set_extension ✨

okay bestie, gather round πŸ’– this is a page from the gnutls manual (yes, that gnutls β€” the TLS library, we stan) and it's all about gnutls_ocsp_req_set_extension, which is an API function. it's giving "let me slide a lil extension into your OCSP request" energy and honestly? iconic. πŸŽ€


🌸 SYNOPSIS 🌸

#include <gnutls/ocsp.h>

int gnutls_ocsp_req_set_extension(gnutls_ocsp_req_t req, const char *
oid, unsigned int critical, const gnutls_datum_t * data);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_ocsp_req_t req β€” bestie this one should contain a gnutls_ocsp_req_t type. that's the whole assignment. that's the vibe check. πŸ’…
  • const char * oid β€” a buffer holding the OID of the extension, but as a string. yes queen, string form, not raw bytes, we're being fancy ✨
  • unsigned int critical β€” the critical flag. normally false. like, normally you're not being dramatic about it, but sometimes you gotta be 🫢
  • const gnutls_datum_t * data β€” the extension data itself. the payload. the main character of this whole operation πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so like, this function will add an extension to the OCSP request. that's it, that's the job, and it does it flawlessly no cap 🌈

but here's the tea you actually need to know, and it's important, so lock in: calling this function multiple times for the same OID will overwrite values from earlier calls. 😭 the earlier value doesn't merge, doesn't stack, doesn't politely wait its turn β€” it gets replaced. so if you're looping and reusing the same OID thinking you're collecting extensions like pokΓ©mon… you are not. you are replacing. periodt πŸ’€


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. slay. βœ…

otherwise, a negative error code is returned πŸ™ˆ so yeah, if it's negative, something went sideways, go read the error code bestie.


πŸ“£ REPORTING BUGS πŸ“£

found a bug? don't suffer in silence, tell the maintainers, 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.

(translation: free to copy and share this file, any medium, no royalty required β€” just keep the copyright notice and this notice intact. we love a permissive license moment 🫢)


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


lowkey reminder: that oid is a string, critical is normally false, and same-OID calls overwrite. no cap. πŸ’…

okay that's the whole page, you ate it, go forth and add extensions responsibly 🧚✨

this has been gnutls, version 3.8.13 β€” signing off, mwah πŸ’–πŸŒΈ

πŸ“¦ where this page comes from