]>
Commit | Line | Data |
---|---|---|
62dcd2aa DDO |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
5 | ossl_cmp_mock_srv_new, | |
6 | ossl_cmp_mock_srv_free, | |
b971d419 | 7 | ossl_cmp_mock_srv_set1_refCert, |
62dcd2aa DDO |
8 | ossl_cmp_mock_srv_set1_certOut, |
9 | ossl_cmp_mock_srv_set1_chainOut, | |
10 | ossl_cmp_mock_srv_set1_caPubsOut, | |
01b04851 DDO |
11 | ossl_cmp_mock_srv_set1_newWithNew, |
12 | ossl_cmp_mock_srv_set1_newWithOld, | |
13 | ossl_cmp_mock_srv_set1_oldWithNew, | |
62dcd2aa | 14 | ossl_cmp_mock_srv_set_statusInfo, |
6f88876d | 15 | ossl_cmp_mock_srv_set_sendError, |
62dcd2aa DDO |
16 | ossl_cmp_mock_srv_set_pollCount, |
17 | ossl_cmp_mock_srv_set_checkAfterTime | |
18 | - functions used for testing with CMP mock server | |
19 | ||
20 | =head1 SYNOPSIS | |
21 | ||
1a7cd250 | 22 | #include "apps/cmp_mock_srv.h" |
62dcd2aa | 23 | |
b4250010 | 24 | OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq); |
62dcd2aa DDO |
25 | void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx); |
26 | ||
01b04851 DDO |
27 | int ossl_cmp_mock_srv_set1_refCert(OSSL_CMP_SRV_CTX *ctx, const X509 *cert); |
28 | int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *ctx, const X509 *cert); | |
62dcd2aa | 29 | int ossl_cmp_mock_srv_set1_chainOut(OSSL_CMP_SRV_CTX *srv_ctx, |
01b04851 | 30 | const STACK_OF(X509) *chain); |
62dcd2aa | 31 | int ossl_cmp_mock_srv_set1_caPubsOut(OSSL_CMP_SRV_CTX *srv_ctx, |
01b04851 DDO |
32 | const STACK_OF(X509) *caPubs); |
33 | int ossl_cmp_mock_srv_set1_newWithNew(OSSL_CMP_SRV_CTX *ctx, const X509 *cert); | |
34 | int ossl_cmp_mock_srv_set1_newWithOld(OSSL_CMP_SRV_CTX *ctx, const X509 *cert); | |
35 | int ossl_cmp_mock_srv_set1_oldWithNew(OSSL_CMP_SRV_CTX *ctx, const X509 *cert); | |
62dcd2aa DDO |
36 | int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status, |
37 | int fail_info, const char *text); | |
6f88876d | 38 | int ossl_cmp_mock_srv_set_sendError(OSSL_CMP_SRV_CTX *srv_ctx, int bodytype); |
62dcd2aa DDO |
39 | int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count); |
40 | int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec); | |
41 | ||
42 | =head1 DESCRIPTION | |
43 | ||
1a7cd250 DDO |
44 | ossl_cmp_mock_srv_new() allocates the contexts for the CMP mock server |
45 | associated with the library context I<libctx> and property query string | |
46 | I<propq>, both of which may be NULL to select the defaults. | |
62dcd2aa DDO |
47 | |
48 | ossl_cmp_mock_srv_free() deallocates the contexts for the CMP mock server. | |
49 | ||
01b04851 DDO |
50 | ossl_cmp_mock_srv_set1_refCert() sets the reference certificate (or NULL) |
51 | to be expected for rr messages and for any oldCertID included in kur messages. | |
b971d419 | 52 | |
01b04851 DDO |
53 | ossl_cmp_mock_srv_set1_certOut() sets the certificate (or NULL) |
54 | to be returned in cp/ip/kup messages. | |
b971d419 DDO |
55 | Note that on each certificate request the mock server does not produce |
56 | a fresh certificate but just returns the same pre-existing certificate. | |
62dcd2aa | 57 | |
01b04851 DDO |
58 | ossl_cmp_mock_srv_set1_chainOut() sets the certificate chain (or NULL) |
59 | to be added to the extraCerts in a cp/ip/kup message. | |
b971d419 | 60 | It should be useful for the validation of the certificate given via |
a6e1e9eb | 61 | ossl_cmp_mock_srv_set1_certOut(). |
62dcd2aa | 62 | |
01b04851 DDO |
63 | ossl_cmp_mock_srv_set1_caPubsOut() sets list of certificates (or NULL) to be |
64 | returned in the caPubs field an ip message and in a genp of infoType caCerts. | |
65 | ||
66 | ossl_cmp_mock_srv_set1_newWithNew() sets the value (which may be NULL) | |
67 | of the newWithNew field to be returned in a genp of infoType rootCaKeyUpdate. | |
68 | ||
69 | ossl_cmp_mock_srv_set1_newWithOld() sets the value (which may be NULL) | |
70 | of the newWithOld field to be returned in a genp of infoType rootCaKeyUpdate. | |
71 | ||
72 | ossl_cmp_mock_srv_set1_oldWithNew() sets the value (which may be NULL) | |
73 | of the oldWithNew field to be returned in a genp of infoType rootCaKeyUpdate. | |
62dcd2aa | 74 | |
a6e1e9eb | 75 | ossl_cmp_mock_srv_set_statusInfo() sets the status info to be returned. |
62dcd2aa | 76 | |
6f88876d DDO |
77 | ossl_cmp_mock_srv_set_sendError() enables enforcement of error responses |
78 | for requests of the given I<bodytype>, or for all requests if I<bodytype> is 1. | |
79 | A I<bodytype> of -1 can be used to disable this feature, which is the default. | |
62dcd2aa | 80 | |
a6e1e9eb | 81 | ossl_cmp_mock_srv_set_pollCount() sets the number of polls before cert response. |
62dcd2aa | 82 | |
a6e1e9eb | 83 | ossl_cmp_mock_srv_set_checkAfterTime() sets the number of seconds |
62dcd2aa DDO |
84 | the client should wait for the next poll. |
85 | ||
62dcd2aa DDO |
86 | =head1 NOTES |
87 | ||
88 | CMP is defined in RFC 4210 (and CRMF in RFC 4211). | |
89 | ||
90 | =head1 RETURN VALUES | |
91 | ||
92 | ossl_cmp_mock_srv() returns a B<OSSL_CMP_SRV_CTX> structure on success, | |
93 | NULL on error. | |
94 | ||
95 | ossl_cmp_mock_srv_free() does not return a value. | |
96 | ||
97 | All other functions return 1 on success, 0 on error. | |
98 | ||
99 | =head1 HISTORY | |
100 | ||
101 | The OpenSSL CMP support was added in OpenSSL 3.0. | |
102 | ||
103 | =head1 COPYRIGHT | |
104 | ||
da1c088f | 105 | Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved. |
62dcd2aa DDO |
106 | |
107 | Licensed under the Apache License 2.0 (the "License"). You may not use | |
108 | this file except in compliance with the License. You can obtain a copy | |
109 | in the file LICENSE in the source distribution or at | |
110 | L<https://www.openssl.org/source/license.html>. | |
111 | ||
112 | =cut |