1OSSL_CMP_SRV_CTX_NEW(3ossl)         OpenSSL        OSSL_CMP_SRV_CTX_NEW(3ossl)
2
3
4

NAME

6       OSSL_CMP_SRV_process_request, OSSL_CMP_CTX_server_perform,
7       OSSL_CMP_SRV_CTX_new, OSSL_CMP_SRV_CTX_free,
8       OSSL_CMP_SRV_cert_request_cb_t, OSSL_CMP_SRV_rr_cb_t,
9       OSSL_CMP_SRV_certConf_cb_t, OSSL_CMP_SRV_genm_cb_t,
10       OSSL_CMP_SRV_error_cb_t, OSSL_CMP_SRV_pollReq_cb_t,
11       OSSL_CMP_SRV_CTX_init, OSSL_CMP_SRV_CTX_get0_cmp_ctx,
12       OSSL_CMP_SRV_CTX_get0_custom_ctx,
13       OSSL_CMP_SRV_CTX_set_send_unprotected_errors,
14       OSSL_CMP_SRV_CTX_set_accept_unprotected,
15       OSSL_CMP_SRV_CTX_set_accept_raverified,
16       OSSL_CMP_SRV_CTX_set_grant_implicit_confirm - generic functions to set
17       up and control a CMP server
18

SYNOPSIS

20        #include <openssl/cmp.h>
21
22        OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx,
23                                                   const OSSL_CMP_MSG *req);
24        OSSL_CMP_MSG *OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx,
25                                                  const OSSL_CMP_MSG *req);
26        OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
27        void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx);
28
29        typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)(
30                                                        OSSL_CMP_SRV_CTX *srv_ctx,
31                                                        const OSSL_CMP_MSG *req,
32                                                        int certReqId,
33                                                        const OSSL_CRMF_MSG *crm,
34                                                        const X509_REQ *p10cr,
35                                                        X509 **certOut,
36                                                        STACK_OF(X509) **chainOut,
37                                                        STACK_OF(X509) **caPubs);
38        typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_rr_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
39                                                        const OSSL_CMP_MSG *req,
40                                                        const X509_NAME *issuer,
41                                                        const ASN1_INTEGER *serial);
42        typedef int (*OSSL_CMP_SRV_genm_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
43                                              const OSSL_CMP_MSG *req,
44                                              STACK_OF(OSSL_CMP_ITAV) *in,
45                                              STACK_OF(OSSL_CMP_ITAV) **out);
46        typedef void (*OSSL_CMP_SRV_error_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
47                                                const OSSL_CMP_MSG *req,
48                                                const OSSL_CMP_PKISI *statusInfo,
49                                                const ASN1_INTEGER *errorCode,
50                                                const OSSL_CMP_PKIFREETEXT *errorDetails);
51        typedef int (*OSSL_CMP_SRV_certConf_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
52                                                  const OSSL_CMP_MSG *req,
53                                                  int certReqId,
54                                                  const ASN1_OCTET_STRING *certHash,
55                                                  const OSSL_CMP_PKISI *si);
56        typedef int (*OSSL_CMP_SRV_pollReq_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
57                                                 const OSSL_CMP_MSG *req,
58                                                 int certReqId,
59                                                 OSSL_CMP_MSG **certReq,
60                                                 int64_t *check_after);
61        int OSSL_CMP_SRV_CTX_init(OSSL_CMP_SRV_CTX *srv_ctx, void *custom_ctx,
62                                  OSSL_CMP_SRV_cert_request_cb_t process_cert_request,
63                                  OSSL_CMP_SRV_rr_cb_t process_rr,
64                                  OSSL_CMP_SRV_genm_cb_t process_genm,
65                                  OSSL_CMP_SRV_error_cb_t process_error,
66                                  OSSL_CMP_SRV_certConf_cb_t process_certConf,
67                                  OSSL_CMP_SRV_pollReq_cb_t process_pollReq);
68
69        OSSL_CMP_CTX *OSSL_CMP_SRV_CTX_get0_cmp_ctx(const OSSL_CMP_SRV_CTX *srv_ctx);
70        void *OSSL_CMP_SRV_CTX_get0_custom_ctx(const OSSL_CMP_SRV_CTX *srv_ctx);
71
72        int OSSL_CMP_SRV_CTX_set_send_unprotected_errors(OSSL_CMP_SRV_CTX *srv_ctx,
73                                                         int val);
74        int OSSL_CMP_SRV_CTX_set_accept_unprotected(OSSL_CMP_SRV_CTX *srv_ctx, int val);
75        int OSSL_CMP_SRV_CTX_set_accept_raverified(OSSL_CMP_SRV_CTX *srv_ctx, int val);
76        int OSSL_CMP_SRV_CTX_set_grant_implicit_confirm(OSSL_CMP_SRV_CTX *srv_ctx,
77                                                        int val);
78

