OCSP_RESPONSE_STATUS(3)
β¨ NAME β¨
OCSP_RESPONSE_STATUS(3) β okay so this is the Library Functions Manual page for the OCSP response function squad, and honestly it's giving "the whole response-side glow-up" π
. The full lineup: OCSP_RESPONSE_new, OCSP_RESPONSE_free, OCSP_RESPBYTES_new, OCSP_RESPBYTES_free, OCSP_BASICRESP_new, OCSP_BASICRESP_free, OCSP_RESPDATA_new, OCSP_RESPDATA_free, OCSP_RESPID_new, OCSP_RESPID_free, OCSP_response_create, OCSP_response_status, OCSP_response_status_str, OCSP_response_get1_basic, and OCSP_basic_sign β collectively just OCSP response functions π¦.
πΈ SYNOPSIS πΈ
#include <openssl/ocsp.h>
OCSP_RESPONSE *
OCSP_RESPONSE_new(void);
void
OCSP_RESPONSE_free(OCSP_RESPONSE *resp);
OCSP_RESPBYTES *
OCSP_RESPBYTES_new(void);
void
OCSP_RESPBYTES_free(OCSP_RESPBYTES *respbytes);
OCSP_BASICRESP *
OCSP_BASICRESP_new(void);
void
OCSP_BASICRESP_free(OCSP_BASICRESP *bs);
OCSP_RESPDATA *
OCSP_RESPDATA_new(void);
void
OCSP_RESPDATA_free(OCSP_RESPDATA *respdata);
OCSP_RESPID *
OCSP_RESPID_new(void);
void
OCSP_RESPID_free(OCSP_RESPID *respid);
OCSP_RESPONSE *
OCSP_response_create(int status, OCSP_BASICRESP *bs);
int
OCSP_response_status(OCSP_RESPONSE *resp);
const char *
OCSP_response_status_str(long code);
OCSP_BASICRESP *
OCSP_response_get1_basic(OCSP_RESPONSE *resp);
int
OCSP_basic_sign(OCSP_BASICRESP *bs, X509 *signer, EVP_PKEY *key,
const EVP_MD *dgst, STACK_OF(X509) *certs, unsigned long flags);
π DESCRIPTION π
OK so real talk, every single one of these has a <something>_new() that spins up a fresh empty object and a <something>_free() that yeets it into the void. Here's the whole cast, one by one, because they all have main character energy in their own little way π
OCSP_RESPONSE_new()allocates and initializes an emptyOCSP_RESPONSEobject β it's the ASN.1OCSPResponsestructure from RFC 6960, no cap. AndOCSP_RESPONSE_free()frees resp π«Ά.OCSP_RESPBYTES_new()allocates and initializes an emptyOCSP_RESPBYTESobject, which reps the ASN.1ResponseBytesstructure from RFC 6960. Little guy lives inside anOCSP_RESPONSE, iykyk. ThenOCSP_RESPBYTES_free()frees respbytes.OCSP_BASICRESP_new()allocates and initializes an emptyOCSP_BASICRESPobject β the ASN.1BasicOCSPResponsestructure from RFC 6960, iconic. Fun fact:OCSP_RESPBYTESliterally contains the DER-encoded form of anOCSP_BASICRESPobject π₯. AndOCSP_BASICRESP_free()frees bs.OCSP_RESPDATA_new()allocates and initializes an emptyOCSP_RESPDATAobject, representing the ASN.1ResponseDatastructure from RFC 6960. This one hangs out insideOCSP_BASICRESP.OCSP_RESPDATA_free()frees respdata β¨.OCSP_RESPID_new()allocates and initializes an emptyOCSP_RESPIDobject β the ASN.1ResponderIDstructure from RFC 6960, and yes it lives insideOCSP_RESPDATA, nesting dolls fr fr π.OCSP_RESPID_free()frees respid.OCSP_response_create()creates anOCSP_RESPONSEobject for status, optionally including the basic response bs π«.OCSP_response_status()returns the OCSP response status of resp. It gives you back one of these besties:OCSP_RESPONSE_STATUS_SUCCESSFUL,OCSP_RESPONSE_STATUS_MALFORMEDREQUEST,OCSP_RESPONSE_STATUS_INTERNALERROR,OCSP_RESPONSE_STATUS_TRYLATER,OCSP_RESPONSE_STATUS_SIGREQUIRED, orOCSP_RESPONSE_STATUS_UNAUTHORIZEDπ.OCSP_response_status_str()converts one of the status codes thatOCSP_response_status()handed you into a string consisting of one word. One word. Very demure, very mindful π§.OCSP_response_get1_basic()decodes and returns theOCSP_BASICRESPobject contained in resp. Heads up though: it's only called if the status of a response isOCSP_RESPONSE_STATUS_SUCCESSFULβ.OCSP_basic_sign()signs the OCSP response bs using the certificate signer, the private key key, the digest dgst, and the additional certificates certs ποΈ. Two flag behaviors to memorize:- If the flags option
OCSP_NOCERTSis set, then no certificates will be included in the request. - If the flags option
OCSP_RESPID_KEYis set, then the responder is identified by key ID rather than by name π.
- If the flags option
π¦ RETURN VALUES π¦
Vibe check on what each one hands back to you:
OCSP_RESPONSE_new()andOCSP_response_create()return a pointer to anOCSP_RESPONSEobject, orNULLif an error occurred π.OCSP_BASICRESP_new()andOCSP_response_get1_basic()return a pointer to anOCSP_BASICRESPobject, orNULLif an error occurred.OCSP_RESPBYTES_new(),OCSP_RESPDATA_new(), andOCSP_RESPID_new()return a pointer to an emptyOCSP_RESPBYTES,OCSP_RESPDATA, orOCSP_RESPIDobject, respectively, orNULLif an error occurred π.OCSP_response_status()returns a status value.OCSP_response_status_str()returns a pointer to a static string π«Ά.OCSP_basic_sign()return1on success or0on failure. (Yes, the grammar in the original is like that. We don't fix, we appreciate π .)
π SEE ALSO π
Go read these next, bestie β they're all connected:
EVP_DigestInit(3)OCSP_cert_to_id(3)OCSP_request_add1_nonce(3)OCSP_REQUEST_new(3)OCSP_resp_find_status(3)OCSP_sendreq_new(3)
πΊ STANDARDS πΊ
RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.2: Response Syntax β that's the receipt, periodt π.
π HISTORY π
These functions first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2. Ancient. Legendary. Still slaying π.
That's the whole page, no skips, no cuts β every function, every flag, every status code made it in π
And that's a wrap, bestie π«Ά β page brought to you by Debian, dated August 27, 2019, and you already know OCSP_RESPONSE_STATUS(3) ate and left no crumbs π
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· OpenSSL
- Copyright (c) 2016, 2019 Ingo Schwarze <schwarze@openbsd.org>
- Copyright (c) 2014, 2016, 2018 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms