X509_CRL_GET0_BY_SERIAL(3)
π NAME
Okay so this is the X509_CRL_GET0_BY_SERIAL(3) page from the Library Functions Manual, bestie β and it's giving βCRL entry management eraβ β¨.
X509_CRL_get0_by_serial, X509_CRL_get0_by_cert, X509_CRL_get_REVOKED, X509_CRL_add0_revoked, X509_CRL_sort β add, sort, and retrieve CRL entries. That's the whole menu, periodt π
.
β¨ SYNOPSIS
library βlibcryptoβ #include <openssl/x509.h>
int
X509_CRL_get0_by_serial(X509_CRL *crl, X509_REVOKED **ret,
ASN1_INTEGER *serial);
int
X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
STACK_OF(X509_REVOKED) *
X509_CRL_get_REVOKED(X509_CRL *crl);
int
X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
int
X509_CRL_sort(X509_CRL *crl);
π¦ DESCRIPTION
X509_CRL_get0_by_serial()β attempts to find a revoked entry incrlfor serial numberserial. If it is successful, it sets*retto the internal pointer of the matching entry. Consequently,*retmust not be freed up after the call π«Ά. Like, hands off β it's not yours to free.X509_CRL_get0_by_cert()β similar toX509_CRL_get0_by_serial()except that it looks for a revoked entry using the serial number of certificatex. Slay π .X509_CRL_get_REVOKED()β returns an internal pointer to a stack of all revoked entries forcrl. Internal pointer, bestie β no freeing it πΈ.X509_CRL_add0_revoked()β appends revoked entryrevto CRLcrl. The pointerrevis used internally, so it must not be freed up after the call: it is freed when the parent CRL is freed π. So, like, leaverevalone.X509_CRL_sort()β sorts the revoked entries ofcrlinto ascending serial number order π₯. Sorted, cute, done.
Applications can determine the number of revoked entries returned by X509_CRL_get_revoked() using sk_X509_REVOKED_num() and examine each one in turn using sk_X509_REVOKED_value(), both defined in <openssl/safestack.h> π§.
π₯ RETURN VALUES
X509_CRL_get0_by_serial()andX509_CRL_get0_by_cert()β return0for failure or1for success, except if the revoked entry has the reason"removeFromCRL", in which case2is returned π. Yes, a surprise2, iconic.X509_CRL_add0_revoked()β returns1if successful; otherwise0is returned and an error code can be retrieved withERR_get_error(3)π.X509_CRL_sort()β returns1for success or0for failure. The current implementation cannot fail π. So the failure return is there, but the current implementation is unbothered.X509_CRL_get_REVOKED()β returns aSTACKof revoked entries π.
π SEE ALSO
d2i_X509_CRL(3)X509_CRL_get_ext(3)X509_CRL_get_issuer(3)X509_CRL_get_version(3)X509_CRL_new(3)X509_REVOKED_new(3)X509V3_get_d2i(3)
π HISTORY
X509_CRL_get_REVOKED()first appeared in OpenSSL0.9.2band has been available since OpenBSD2.6π±.X509_CRL_add0_revoked()andX509_CRL_sort()first appeared in OpenSSL0.9.7and have been available since OpenBSD3.2π«.X509_CRL_get0_by_serial()andX509_CRL_get0_by_cert()first appeared in OpenSSL1.0.0and have been available since OpenBSD4.9π¦.
Cute sign-off: source/version is Debian, dated June 8, 2025, and the manual is X509_CRL_GET0_BY_SERIAL(3) β mwah, bestie ππ.
π¦ 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) 2015, 2017 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