1OSSL_CMP_VALIDATE_MSG(3ossl) OpenSSL OSSL_CMP_VALIDATE_MSG(3ossl)
2
3
4
6 OSSL_CMP_validate_msg, OSSL_CMP_validate_cert_path - functions for
7 verifying CMP message protection
8
10 #include <openssl/cmp.h>
11 int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
12 int OSSL_CMP_validate_cert_path(const OSSL_CMP_CTX *ctx,
13 X509_STORE *trusted_store, X509 *cert);
14
16 This is the API for validating the protection of CMP messages, which
17 includes validating CMP message sender certificates and their paths
18 while optionally checking the revocation status of the certificates(s).
19
20 OSSL_CMP_validate_msg() validates the protection of the given msg,
21 which must be signature-based or using password-based MAC (PBM). In
22 the former case a suitable trust anchor must be given in the CMP
23 context ctx, and in the latter case the matching secret must have been
24 set there using OSSL_CMP_CTX_set1_secretValue(3).
25
26 In case of signature algorithm, the certificate to use for the
27 signature check is preferably the one provided by a call to
28 OSSL_CMP_CTX_set1_srvCert(3). If no such sender cert has been pinned
29 then candidate sender certificates are taken from the list of
30 certificates received in the msg extraCerts, then any certificates
31 provided before via OSSL_CMP_CTX_set1_untrusted(3), and then all
32 trusted certificates provided via OSSL_CMP_CTX_set0_trustedStore(3),
33 where a candidate is acceptable only if has not expired, its subject DN
34 matches the msg sender DN (as far as present), and its subject key
35 identifier is present and matches the senderKID (as far as the latter
36 present). Each acceptable cert is tried in the given order to see if
37 the message signature check succeeds and the cert and its path can be
38 verified using any trust store set via
39 OSSL_CMP_CTX_set0_trustedStore(3).
40
41 If the option OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR was set by
42 calling OSSL_CMP_CTX_set_option(3), for an Initialization Response (IP)
43 message any self-issued certificate from the msg extraCerts field may
44 also be used as trust anchor for the path verification of an acceptable
45 cert if it can be used also to validate the issued certificate returned
46 in the IP message. This is according to TS 33.310 [Network Domain
47 Security (NDS); Authentication Framework (AF)] document specified by
48 the The 3rd Generation Partnership Project (3GPP).
49
50 Any cert that has been found as described above is cached and tried
51 first when validating the signatures of subsequent messages in the same
52 transaction.
53
54 OSSL_CMP_validate_cert_path() attempts to validate the given
55 certificate and its path using the given store of trusted certs
56 (possibly including CRLs and a cert verification callback) and non-
57 trusted intermediate certs from the ctx.
58
60 CMP is defined in RFC 4210 (and CRMF in RFC 4211).
61
63 OSSL_CMP_validate_msg() and OSSL_CMP_validate_cert_path() return 1 on
64 success, 0 on error or validation failed.
65
67 OSSL_CMP_CTX_new(3), OSSL_CMP_exec_certreq(3),
68 OSSL_CMP_CTX_set1_secretValue(3), OSSL_CMP_CTX_set1_srvCert(3),
69 OSSL_CMP_CTX_set1_untrusted(3), OSSL_CMP_CTX_set0_trustedStore(3)
70
72 The OpenSSL CMP support was added in OpenSSL 3.0.
73
75 Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
76
77 Licensed under the Apache License 2.0 (the "License"). You may not use
78 this file except in compliance with the License. You can obtain a copy
79 in the file LICENSE in the source distribution or at
80 <https://www.openssl.org/source/license.html>.
81
82
83
843.0.9 2023-07-27 OSSL_CMP_VALIDATE_MSG(3ossl)