1=pod
2
3=head1 NAME
4
5ossl_cmp_mock_srv_new,
6ossl_cmp_mock_srv_free,
7ossl_cmp_mock_srv_set1_certOut,
8ossl_cmp_mock_srv_set1_chainOut,
9ossl_cmp_mock_srv_set1_caPubsOut,
10ossl_cmp_mock_srv_set_statusInfo,
11ossl_cmp_mock_srv_set_sendError,
12ossl_cmp_mock_srv_set_pollCount,
13ossl_cmp_mock_srv_set_checkAfterTime
14- functions used for testing with CMP mock server
15
16=head1 SYNOPSIS
17
18 #include "apps/cmp_mock_srv.h"
19
20 OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq);
21 void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx);
22
23 int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert);
24 int ossl_cmp_mock_srv_set1_chainOut(OSSL_CMP_SRV_CTX *srv_ctx,
25                                     STACK_OF(X509) *chain);
26 int ossl_cmp_mock_srv_set1_caPubsOut(OSSL_CMP_SRV_CTX *srv_ctx,
27                                      STACK_OF(X509) *caPubs);
28 int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status,
29                                      int fail_info, const char *text);
30 int ossl_cmp_mock_srv_set_sendError(OSSL_CMP_SRV_CTX *srv_ctx, int bodytype);
31 int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count);
32 int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec);
33
34=head1 DESCRIPTION
35
36ossl_cmp_mock_srv_new() allocates the contexts for the CMP mock server
37associated with the library context I<libctx> and property query string
38I<propq>, both of which may be NULL to select the defaults.
39
40ossl_cmp_mock_srv_free() deallocates the contexts for the CMP mock server.
41
42ossl_cmp_mock_srv_set1_certOut() sets the certificate to be returned in
43cp/ip/kup.
44
45ossl_cmp_mock_srv_set1_chainOut() sets the certificate chain to be added to
46the extraCerts in a cp/ip/kup.
47It should be useful for the validation of the certificate given via
48ossl_cmp_mock_srv_set1_certOut().
49
50ossl_cmp_mock_srv_set1_caPubsOut() sets the caPubs to be returned in an ip.
51
52ossl_cmp_mock_srv_set_statusInfo() sets the status info to be returned.
53
54ossl_cmp_mock_srv_set_sendError() enables enforcement of error responses
55for requests of the given I<bodytype>, or for all requests if I<bodytype> is 1.
56A I<bodytype> of -1 can be used to disable this feature, which is the default.
57
58ossl_cmp_mock_srv_set_pollCount() sets the number of polls before cert response.
59
60ossl_cmp_mock_srv_set_checkAfterTime() sets the number of seconds
61the client should wait for the next poll.
62
63=head1 NOTES
64
65CMP is defined in RFC 4210 (and CRMF in RFC 4211).
66
67=head1 RETURN VALUES
68
69ossl_cmp_mock_srv() returns a B<OSSL_CMP_SRV_CTX> structure on success,
70NULL on error.
71
72ossl_cmp_mock_srv_free() does not return a value.
73
74All other functions return 1 on success, 0 on error.
75
76=head1 HISTORY
77
78The OpenSSL CMP support was added in OpenSSL 3.0.
79
80=head1 COPYRIGHT
81
82Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
83
84Licensed under the Apache License 2.0 (the "License").  You may not use
85this file except in compliance with the License.  You can obtain a copy
86in the file LICENSE in the source distribution or at
87L<https://www.openssl.org/source/license.html>.
88
89=cut
90