OSSL_ESS_CHECK_SIGNING_CERTS(3ossl)

OSSL_ESS_CHECK_SIGNING_CERTS πŸ’–

okay bestie so this is the page for the OpenSSL Enhanced Security Services (ESS) functions, living in manual section 3ossl. It's giving ✨certificate identifier vibes✨ and honestly? lowkey essential if you're doing timestamping or CAdES stuff. Let's get into it 🫢


✨ 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 little trio that builds and checks ESS signing-certificate structures 🌸


πŸŽ€ 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);

πŸ’… DESCRIPTION πŸ’…

the glow-up functions ✨

OSSL_ESS_signing_cert_new_init() makes you a brand-new ESS_SIGNING_CERT structure. It references the signcert you handed over, plus any further certs you passed along, using their SHA-1 fingerprints 🫢. And 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. Note: for all members of certs, the issuerSerial field is always included β€” no toggle, it's just like that, periodt πŸ’…

OSSL_ESS_signing_cert_v2_new_init() is literally the same as OSSL_ESS_signing_cert_new_init() except it uses the hash_alg you give it and generates an ESS_SIGNING_CERT_V2 structure with ESS_CERT_ID_V2 elements. v2 ate and left no crumbs πŸ‘‘

the check function πŸ”

OSSL_ESS_check_signing_certs() checks whether the validation chain chain actually contains the certificates required by the identifiers given in ss and/or ssv2. Bestie, pay attention here:

  • If require_signing_cert is nonzero, then ss or ssv2 must not be NULL β€” that's not optional, that's the law 😀
  • If both ss and ssv2 are not NULL, they get evaluated independently.
  • The list of certificate identifiers in ss is of type ESS_CERT_ID, while the list contained in ssv2 is of type ESS_CERT_ID_V2.
  • As far as these lists are present, they must be nonempty.
  • The certificate identified by their first entry must be the first element of chain, i.e. the signer certificate. No skipping to second place, main character energy only πŸ‘‘
  • 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. no cap.

πŸ“œ NOTES πŸ“œ

ESS has been defined in RFC 2634, which got updated in RFC 5035 (ESS version 2) so it supports hash algorithms other than SHA-1 β€” glow-up era fr fr πŸ’–. This whole thing is 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 😭 (we've all been there).

OSSL_ESS_check_signing_certs() returns:

  1. 1 on success πŸŽ‰
  2. 0 if a required certificate cannot be found πŸ™ˆ
  3. -1 on other error πŸ’€

πŸ¦‹ 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. vintage but still iconic ✨


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>.

fr fr read the license before you go using this, bestie 🫢

okay that's the whole page, no notes πŸ’… this was OpenSSL 3.5.9, dated 2026-09-2, and that's a wrap β€” slay, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from