DESCRIPTION

80       OSSL_CMP_SRV_process_request() implements the generic aspects of a CMP
81       server.  Its arguments are the OSSL_CMP_SRV_CTX srv_ctx and the CMP
82       request message req. It does the typical generic checks on req, calls
83       the respective callback function (if present) for more specific
84       processing, and then assembles a result message, which may be a CMP
85       error message.  If after return of the function the expression
86       OSSL_CMP_CTX_get_status(OSSL_CMP_SRV_CTX_get0_cmp_ctx(srv_ctx)) yields
87       -1 then the function has closed the current transaction, which may be
88       due to normal successful end of the transaction or due to an error.
89
90       OSSL_CMP_CTX_server_perform() is an interface to
91       OSSL_CMP_SRV_process_request() that can be used by a CMP client in the
92       same way as OSSL_CMP_MSG_http_perform(3).  The OSSL_CMP_SRV_CTX must be
93       set as transfer_cb_arg of client_ctx.
94
95       OSSL_CMP_SRV_CTX_new() creates and initializes an OSSL_CMP_SRV_CTX
96       structure associated with the library context libctx and property query
97       string propq, both of which may be NULL to select the defaults.
98
99       OSSL_CMP_SRV_CTX_free() deletes the given srv_ctx.
100
101       OSSL_CMP_SRV_CTX_init() sets in the given srv_ctx a custom server
102       context pointer as well as callback functions performing the specific
103       processing of CMP certificate requests, revocation requests,
104       certificate confirmation requests, general messages, error messages,
105       and poll requests.  All arguments except srv_ctx may be NULL.  If a
106       callback for some message type is not given this means that the
107       respective type of CMP message is not supported by the server.
108
109       OSSL_CMP_SRV_CTX_get0_cmp_ctx() returns the OSSL_CMP_CTX from the
110       srv_ctx.
111
112       OSSL_CMP_SRV_CTX_get0_custom_ctx() returns the custom server context
113       from srv_ctx that has been set using OSSL_CMP_SRV_CTX_init().
114
115       OSSL_CMP_SRV_CTX_set_send_unprotected_errors() enables sending error
116       messages and other forms of negative responses unprotected.
117
118       OSSL_CMP_SRV_CTX_set_accept_unprotected() enables acceptance of
119       requests without protection of with invalid protection.
120
121       OSSL_CMP_SRV_CTX_set_accept_raverified() enables acceptance of
122       ir/cr/kur messages with POPO 'RAVerified'.
123
124       OSSL_CMP_SRV_CTX_set_grant_implicit_confirm() enables granting implicit
125       confirmation of newly enrolled certificates if requested.
126

NOTES

128       CMP is defined in RFC 4210 (and CRMF in RFC 4211).
129
130       So far the CMP server implementation is limited to one request per CMP
131       message (and consequently to at most one response component per CMP
132       message).
133

RETURN VALUES

135       OSSL_CMP_SRV_CTX_new() returns a OSSL_CMP_SRV_CTX structure on success,
136       NULL on error.
137
138       OSSL_CMP_SRV_CTX_free() does not return a value.
139
140       OSSL_CMP_SRV_CTX_get0_cmp_ctx() returns a OSSL_CMP_CTX structure on
141       success, NULL on error.
142
143       OSSL_CMP_SRV_CTX_get0_custom_ctx() returns the custom server context
144       that has been set using OSSL_CMP_SRV_CTX_init().
145
146       All other functions return 1 on success, 0 on error.
147

HISTORY

149       The OpenSSL CMP support was added in OpenSSL 3.0.
150
152       Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
153
154       Licensed under the Apache License 2.0 (the "License").  You may not use
155       this file except in compliance with the License.  You can obtain a copy
156       in the file LICENSE in the source distribution or at
157       <https://www.openssl.org/source/license.html>.
158
159
160
1613.0.9                             2023-07-27       OSSL_CMP_SRV_CTX_NEW(3ossl)
Impressum