diff options
Diffstat (limited to 'upstream/debian-unstable/man3/OSSL_CMP_CTX_new.3ssl')
-rw-r--r-- | upstream/debian-unstable/man3/OSSL_CMP_CTX_new.3ssl | 129 |
1 files changed, 91 insertions, 38 deletions
diff --git a/upstream/debian-unstable/man3/OSSL_CMP_CTX_new.3ssl b/upstream/debian-unstable/man3/OSSL_CMP_CTX_new.3ssl index 6fefecf7..2a33337b 100644 --- a/upstream/debian-unstable/man3/OSSL_CMP_CTX_new.3ssl +++ b/upstream/debian-unstable/man3/OSSL_CMP_CTX_new.3ssl @@ -55,7 +55,7 @@ .\" ======================================================================== .\" .IX Title "OSSL_CMP_CTX_NEW 3SSL" -.TH OSSL_CMP_CTX_NEW 3SSL 2024-02-03 3.1.5 OpenSSL +.TH OSSL_CMP_CTX_NEW 3SSL 2024-04-04 3.2.2-dev OpenSSL .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -64,6 +64,7 @@ OSSL_CMP_CTX_new, OSSL_CMP_CTX_free, OSSL_CMP_CTX_reinit, +OSSL_CMP_CTX_get0_libctx, OSSL_CMP_CTX_get0_propq, OSSL_CMP_CTX_set_option, OSSL_CMP_CTX_get_option, OSSL_CMP_CTX_set_log_cb, @@ -83,7 +84,9 @@ OSSL_CMP_CTX_set_transfer_cb_arg, OSSL_CMP_CTX_get_transfer_cb_arg, OSSL_CMP_CTX_set1_srvCert, OSSL_CMP_CTX_set1_expected_sender, +OSSL_CMP_CTX_set0_trusted, OSSL_CMP_CTX_set0_trustedStore, +OSSL_CMP_CTX_get0_trusted, OSSL_CMP_CTX_get0_trustedStore, OSSL_CMP_CTX_set1_untrusted, OSSL_CMP_CTX_get0_untrusted, @@ -99,6 +102,7 @@ OSSL_CMP_CTX_set1_extraCertsOut, OSSL_CMP_CTX_set0_newPkey, OSSL_CMP_CTX_get0_newPkey, OSSL_CMP_CTX_set1_issuer, +OSSL_CMP_CTX_set1_serialNumber, OSSL_CMP_CTX_set1_subjectName, OSSL_CMP_CTX_push1_subjectAltName, OSSL_CMP_CTX_set0_reqExtensions, @@ -115,6 +119,7 @@ OSSL_CMP_CTX_get_certConf_cb_arg, OSSL_CMP_CTX_get_status, OSSL_CMP_CTX_get0_statusString, OSSL_CMP_CTX_get_failInfoCode, +OSSL_CMP_CTX_get0_validatedSrvCert, OSSL_CMP_CTX_get0_newCert, OSSL_CMP_CTX_get1_newChain, OSSL_CMP_CTX_get1_caPubs, @@ -130,6 +135,8 @@ OSSL_CMP_CTX_set1_senderNonce \& OSSL_CMP_CTX *OSSL_CMP_CTX_new(OSSL_LIB_CTX *libctx, const char *propq); \& void OSSL_CMP_CTX_free(OSSL_CMP_CTX *ctx); \& int OSSL_CMP_CTX_reinit(OSSL_CMP_CTX *ctx); +\& OSSL_LIB_CTX *OSSL_CMP_CTX_get0_libctx(const OSSL_CMP_CTX *ctx); +\& const char *OSSL_CMP_CTX_get0_propq(const OSSL_CMP_CTX *ctx); \& int OSSL_CMP_CTX_set_option(OSSL_CMP_CTX *ctx, int opt, int val); \& int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt); \& @@ -158,7 +165,9 @@ OSSL_CMP_CTX_set1_senderNonce \& int OSSL_CMP_CTX_set1_srvCert(OSSL_CMP_CTX *ctx, X509 *cert); \& int OSSL_CMP_CTX_set1_expected_sender(OSSL_CMP_CTX *ctx, \& const X509_NAME *name); +\& #define OSSL_CMP_CTX_set0_trusted OSSL_CMP_CTX_set0_trustedStore \& int OSSL_CMP_CTX_set0_trustedStore(OSSL_CMP_CTX *ctx, X509_STORE *store); +\& #define OSSL_CMP_CTX_get0_trusted OSSL_CMP_CTX_get0_trustedStore \& X509_STORE *OSSL_CMP_CTX_get0_trustedStore(const OSSL_CMP_CTX *ctx); \& int OSSL_CMP_CTX_set1_untrusted(OSSL_CMP_CTX *ctx, STACK_OF(X509) *certs); \& STACK_OF(X509) *OSSL_CMP_CTX_get0_untrusted(const OSSL_CMP_CTX *ctx); @@ -184,6 +193,7 @@ OSSL_CMP_CTX_set1_senderNonce \& int OSSL_CMP_CTX_set0_newPkey(OSSL_CMP_CTX *ctx, int priv, EVP_PKEY *pkey); \& EVP_PKEY *OSSL_CMP_CTX_get0_newPkey(const OSSL_CMP_CTX *ctx, int priv); \& int OSSL_CMP_CTX_set1_issuer(OSSL_CMP_CTX *ctx, const X509_NAME *name); +\& int OSSL_CMP_CTX_set1_serialNumber(OSSL_CMP_CTX *ctx, const ASN1_INTEGER *sn); \& int OSSL_CMP_CTX_set1_subjectName(OSSL_CMP_CTX *ctx, const X509_NAME *name); \& int OSSL_CMP_CTX_push1_subjectAltName(OSSL_CMP_CTX *ctx, \& const GENERAL_NAME *name); @@ -210,6 +220,7 @@ OSSL_CMP_CTX_set1_senderNonce \& OSSL_CMP_PKIFREETEXT *OSSL_CMP_CTX_get0_statusString(const OSSL_CMP_CTX *ctx); \& int OSSL_CMP_CTX_get_failInfoCode(const OSSL_CMP_CTX *ctx); \& +\& X509 *OSSL_CMP_CTX_get0_validatedSrvCert(const OSSL_CMP_CTX *ctx); \& X509 *OSSL_CMP_CTX_get0_newCert(const OSSL_CMP_CTX *ctx); \& STACK_OF(X509) *OSSL_CMP_CTX_get1_newChain(const OSSL_CMP_CTX *ctx); \& STACK_OF(X509) *OSSL_CMP_CTX_get1_caPubs(const OSSL_CMP_CTX *ctx); @@ -243,6 +254,12 @@ from the last executed transaction. It also clears any ITAVs that were added by \fBOSSL_CMP_CTX_push0_genm_ITAV()\fR. All other field values (i.e., CMP options) are retained for potential reuse. .PP +\&\fBOSSL_CMP_CTX_get0_libctx()\fR returns the \fIlibctx\fR argument that was used +when constructing \fIctx\fR with \fBOSSL_CMP_CTX_new()\fR, which may be NULL. +.PP +\&\fBOSSL_CMP_CTX_get0_propq()\fR returns the \fIpropq\fR argument that was used +when constructing \fIctx\fR with \fBOSSL_CMP_CTX_new()\fR, which may be NULL. +.PP \&\fBOSSL_CMP_CTX_set_option()\fR sets the given value for the given option (e.g., OSSL_CMP_OPT_IMPLICIT_CONFIRM) in the given OSSL_CMP_CTX structure. .PP @@ -280,6 +297,18 @@ The following options can be set: \& A value <= 0 means no limitation (waiting indefinitely). \& Default is 0. .Ve +.IP \fBOSSL_CMP_OPT_USE_TLS\fR 4 +.IX Item "OSSL_CMP_OPT_USE_TLS" +.Vb 8 +\& Use this option to indicate to the HTTP implementation +\& whether TLS is going to be used for the connection (resulting in HTTPS). +\& The value 1 indicates that TLS is used for client\-side HTTP connections, +\& which needs to be implemented via a callback function set by +\& OSSL_CMP_CTX_set_http_cb(). +\& The value 0 indicates that TLS is not used. +\& Default is \-1 for backward compatibility: TLS is used by the client side +\& if and only if OSSL_CMP_CTX_set_http_cb_arg() sets a non\-NULL I<arg>. +.Ve .IP \fBOSSL_CMP_OPT_VALIDITY_DAYS\fR 4 .IX Item "OSSL_CMP_OPT_VALIDITY_DAYS" .Vb 1 @@ -429,23 +458,18 @@ Defaults to the environment variable \f(CW\*(C`no_proxy\*(C'\fR if set, else \f( function, which has the prototype .PP .Vb 1 -\& typedef BIO *(*HTTP_bio_cb_t) (BIO *bio, void *ctx, int connect, int detail); +\& typedef BIO *(*HTTP_bio_cb_t) (BIO *bio, void *arg, int connect, int detail); .Ve .PP -The callback may modify the \fIbio\fR provided by \fBOSSL_CMP_MSG_http_perform\fR\|(3), -whereby it may make use of a custom defined argument \fIctx\fR -stored in the OSSL_CMP_CTX by means of \fBOSSL_CMP_CTX_set_http_cb_arg()\fR. -During connection establishment, just after calling \fBBIO_do_connect_retry()\fR, -the function is invoked with the \fIconnect\fR argument being 1 and the \fIdetail\fR -argument being 1 if HTTPS is requested, i.e., SSL/TLS should be enabled. On -disconnect \fIconnect\fR is 0 and \fIdetail\fR is 1 in case no error occurred, else 0. -For instance, on connect the function may prepend a TLS BIO to implement HTTPS; -after disconnect it may do some diagnostic output and/or specific cleanup. -The function should return NULL to indicate failure. -After disconnect the modified BIO will be deallocated using \fBBIO_free_all()\fR. -.PP -\&\fBOSSL_CMP_CTX_set_http_cb_arg()\fR sets an argument, respectively a pointer to -a structure containing arguments, +The callback may modify the \fIbio\fR provided by \fBOSSL_CMP_MSG_http_perform\fR\|(3) +as described for the \fIbio_update_fn\fR parameter of \fBOSSL_HTTP_open\fR\|(3). +The callback may make use of a custom defined argument \fIarg\fR, +as described for the \fIarg\fR parameter of \fBOSSL_HTTP_open\fR\|(3). +The argument is stored in the OSSL_CMP_CTX using \fBOSSL_CMP_CTX_set_http_cb_arg()\fR. +See also the \fBOSSL_CMP_OPT_USE_TLS\fR option described above. +.PP +\&\fBOSSL_CMP_CTX_set_http_cb_arg()\fR sets the argument, respectively a pointer to +a structure containing arguments such as an \fBSSL_CTX\fR structure, optionally to be used by the http connect/disconnect callback function. \&\fIarg\fR is not consumed, and it must therefore explicitly be freed when not needed any more. \fIarg\fR may be NULL to clear the entry. @@ -462,8 +486,6 @@ which has the type \& const OSSL_CMP_MSG *req); .Ve .PP -Returns 1 on success, 0 on error. -.PP Default is NULL, which implies the use of \fBOSSL_CMP_MSG_http_perform\fR\|(3). The callback should send the CMP request message it obtains via the \fIreq\fR parameter and on success return the response, else it must return NULL. @@ -482,8 +504,8 @@ to a structure containing arguments, previously set by .PP \&\fBOSSL_CMP_CTX_set1_srvCert()\fR sets the expected server cert in \fIctx\fR and trusts it directly (even if it is expired) when verifying signed response messages. -This pins the accepted CMP server and -results in ignoring whatever may be set using \fBOSSL_CMP_CTX_set0_trustedStore()\fR. +This pins the accepted CMP server +and results in ignoring whatever may be set using \fBOSSL_CMP_CTX_set0_trusted()\fR. Any previously set value is freed. The \fIcert\fR argument may be NULL to clear the entry. If set, the subject of the certificate is also used @@ -500,8 +522,9 @@ Note that this gives slightly more freedom than \fBOSSL_CMP_CTX_set1_srvCert()\f which pins the server to the holder of a particular certificate, while the expected sender name will continue to match after updates of the server cert. .PP -\&\fBOSSL_CMP_CTX_set0_trustedStore()\fR -sets in the CMP context \fIctx\fR the certificate store of type X509_STORE +\&\fBOSSL_CMP_CTX_set0_trusted()\fR is an alias of the original +\&\fBOSSL_CMP_CTX_set0_trustedStore()\fR. +It sets in the CMP context \fIctx\fR the certificate store of type X509_STORE containing trusted certificates, typically of root CAs. This is ignored when a certificate is pinned using \fBOSSL_CMP_CTX_set1_srvCert()\fR. The store may also hold CRLs and a certificate verification callback function @@ -509,8 +532,9 @@ used for signature-based peer authentication. Any store entry already set before is freed. When given a NULL parameter the entry is cleared. .PP -\&\fBOSSL_CMP_CTX_get0_trustedStore()\fR -extracts from the CMP context \fIctx\fR the pointer to the currently set +\&\fBOSSL_CMP_CTX_get0_trusted()\fR is an alias of the original +\&\fBOSSL_CMP_CTX_get0_trustedStore()\fR. +It extracts from the CMP context \fIctx\fR the pointer to the currently set certificate store containing trust anchors etc., or an empty store if unset. .PP \&\fBOSSL_CMP_CTX_set1_untrusted()\fR sets up a list of non-trusted certificates @@ -519,18 +543,20 @@ signer certificate, for the own TLS certificate (if any), when verifying peer CMP protection certificates, and when verifying newly enrolled certificates. The reference counts of those certificates handled successfully are increased. .PP -OSSL_CMP_CTX_get0_untrusted(OSSL_CMP_CTX *ctx) returns a pointer to the -list of untrusted certs, which may be empty if unset. +\&\fBOSSL_CMP_CTX_get0_untrusted()\fR returns a pointer to the +list of untrusted certs in \fIctx\fR, which may be empty if unset. .PP -\&\fBOSSL_CMP_CTX_set1_cert()\fR sets the CMP signer certificate, also called protection -certificate, related to the private key for signature-based message protection. +\&\fBOSSL_CMP_CTX_set1_cert()\fR sets the CMP \fIsigner certificate\fR, +also called \fIprotection certificate\fR, +related to the private key used for signature-based CMP message protection. Therefore the public key of this \fIcert\fR must correspond to the private key set before or thereafter via \fBOSSL_CMP_CTX_set1_pkey()\fR. When using signature-based protection of CMP request messages this CMP signer certificate will be included first in the extraCerts field. It serves as fallback reference certificate, see \fBOSSL_CMP_CTX_set1_oldCert()\fR. The subject of this \fIcert\fR will be used as the sender field of outgoing -messages, while the subject of any cert set via \fBOSSL_CMP_CTX_set1_oldCert()\fR +messages, while the subject of any cert set via \fBOSSL_CMP_CTX_set1_oldCert()\fR, +the subject of any PKCS#10 CSR set via \fBOSSL_CMP_CTX_set1_p10CSR()\fR, and any value set via \fBOSSL_CMP_CTX_set1_subjectName()\fR are used as fallback. .PP The \fIcert\fR argument may be NULL to clear the entry. @@ -610,6 +636,9 @@ private component then NULL is returned. \&\fBOSSL_CMP_CTX_set1_issuer()\fR sets the name of the intended issuer that will be set in the CertTemplate, i.e., the X509 name of the CA server. .PP +\&\fBOSSL_CMP_CTX_set1_serialNumber()\fR sets the serial number optionally used to +select the certificate to be revoked in Revocation Requests (RR). +.PP \&\fBOSSL_CMP_CTX_set1_subjectName()\fR sets the subject DN that will be used in the CertTemplate structure when requesting a new cert. For Key Update Requests (KUR), it defaults to the subject DN of the reference certificate, @@ -642,17 +671,22 @@ to the X509_EXTENSIONS of the requested certificate template. .PP \&\fBOSSL_CMP_CTX_set1_oldCert()\fR sets the old certificate to be updated in Key Update Requests (KUR) or to be revoked in Revocation Requests (RR). -It must be given for RR, else it defaults to the CMP signer certificate. -The \fIreference certificate\fR determined in this way, if any, is also used for -deriving default subject DN, public key, Subject Alternative Names, and the -default issuer entry in the requested certificate template of IR/CR/KUR. +For RR, this is ignored if an issuer name and a serial number are provided using +\&\fBOSSL_CMP_CTX_set1_issuer()\fR and \fBOSSL_CMP_CTX_set1_serialNumber()\fR, respectively. +For IR/CR/KUR this sets the \fIreference certificate\fR, +which otherwise defaults to the CMP signer certificate. +The \fIreference certificate\fR determined this way, if any, is used for providing +default public key, subject DN, Subject Alternative Names, and issuer DN entries +in the requested certificate template of IR/CR/KUR messages. +.PP The subject of the reference certificate is used as the sender field value in CMP message headers. Its issuer is used as default recipient in CMP message headers. .PP \&\fBOSSL_CMP_CTX_set1_p10CSR()\fR sets the PKCS#10 CSR to use in P10CR messages. -If such a CSR is provided, its subject, public key, and extension fields are -also used as fallback values for the certificate template of IR/CR/KUR messages. +If such a CSR is provided, its subject and public key fields are also +used as fallback values for the certificate template of IR/CR/KUR/RR messages, +and any extensions included are added to the template of IR/CR/KUR messages. .PP \&\fBOSSL_CMP_CTX_push0_genm_ITAV()\fR adds \fIitav\fR to the stack in the \fIctx\fR which will be the body of a General Message sent with this context. @@ -727,6 +761,13 @@ This is a bit field and the flags for it are specified in the header file The flags start with OSSL_CMP_CTX_FAILINFO, for example: OSSL_CMP_CTX_FAILINFO_badAlg. Returns \-1 if the failInfoCode field is unset. .PP +\&\fBOSSL_CMP_CTX_get0_validatedSrvCert()\fR returns +the successfully validated certificate, if any, that the CMP server used +in the current transaction for signature-based response message protection, +or NULL if the server used MAC-based protection. +The value is relevant only at the end of a successful transaction. +It may be used to check the authorization of the server based on its cert. +.PP \&\fBOSSL_CMP_CTX_get0_newCert()\fR returns the pointer to the newly obtained certificate in case it is available, else NULL. .PP @@ -757,13 +798,15 @@ CMP is defined in RFC 4210 (and CRMF in RFC 4211). \&\fBOSSL_CMP_CTX_free()\fR and \fBOSSL_CMP_CTX_print_errors()\fR do not return anything. .PP \&\fBOSSL_CMP_CTX_new()\fR, +\&\fBOSSL_CMP_CTX_get0_libctx()\fR, \fBOSSL_CMP_CTX_get0_propq()\fR, \&\fBOSSL_CMP_CTX_get_http_cb_arg()\fR, \&\fBOSSL_CMP_CTX_get_transfer_cb_arg()\fR, -\&\fBOSSL_CMP_CTX_get0_trustedStore()\fR, +\&\fBOSSL_CMP_CTX_get0_trusted()\fR, \&\fBOSSL_CMP_CTX_get0_untrusted()\fR, \&\fBOSSL_CMP_CTX_get0_newPkey()\fR, \&\fBOSSL_CMP_CTX_get_certConf_cb_arg()\fR, \&\fBOSSL_CMP_CTX_get0_statusString()\fR, +\&\fBOSSL_CMP_CTX_get0_validatedSrvCert()\fR, \&\fBOSSL_CMP_CTX_get0_newCert()\fR, \&\fBOSSL_CMP_CTX_get0_newChain()\fR, \&\fBOSSL_CMP_CTX_get1_caPubs()\fR, and @@ -794,7 +837,7 @@ Set up a CMP client context for sending requests and verifying responses: \& OSSL_CMP_CTX_set1_server(cmp_ctx, name_or_address); \& OSSL_CMP_CTX_set1_serverPort(cmp_ctx, port_string); \& OSSL_CMP_CTX_set1_serverPath(cmp_ctx, path_or_alias); -\& OSSL_CMP_CTX_set0_trustedStore(cmp_ctx, ts); +\& OSSL_CMP_CTX_set0_trusted(cmp_ctx, ts); .Ve .PP Set up symmetric credentials for MAC-based message protection such as PBM: @@ -865,12 +908,22 @@ the id-it-signKeyPairTypes OID and prints info on the General Response contents: \&\fBOSSL_CMP_exec_IR_ses\fR\|(3), \fBOSSL_CMP_exec_CR_ses\fR\|(3), \&\fBOSSL_CMP_exec_KUR_ses\fR\|(3), \fBOSSL_CMP_exec_GENM_ses\fR\|(3), \&\fBOSSL_CMP_exec_certreq\fR\|(3), \fBOSSL_CMP_MSG_http_perform\fR\|(3), -\&\fBERR_print_errors_cb\fR\|(3) +\&\fBERR_print_errors_cb\fR\|(3), \fBOSSL_HTTP_open\fR\|(3) .SH HISTORY .IX Header "HISTORY" The OpenSSL CMP support was added in OpenSSL 3.0. .PP +\&\fBOSSL_CMP_CTX_get0_trustedStore()\fR was renamed to \fBOSSL_CMP_CTX_get0_trusted()\fR and +\&\fBOSSL_CMP_CTX_set0_trustedStore()\fR was renamed to \fBOSSL_CMP_CTX_set0_trusted()\fR, +using macros, while keeping the old names for backward compatibility, +in OpenSSL 3.2. +.PP \&\fBOSSL_CMP_CTX_reset_geninfo_ITAVs()\fR was added in OpenSSL 3.0.8. +.PP +\&\fBOSSL_CMP_CTX_get0_libctx()\fR, \fBOSSL_CMP_CTX_get0_propq()\fR, and +\&\fBOSSL_CMP_CTX_get0_validatedSrvCert()\fR were added in OpenSSL 3.2. +.PP +\&\fBOSSL_CMP_CTX_set1_serialNumber()\fR was added in OpenSSL 3.2. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2007\-2023 The OpenSSL Project Authors. All Rights Reserved. |