OCSP_CRLID_NEW(3)
π OCSP_CRLID_NEW β okay bestie, let's talk about the OCSP CRL extension
So this page is OCSP_CRLID_NEW(3) and it's literally all about three little functions in libcrypto that deal with one specific ASN.1 structure. Ngl, it's niche. But it's also kind of iconic? Let's get into it. π
πΈ NAME πΈ
OCSP_CRLID_new, OCSP_CRLID_free, OCSP_crlID_new β the OCSP CRL extension, periodt.
β¨ SYNOPSIS β¨
You're gonna need libcrypto for this one, bestie. Here's the include:
#include <openssl/ocsp.h>
And here are the three function signatures, exactly as they are, no cap:
OCSP_CRLID *
OCSP_CRLID_new(void);
void
OCSP_CRLID_free(OCSP_CRLID *crlid);
X509_EXTENSION *
OCSP_crlID_new(const char *url, long *number, char *time);
π¦ DESCRIPTION π¦
Okay so picture this: a client comes in and asks "hey, is this certificate still valid?" and it turns out the answer is no. π The responder may optionally tell them which certificate revocation list the cert got found on. Optional! It's a nice-to-have, not a must.
The data that's required for that lives in an ASN.1 CrlID structure, tucked inside the singleExtensions field of the SingleResponse structure. And the CrlID itself is represented by an OCSP_CRLID object β which gets stored inside the OCSP_SINGLERESP object you can read about in OCSP_SINGLERESP_new(3). It's giving nested-structs-inception. π«Ά
Now the functions themselves:
OCSP_CRLID_new()β allocates and initializes an emptyOCSP_CRLIDobject. Fresh out of the box, zero notes.OCSP_CRLID_free()β freescrlid. Say bye π, it's gone, that's the whole job.OCSP_crlID_new()β the main character π . It takes theurlat which the CRL is available, the CRLnumber, and/or thetimeat which the CRL was created. And here's the cute part: each argument can beNULL, and if it is, that respective field just gets omitted. Very "no thoughts, field not present." β¨
The resulting CrlID structure is encoded in ASN.1 using X509V3_EXT_i2d(3) with criticality 0. π
π RETURN VALUES π
OCSP_CRLID_new()returns a newOCSP_CRLIDobject, orNULLif an error occurred. πOCSP_crlID_new()returns a newX509_EXTENSIONobject, orNULLif an error occurred.
So like, always check for NULL, bestie. Always. π₯
π SEE ALSO π
Go read these next, iykyk:
β STANDARDS β
RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.4.2: CRL References β that's the receipt, that's the source. π§
π HISTORY π
OCSP_CRLID_new(), OCSP_CRLID_free(), and OCSP_crlID_new() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2. Ancient. Vintage. Lowkey legendary. π
π CAVEATS π
The function namesOCSP_CRLID_new()andOCSP_crlID_new()only differ in case. Like, that's it. That's the difference. Yes, this is a trap, and yes, you will absolutely typo it at 3am. You've been warned. π
Written by the Debian folks, dated June 8, 2025 β mwah, thanks for the docs, slay πβ¨
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms