GNUTLS_CERTIFICATE_SET_OCSP_STATUS_REQUEST_MEM(3)

✨ NAME ✨

gnutls_certificate_set_ocsp_status_request_mem β€” bestie, it's an API function πŸ’–

This one lives in the gnutls manual (section 3, the library-functions girlies), so if you were looking for a command to run in your shell... no babe, this is C code you call. 🫢


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int
gnutls_certificate_set_ocsp_status_request_mem(gnutls_certificate_credentials_t
sc, const gnutls_datum_t * resp_data, unsigned idx,
gnutls_x509_crt_fmt_t fmt);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_certificate_credentials_t sc β€” okay so this is your credentials structure. The main character. πŸ’…
  • const gnutls_datum_t * resp_data β€” a memory buffer holding an OCSP response. It's giving "I brought the receipts" but the receipts are literally in RAM. 🧠✨
  • unsigned idx β€” the certificate index, as returned by gnutls_certificate_set_key() and friends (you know, the whole friend group πŸ‘―).
  • gnutls_x509_crt_fmt_t fmt β€” it's PEM or DER, pick your fighter. πŸ₯Š

πŸ¦‹ DESCRIPTION πŸ¦‹

So what this function does, bestie, is it sets the OCSP responses to be sent to the peer for the certificate chain specified by idx. No cap. πŸ“¨

And listen β€” when fmt is set to PEM, you can load multiple responses at once. Slay. 🌈


πŸ’€ NOTE πŸ’€

Okay this part is important, don't skip it, I'm being so serious right now. 😭

The ability to set multiple OCSP responses per credential structure via the index idx was added in version 3.5.6. And to keep backwards compatibility, it requires using gnutls_certificate_set_flags() with the GNUTLS_CERTIFICATE_API_V2 flag, which is what makes the set certificate functions return an index that this function can actually use. It's giving "you gotta opt in, the old ways still gotta work." πŸ‘‘

This function must be called after setting any certificates, and it cannot be used for certificates that are provided via a callback β€” that is, when gnutls_certificate_set_retrieve_function() is used. So if you're on the callback route, this is not the vibe for you, sorry babe. πŸ™ˆ

You can call this function multiple times when multiple responses which apply to the certificate chain are available. Obsessed with the flexibility, honestly. πŸ’–

And now the plot twists:

  • If the response provided does not match any certificates present in the chain, the code GNUTLS_E_OCSP_MISMATCH_WITH_CERTS is returned. Mismatch. Not the moment. πŸ’”
  • If the response is already expired at the time of loading, the code GNUTLS_E_EXPIRED is returned. It's giving "girl you're late, the party's over." βŒ›

⭐ RETURNS ⭐

On success, you get the number of loaded responses back. Otherwise, it's a negative error code β€” a little frown, an L, a "not today." πŸ˜”


🌟 SINCE 🌟

3.6.3 β€” a classic, an icon, been here since then. πŸ’œ


πŸ› REPORTING BUGS πŸ›

Found a bug? Tell the girlies at <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. (Translation: go off, share it, 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 β€” gnutls 3.8.13, page gnutls_certific...tus_request_mem(3). Go forth and set those OCSP responses, you absolute legend. πŸ’…βœ¨πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from