OSSL_ESS_CHECK_SIGNING_CERTS(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’… OSSL_ESS_CHECK_SIGNING_CERTS πŸ’…

okay bestie, so this whole page is from the OpenSSL manual, section 3ossl, and it's literally all about Enhanced Security Services (ESS) functions ✨ like, the certificate-identifier girlies that make signed stuff trustworthy. it's giving niche but iconic, ngl πŸŽ€


🌸 NAME 🌸

OSSL_ESS_signing_cert_new_init, OSSL_ESS_signing_cert_v2_new_init, OSSL_ESS_check_signing_certs β€” the Enhanced Security Services (ESS) functions, aka the trio you're gonna meet right now πŸ’–


✨ SYNOPSIS ✨

#include <openssl/ess.h>

ESS_SIGNING_CERT *OSSL_ESS_signing_cert_new_init(const X509 *signcert,
                                                 const STACK_OF(X509) *certs,
                                                 int set_issuer_serial);
ESS_SIGNING_CERT_V2 *OSSL_ESS_signing_cert_v2_new_init(const EVP_MD *hash_alg,
                                                       const X509 *signcert,
                                                       const
                                                       STACK_OF(X509) *certs,
                                                       int set_issuer_serial);
int OSSL_ESS_check_signing_certs(const ESS_SIGNING_CERT *ss,
                                 const ESS_SIGNING_CERT_V2 *ssv2,
                                 const STACK_OF(X509) *chain,
                                 int require_signing_cert);

like, yes, the second one has a whole line break in the middle of STACK_OF(X509). that's just how it is. respect the formatting πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first up: OSSL_ESS_signing_cert_new_init() generates a brand new ESS_SIGNING_CERT structure that references the given signcert plus any further certs you hand it, using their SHA-1 fingerprints πŸ’… (yes bestie, SHA-1, that's the spec).

and listen β€” if set_issuer_serial is nonzero, then the issuer and serial number of signcert also get included in the ESS_CERT_ID as the issuerSerial field 🌸 and for all members of certs, the issuerSerial field is always included. no asking, it just is. periodt.

OSSL_ESS_signing_cert_v2_new_init() is literally the same as OSSL_ESS_signing_cert_new_init() except it uses the given hash_alg and generates an ESS_SIGNING_CERT_V2 structure with ESS_CERT_ID_V2 elements. v2 coded, hash-algo-flexible, slay πŸ’–

OSSL_ESS_check_signing_certs() is the vibe check πŸ‘‘ β€” it checks if the validation chain chain contains the certificates required by the identifiers given in ss and/or ssv2.

here's the fine print, and it's lowkey important:

  • if require_signing_cert is nonzero, ss or ssv2 must not be NULL 🫢
  • if both ss and ssv2 are not NULL, they are evaluated independently
  • the list of certificate identifiers in ss is of type ESS_CERT_ID, while the list in ssv2 is of type ESS_CERT_ID_V2
  • as far as these lists are present, they must be nonempty (empty list = not the vibe πŸ’€)
  • the certificate identified by their first entry must be the first element of chain, i.e. the signer certificate
  • any further certificates referenced in the list must also be found in chain
  • the matching is done using the given certificate hash algorithm and value
  • and in addition to the checks required by RFCs 2624 and 5035, if the issuerSerial field is included in an ESSCertID or ESSCertIDv2, it must match the certificate issuer and serial number attributes 🌈

🧚 NOTES 🧚

ESS has been defined in RFC 2634, which has been updated in RFC 5035 (that's the ESS version 2 glow-up ✨) to support hash algorithms other than SHA-1. it's used for TSP (RFC 3161) and CAdES-BES (informational RFC 5126). iykyk πŸ’œ


πŸ”₯ RETURN VALUES πŸ”₯

  • OSSL_ESS_signing_cert_new_init() and OSSL_ESS_signing_cert_v2_new_init() return a pointer to the new structure, or NULL on malloc failure 😭
  • OSSL_ESS_check_signing_certs() returns 1 on success 🌟, 0 if a required certificate cannot be found πŸ™ˆ, and -1 on other error πŸ’€
bestie the 0 vs -1 distinction is not a drill. 0 means "cert missing", -1 means "something else went wrong". don't conflate them fr fr.

πŸ’œ SEE ALSO πŸ’œ


⭐ HISTORY ⭐

OSSL_ESS_signing_cert_new_init(), OSSL_ESS_signing_cert_v2_new_init(), and OSSL_ESS_check_signing_certs() were added in OpenSSL 3.0. glow-up era confirmed πŸŽ€


Copyright 2021-2022 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>. 🫢


ok that's the whole thing bestie πŸ’– now go forth and validate those signing certs. no cap, you got this ✨

mwah πŸ’‹ β€” written from the OpenSSL 3.5.6 docs, dated 2026-04-0, and yes the trailing OSSL_ESS_CHECK_SIGNING_CERTS(3ossl) at the bottom is just the footer being its usual self πŸŽ€

πŸ“¦ where this page comes from