OSSL_CMP_VALIDATE_MSG(3ossl)
β¨ OSSL_CMP_VALIDATE_MSG β¨
okay bestie, welcome to the OpenSSL manual, section 3ossl π this is the page for OSSL_CMP_validate_msg and OSSL_CMP_validate_cert_path, aka the vibe-check squad for CMP message protection. pull up a chair π«Ά
πΈ NAME πΈ
OSSL_CMP_validate_msg, OSSL_CMP_validate_cert_path β functions for verifying CMP message protection
π SYNOPSIS π
#include <openssl/cmp.h>
int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
int OSSL_CMP_validate_cert_path(const OSSL_CMP_CTX *ctx,
X509_STORE *trusted_store, X509 *cert);
π DESCRIPTION π
So this is literally the API for validating the protection of CMP messages β¨ and that includes validating CMP message sender certificates and their paths, while optionally checking the revocation status of the certificate(s). multi-tasking queen behavior π
π¦ OSSL_CMP_validate_msg() π¦
OSSL_CMP_validate_msg() validates the protection of the given msg, which must be signature-based or using password-based MAC (PBM). no third option, bestie, pick a lane π
- in the signature case, a suitable trust anchor must be given in the CMP context
ctx - in the PBM case, the matching secret must have been set there using
OSSL_CMP_CTX_set1_secretValue(3)
In case of signature algorithm, the certificate to use for the signature check is preferably the one provided by a call to OSSL_CMP_CTX_set1_srvCert(3) π
If no such sender cert has been pinned, then candidate sender certificates are taken in this order:
- the list of certificates received in the
msgextraCerts - then any certificates provided before via
OSSL_CMP_CTX_set1_untrusted(3) - and then all trusted certificates provided via
OSSL_CMP_CTX_set0_trusted(3)
A candidate certificate is acceptable only if:
- it is currently valid (or the trust store contains a verification callback that overrides the verdict that the certificate is expired or not yet valid) β°
- its subject DN matches the
msgsender DN (as far as present) - its subject key identifier is present and matches the
senderKID(as far as the latter is present)
Each acceptable cert is tried in the given order to see if the message signature check succeeds and the cert and its path can be verified using any trust store set via OSSL_CMP_CTX_set0_trusted(3). slay, that's the whole gauntlet π₯
π the TOFU option π
If the option OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR was set by calling OSSL_CMP_CTX_set_option(3), then for an Initialization Response (IP) message any self-issued certificate from the msg extraCerts field may be used as a trust anchor for the path verification of an 'acceptable' cert β if it can be used also to validate the issued certificate returned in the IP message.
This is according to TS 33.310 [Network Domain Security (NDS); Authentication Framework (AF)] document specified by The 3rd Generation Partnership Project (3GPP).
β οΈ no cap, be careful: using this option is dangerous as the certificate obtained this way has not been authenticated (at least not at CMP level). Taking it over as a trust anchor implements trust-on-first-use (TOFU). it's giving "we met five seconds ago and I trust you with my life" ππ
π§ caching, because she remembers π§
Any cert that has been found as described above is cached and tried first when validating the signatures of subsequent messages in the same transaction. main character energy, honestly β she goes first every time π
π OSSL_CMP_validate_cert_path() π
OSSL_CMP_validate_cert_path() attempts to validate the given certificate and its path using the given store of trusted certs (possibly including CRLs and a cert verification callback) and non-trusted intermediate certs from the ctx.
π NOTES π
CMP is defined in RFC 9810. iykyk π
β RETURN VALUES β
OSSL_CMP_validate_msg() and OSSL_CMP_validate_cert_path() return 1 on success, 0 on error or validation failed.
so it's giving very binary: 1 = ate, 0 = didn't π
π SEE ALSO π
OSSL_CMP_CTX_new(3)OSSL_CMP_exec_certreq(3)OSSL_CMP_CTX_set1_secretValue(3)OSSL_CMP_CTX_set1_srvCert(3)OSSL_CMP_CTX_set1_untrusted(3)OSSL_CMP_CTX_set0_trusted(3)
go read them fr fr π«Ά
π HISTORY π
The OpenSSL CMP support was added in OpenSSL 3.0. a little vintage moment, we love a classic β¨
π COPYRIGHT π
Copyright 2007-2025 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>.
and that's the whole page bestie, tysm for reading π₯Ήπ this was version 3.5.9, dated 2026-09-29, brought to you by the OpenSSL girls and theys β stan forever, periodt ππΈ
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms