Rename OSSL_CMP_CTX_set1_clCert() to OSSL_CMP_CTX_set1_cert()
[openssl.git] / test / cmp_msg_test.c
1 /*
2  * Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
3  * Copyright Nokia 2007-2019
4  * Copyright Siemens AG 2015-2019
5  *
6  * Licensed under the Apache License 2.0 (the "License").  You may not use
7  * this file except in compliance with the License.  You can obtain a copy
8  * in the file LICENSE in the source distribution or at
9  * https://www.openssl.org/source/license.html
10  */
11
12 #include "cmp_testlib.h"
13
14 DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
15
16 static const char *server_cert_f;
17 static const char *pkcs10_f;
18
19 typedef struct test_fixture {
20     const char *test_case_name;
21     OSSL_CMP_CTX *cmp_ctx;
22     /* for msg create tests */
23     int bodytype;
24     int err_code;
25     /* for certConf */
26     int fail_info;
27     /* for protection tests */
28     OSSL_CMP_MSG *msg;
29     int expected;
30     /* for error and response messages */
31     OSSL_CMP_PKISI *si;
32 } CMP_MSG_TEST_FIXTURE;
33
34 static unsigned char ref[CMP_TEST_REFVALUE_LENGTH];
35
36 static void tear_down(CMP_MSG_TEST_FIXTURE *fixture)
37 {
38     OSSL_CMP_CTX_free(fixture->cmp_ctx);
39     OSSL_CMP_MSG_free(fixture->msg);
40     OSSL_CMP_PKISI_free(fixture->si);
41     OPENSSL_free(fixture);
42 }
43
44 #define SET_OPT_UNPROTECTED_SEND(ctx, val) \
45     OSSL_CMP_CTX_set_option((ctx), OSSL_CMP_OPT_UNPROTECTED_SEND, (val))
46 static CMP_MSG_TEST_FIXTURE *set_up(const char *const test_case_name)
47 {
48     CMP_MSG_TEST_FIXTURE *fixture;
49
50     if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture))))
51         return NULL;
52     fixture->test_case_name = test_case_name;
53
54     if (!TEST_ptr(fixture->cmp_ctx = OSSL_CMP_CTX_new())
55             || !TEST_true(SET_OPT_UNPROTECTED_SEND(fixture->cmp_ctx, 1))
56             || !TEST_true(OSSL_CMP_CTX_set1_referenceValue(fixture->cmp_ctx,
57                                                            ref, sizeof(ref)))) {
58         tear_down(fixture);
59         return NULL;
60     }
61     return fixture;
62 }
63
64 static EVP_PKEY *newkey = NULL;
65 static X509 *cert = NULL;
66
67 #define EXECUTE_MSG_CREATION_TEST(expr) \
68     do { \
69         OSSL_CMP_MSG *msg = NULL; \
70         int good = fixture->expected != 0 ? \
71             TEST_ptr(msg = (expr)) && TEST_true(valid_asn1_encoding(msg)) : \
72             TEST_ptr_null(msg = (expr)); \
73  \
74         OSSL_CMP_MSG_free(msg); \
75         return good; \
76     } while (0)
77
78 /*-
79  * The following tests call a cmp message creation function.
80  * if fixture->expected != 0:
81  *         returns 1 if the message is created and syntactically correct.
82  * if fixture->expected == 0
83  *         returns 1 if message creation returns NULL
84  */
85 static int execute_certreq_create_test(CMP_MSG_TEST_FIXTURE *fixture)
86 {
87     EXECUTE_MSG_CREATION_TEST(ossl_cmp_certReq_new(fixture->cmp_ctx,
88                                                    fixture->bodytype,
89                                                    fixture->err_code));
90 }
91
92 static int execute_errormsg_create_test(CMP_MSG_TEST_FIXTURE *fixture)
93 {
94     EXECUTE_MSG_CREATION_TEST(ossl_cmp_error_new(fixture->cmp_ctx, fixture->si,
95                                                  fixture->err_code,
96                                                  "details", 0));
97 }
98
99 static int execute_rr_create_test(CMP_MSG_TEST_FIXTURE *fixture)
100 {
101     EXECUTE_MSG_CREATION_TEST(ossl_cmp_rr_new(fixture->cmp_ctx));
102 }
103
104 static int execute_certconf_create_test(CMP_MSG_TEST_FIXTURE *fixture)
105 {
106     EXECUTE_MSG_CREATION_TEST(ossl_cmp_certConf_new
107                               (fixture->cmp_ctx, fixture->fail_info, NULL));
108 }
109
110 static int execute_genm_create_test(CMP_MSG_TEST_FIXTURE *fixture)
111 {
112     EXECUTE_MSG_CREATION_TEST(ossl_cmp_genm_new(fixture->cmp_ctx));
113 }
114
115 static int execute_pollreq_create_test(CMP_MSG_TEST_FIXTURE *fixture)
116 {
117     EXECUTE_MSG_CREATION_TEST(ossl_cmp_pollReq_new(fixture->cmp_ctx, 4711));
118 }
119
120 static int execute_pkimessage_create_test(CMP_MSG_TEST_FIXTURE *fixture)
121 {
122     EXECUTE_MSG_CREATION_TEST(ossl_cmp_msg_create
123                               (fixture->cmp_ctx, fixture->bodytype));
124 }
125
126 static int set1_newPkey(OSSL_CMP_CTX *ctx, EVP_PKEY *pkey)
127 {
128     if (!EVP_PKEY_up_ref(pkey))
129         return 0;
130
131     if (!OSSL_CMP_CTX_set0_newPkey(ctx, 1, pkey)) {
132         EVP_PKEY_free(pkey);
133         return 0;
134     }
135     return 1;
136 }
137
138 static int test_cmp_create_ir_protection_set(void)
139 {
140     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
141     OSSL_CMP_CTX *ctx = fixture->cmp_ctx;
142     unsigned char secret[16];
143
144     fixture->bodytype = OSSL_CMP_PKIBODY_IR;
145     fixture->err_code = -1;
146     fixture->expected = 1;
147     if (!TEST_int_eq(1, RAND_bytes(secret, sizeof(secret)))
148             || !TEST_true(SET_OPT_UNPROTECTED_SEND(ctx, 0))
149             || !TEST_true(set1_newPkey(ctx, newkey))
150             || !TEST_true(OSSL_CMP_CTX_set1_secretValue(ctx, secret,
151                                                         sizeof(secret)))) {
152         tear_down(fixture);
153         fixture = NULL;
154     }
155     EXECUTE_TEST(execute_certreq_create_test, tear_down);
156     return result;
157 }
158
159 static int test_cmp_create_ir_protection_fails(void)
160 {
161     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
162     fixture->bodytype = OSSL_CMP_PKIBODY_IR;
163     fixture->err_code = -1;
164     fixture->expected = 0;
165     if (!TEST_true(OSSL_CMP_CTX_set1_pkey(fixture->cmp_ctx, newkey))
166             || !TEST_true(SET_OPT_UNPROTECTED_SEND(fixture->cmp_ctx, 0))
167             /* newkey used by default for signing does not match cert: */
168             || !TEST_true(OSSL_CMP_CTX_set1_cert(fixture->cmp_ctx, cert))) {
169         tear_down(fixture);
170         fixture = NULL;
171     }
172     EXECUTE_TEST(execute_certreq_create_test, tear_down);
173     return result;
174 }
175
176 static int test_cmp_create_cr_without_key(void)
177 {
178     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
179     fixture->bodytype = OSSL_CMP_PKIBODY_CR;
180     fixture->err_code = -1;
181     fixture->expected = 0;
182     EXECUTE_TEST(execute_certreq_create_test, tear_down);
183     return result;
184 }
185
186 static int test_cmp_create_cr(void)
187 {
188     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
189     fixture->bodytype = OSSL_CMP_PKIBODY_CR;
190     fixture->err_code = -1;
191     fixture->expected = 1;
192     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
193         tear_down(fixture);
194         fixture = NULL;
195     }
196     EXECUTE_TEST(execute_certreq_create_test, tear_down);
197     return result;
198 }
199
200 static int test_cmp_create_certreq_with_invalid_bodytype(void)
201 {
202     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
203     fixture->bodytype = OSSL_CMP_PKIBODY_RR;
204     fixture->err_code = -1;
205     fixture->expected = 0;
206     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
207         tear_down(fixture);
208         fixture = NULL;
209     }
210     EXECUTE_TEST(execute_certreq_create_test, tear_down);
211     return result;
212 }
213
214 static int test_cmp_create_p10cr(void)
215 {
216     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
217     OSSL_CMP_CTX *ctx = fixture->cmp_ctx;
218     X509_REQ *p10cr = NULL;
219
220     fixture->bodytype = OSSL_CMP_PKIBODY_P10CR;
221     fixture->err_code = CMP_R_ERROR_CREATING_P10CR;
222     fixture->expected = 1;
223     if (!TEST_ptr(p10cr = load_csr(pkcs10_f))
224             || !TEST_true(set1_newPkey(ctx, newkey))
225             || !TEST_true(OSSL_CMP_CTX_set1_p10CSR(ctx, p10cr))) {
226         tear_down(fixture);
227         fixture = NULL;
228     }
229     X509_REQ_free(p10cr);
230     EXECUTE_TEST(execute_certreq_create_test, tear_down);
231     return result;
232 }
233
234 static int test_cmp_create_p10cr_null(void)
235 {
236     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
237     fixture->bodytype = OSSL_CMP_PKIBODY_P10CR;
238     fixture->err_code = CMP_R_ERROR_CREATING_P10CR;
239     fixture->expected = 0;
240     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
241         tear_down(fixture);
242         fixture = NULL;
243     }
244     EXECUTE_TEST(execute_certreq_create_test, tear_down);
245     return result;
246 }
247
248 static int test_cmp_create_kur(void)
249 {
250     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
251     fixture->bodytype = OSSL_CMP_PKIBODY_KUR;
252     fixture->err_code = -1;
253     fixture->expected = 1;
254     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))
255             || !TEST_true(OSSL_CMP_CTX_set1_oldCert(fixture->cmp_ctx, cert))) {
256         tear_down(fixture);
257         fixture = NULL;
258     }
259     EXECUTE_TEST(execute_certreq_create_test, tear_down);
260     return result;
261 }
262
263 static int test_cmp_create_kur_without_oldcert(void)
264 {
265     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
266     fixture->bodytype = OSSL_CMP_PKIBODY_KUR;
267     fixture->err_code = -1;
268     fixture->expected = 0;
269     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
270         tear_down(fixture);
271         fixture = NULL;
272     }
273     EXECUTE_TEST(execute_certreq_create_test, tear_down);
274     return result;
275 }
276
277 static int test_cmp_create_certconf(void)
278 {
279     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
280     fixture->fail_info = 0;
281     fixture->expected = 1;
282     if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
283                                              X509_dup(cert)))) {
284         tear_down(fixture);
285         fixture = NULL;
286     }
287     EXECUTE_TEST(execute_certconf_create_test, tear_down);
288     return result;
289 }
290
291 static int test_cmp_create_certconf_badAlg(void)
292 {
293     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
294     fixture->fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_badAlg;
295     fixture->expected = 1;
296     if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
297                                              X509_dup(cert)))) {
298         tear_down(fixture);
299         fixture = NULL;
300     }
301     EXECUTE_TEST(execute_certconf_create_test, tear_down);
302     return result;
303 }
304
305 static int test_cmp_create_certconf_fail_info_max(void)
306 {
307     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
308     fixture->fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_MAX;
309     fixture->expected = 1;
310     if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
311                                              X509_dup(cert)))) {
312         tear_down(fixture);
313         fixture = NULL;
314     }
315     EXECUTE_TEST(execute_certconf_create_test, tear_down);
316     return result;
317 }
318
319 static int test_cmp_create_error_msg(void)
320 {
321     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
322     fixture->si = OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection,
323                                           OSSL_CMP_PKIFAILUREINFO_systemFailure,
324                                           NULL);
325     fixture->err_code = -1;
326     fixture->expected = 1; /* expected: message creation is successful */
327     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
328         tear_down(fixture);
329         fixture = NULL;
330     }
331     EXECUTE_TEST(execute_errormsg_create_test, tear_down);
332     return result;
333 }
334
335
336 static int test_cmp_create_pollreq(void)
337 {
338     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
339     fixture->expected = 1;
340     EXECUTE_TEST(execute_pollreq_create_test, tear_down);
341     return result;
342 }
343
344 static int test_cmp_create_rr(void)
345 {
346     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
347     fixture->expected = 1;
348     if (!TEST_true(OSSL_CMP_CTX_set1_oldCert(fixture->cmp_ctx, cert))) {
349         tear_down(fixture);
350         fixture = NULL;
351     }
352     EXECUTE_TEST(execute_rr_create_test, tear_down);
353     return result;
354 }
355
356 static int test_cmp_create_genm(void)
357 {
358     OSSL_CMP_ITAV *iv = NULL;
359
360     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
361     fixture->expected = 1;
362     iv = OSSL_CMP_ITAV_create(OBJ_nid2obj(NID_id_it_implicitConfirm), NULL);
363     if (!TEST_ptr(iv)
364             || !TEST_true(OSSL_CMP_CTX_push0_genm_ITAV(fixture->cmp_ctx, iv))) {
365         OSSL_CMP_ITAV_free(iv);
366         tear_down(fixture);
367         fixture = NULL;
368     }
369
370     EXECUTE_TEST(execute_genm_create_test, tear_down);
371     return result;
372 }
373
374 static int execute_certrep_create(CMP_MSG_TEST_FIXTURE *fixture)
375 {
376     OSSL_CMP_CERTREPMESSAGE *crepmsg = OSSL_CMP_CERTREPMESSAGE_new();
377     OSSL_CMP_CERTRESPONSE *read_cresp, *cresp = OSSL_CMP_CERTRESPONSE_new();
378     EVP_PKEY *privkey;
379     X509 *certfromresp = NULL;
380     int res = 0;
381
382     if (crepmsg == NULL || cresp == NULL)
383         goto err;
384     if (!ASN1_INTEGER_set(cresp->certReqId, 99))
385         goto err;
386     if ((cresp->certifiedKeyPair = OSSL_CMP_CERTIFIEDKEYPAIR_new()) == NULL)
387         goto err;
388     cresp->certifiedKeyPair->certOrEncCert->type =
389         OSSL_CMP_CERTORENCCERT_CERTIFICATE;
390     if ((cresp->certifiedKeyPair->certOrEncCert->value.certificate =
391          X509_dup(cert)) == NULL
392             || !sk_OSSL_CMP_CERTRESPONSE_push(crepmsg->response, cresp))
393         goto err;
394     cresp = NULL;
395     read_cresp = ossl_cmp_certrepmessage_get0_certresponse(crepmsg, 99);
396     if (!TEST_ptr(read_cresp))
397         goto err;
398     if (!TEST_ptr_null(ossl_cmp_certrepmessage_get0_certresponse(crepmsg, 88)))
399         goto err;
400     privkey = OSSL_CMP_CTX_get0_newPkey(fixture->cmp_ctx, 1); /* may be NULL */
401     certfromresp = ossl_cmp_certresponse_get1_certificate(privkey, read_cresp);
402     if (certfromresp == NULL || !TEST_int_eq(X509_cmp(cert, certfromresp), 0))
403         goto err;
404
405     res = 1;
406  err:
407     X509_free(certfromresp);
408     OSSL_CMP_CERTRESPONSE_free(cresp);
409     OSSL_CMP_CERTREPMESSAGE_free(crepmsg);
410     return res;
411 }
412
413 static int test_cmp_create_certrep(void)
414 {
415     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
416     EXECUTE_TEST(execute_certrep_create, tear_down);
417     return result;
418 }
419
420
421 static int execute_rp_create(CMP_MSG_TEST_FIXTURE *fixture)
422 {
423     OSSL_CMP_PKISI *si = OSSL_CMP_STATUSINFO_new(33, 44, "a text");
424     X509_NAME *issuer = X509_NAME_new();
425     ASN1_INTEGER *serial = ASN1_INTEGER_new();
426     OSSL_CRMF_CERTID *cid = NULL;
427     OSSL_CMP_MSG *rpmsg = NULL;
428     int res = 0;
429
430     if (si == NULL || issuer == NULL || serial == NULL)
431         goto err;
432
433     if (!X509_NAME_add_entry_by_txt(issuer, "CN", MBSTRING_ASC,
434                                     (unsigned char *)"The Issuer", -1, -1, 0)
435             || !ASN1_INTEGER_set(serial, 99)
436             || (cid = OSSL_CRMF_CERTID_gen(issuer, serial)) == NULL
437             || (rpmsg = ossl_cmp_rp_new(fixture->cmp_ctx, si, cid, 1)) == NULL)
438         goto err;
439
440     if (!TEST_ptr(ossl_cmp_revrepcontent_get_CertId(rpmsg->body->value.rp, 0)))
441         goto err;
442
443     if (!TEST_ptr(ossl_cmp_revrepcontent_get_pkisi(rpmsg->body->value.rp, 0)))
444         goto err;
445
446     res = 1;
447  err:
448     ASN1_INTEGER_free(serial);
449     X509_NAME_free(issuer);
450     OSSL_CRMF_CERTID_free(cid);
451     OSSL_CMP_PKISI_free(si);
452     OSSL_CMP_MSG_free(rpmsg);
453     return res;
454 }
455
456 static int test_cmp_create_rp(void)
457 {
458     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
459     EXECUTE_TEST(execute_rp_create, tear_down);
460     return result;
461 }
462
463 static int execute_pollrep_create(CMP_MSG_TEST_FIXTURE *fixture)
464 {
465     OSSL_CMP_MSG *pollrep;
466     int res = 0;
467
468     pollrep = ossl_cmp_pollRep_new(fixture->cmp_ctx, 77, 2000);
469     if (!TEST_ptr(pollrep))
470         return 0;
471     if (!TEST_ptr(ossl_cmp_pollrepcontent_get0_pollrep(pollrep->body->
472                                                        value.pollRep, 77)))
473         goto err;
474     if (!TEST_ptr_null(ossl_cmp_pollrepcontent_get0_pollrep(pollrep->body->
475                                                             value.pollRep, 88)))
476         goto err;
477
478     res = 1;
479  err:
480     OSSL_CMP_MSG_free(pollrep);
481     return res;
482 }
483
484 static int test_cmp_create_pollrep(void)
485 {
486     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
487     EXECUTE_TEST(execute_pollrep_create, tear_down);
488     return result;
489 }
490
491 static int test_cmp_pkimessage_create(int bodytype)
492 {
493     X509_REQ *p10cr = NULL;
494
495     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
496
497     switch (fixture->bodytype = bodytype) {
498     case OSSL_CMP_PKIBODY_P10CR:
499         fixture->expected = 1;
500         if (!TEST_true(OSSL_CMP_CTX_set1_p10CSR(fixture->cmp_ctx,
501                                                 p10cr = load_csr(pkcs10_f)))) {
502             tear_down(fixture);
503             fixture = NULL;
504         }
505         X509_REQ_free(p10cr);
506         break;
507     case OSSL_CMP_PKIBODY_IR:
508     case OSSL_CMP_PKIBODY_IP:
509     case OSSL_CMP_PKIBODY_CR:
510     case OSSL_CMP_PKIBODY_CP:
511     case OSSL_CMP_PKIBODY_KUR:
512     case OSSL_CMP_PKIBODY_KUP:
513     case OSSL_CMP_PKIBODY_RR:
514     case OSSL_CMP_PKIBODY_RP:
515     case OSSL_CMP_PKIBODY_PKICONF:
516     case OSSL_CMP_PKIBODY_GENM:
517     case OSSL_CMP_PKIBODY_GENP:
518     case OSSL_CMP_PKIBODY_ERROR:
519     case OSSL_CMP_PKIBODY_CERTCONF:
520     case OSSL_CMP_PKIBODY_POLLREQ:
521     case OSSL_CMP_PKIBODY_POLLREP:
522         fixture->expected = 1;
523         break;
524     default:
525         fixture->expected = 0;
526         break;
527     }
528
529     EXECUTE_TEST(execute_pkimessage_create_test, tear_down);
530     return result;
531 }
532
533 void cleanup_tests(void)
534 {
535     EVP_PKEY_free(newkey);
536     X509_free(cert);
537 }
538
539 int setup_tests(void)
540 {
541     if (!test_skip_common_options()) {
542         TEST_error("Error parsing test options\n");
543         return 0;
544     }
545
546     if (!TEST_ptr(server_cert_f = test_get_argument(0))
547             || !TEST_ptr(pkcs10_f = test_get_argument(1))) {
548         TEST_error("usage: cmp_msg_test server.crt pkcs10.der\n");
549         return 0;
550     }
551
552     if (!TEST_ptr(newkey = gen_rsa())
553             || !TEST_ptr(cert = load_pem_cert(server_cert_f))
554             || !TEST_int_eq(1, RAND_bytes(ref, sizeof(ref)))) {
555         cleanup_tests();
556         return 0;
557     }
558
559     /* Message creation tests */
560     ADD_TEST(test_cmp_create_certreq_with_invalid_bodytype);
561     ADD_TEST(test_cmp_create_ir_protection_fails);
562     ADD_TEST(test_cmp_create_ir_protection_set);
563     ADD_TEST(test_cmp_create_error_msg);
564     ADD_TEST(test_cmp_create_certconf);
565     ADD_TEST(test_cmp_create_certconf_badAlg);
566     ADD_TEST(test_cmp_create_certconf_fail_info_max);
567     ADD_TEST(test_cmp_create_kur);
568     ADD_TEST(test_cmp_create_kur_without_oldcert);
569     ADD_TEST(test_cmp_create_cr);
570     ADD_TEST(test_cmp_create_cr_without_key);
571     ADD_TEST(test_cmp_create_p10cr);
572     ADD_TEST(test_cmp_create_p10cr_null);
573     ADD_TEST(test_cmp_create_pollreq);
574     ADD_TEST(test_cmp_create_rr);
575     ADD_TEST(test_cmp_create_rp);
576     ADD_TEST(test_cmp_create_genm);
577     ADD_TEST(test_cmp_create_certrep);
578     ADD_TEST(test_cmp_create_pollrep);
579     ADD_ALL_TESTS_NOSUBTEST(test_cmp_pkimessage_create,
580                             OSSL_CMP_PKIBODY_POLLREP + 1);
581     return 1;
582 }