8f958658697e391571a97d40bc1e9bee1ff9b927
[openssl.git] / test / cmp_msg_test.c
1 /*
2  * Copyright 2007-2019 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 static const char *server_cert_f;
15 static const char *pkcs10_f;
16
17 typedef struct test_fixture {
18     const char *test_case_name;
19     OSSL_CMP_CTX *cmp_ctx;
20     /* for msg create tests */
21     int bodytype;
22     int err_code;
23     /* for certConf */
24     int fail_info;
25     /* for protection tests */
26     OSSL_CMP_MSG *msg;
27     int expected;
28     /* for error and response messages */
29     OSSL_CMP_PKISI *si;
30 } CMP_MSG_TEST_FIXTURE;
31
32 static unsigned char ref[CMP_TEST_REFVALUE_LENGTH];
33
34 static void tear_down(CMP_MSG_TEST_FIXTURE *fixture)
35 {
36     OSSL_CMP_CTX_free(fixture->cmp_ctx);
37     OSSL_CMP_MSG_free(fixture->msg);
38     OSSL_CMP_PKISI_free(fixture->si);
39     OPENSSL_free(fixture);
40 }
41
42 #define SET_OPT_UNPROTECTED_SEND(ctx, val) \
43     OSSL_CMP_CTX_set_option((ctx), OSSL_CMP_OPT_UNPROTECTED_SEND, (val))
44 static CMP_MSG_TEST_FIXTURE *set_up(const char *const test_case_name)
45 {
46     CMP_MSG_TEST_FIXTURE *fixture;
47
48     if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture))))
49         return NULL;
50     fixture->test_case_name = test_case_name;
51
52     if (!TEST_ptr(fixture->cmp_ctx = OSSL_CMP_CTX_new())
53             || !TEST_true(SET_OPT_UNPROTECTED_SEND(fixture->cmp_ctx, 1))
54             || !TEST_true(OSSL_CMP_CTX_set1_referenceValue(fixture->cmp_ctx,
55                                                            ref, sizeof(ref)))) {
56         tear_down(fixture);
57         return NULL;
58     }
59     return fixture;
60 }
61
62 static EVP_PKEY *newkey = NULL;
63 static X509 *cert = NULL;
64
65 #define EXECUTE_MSG_CREATION_TEST(expr) \
66     do { \
67         OSSL_CMP_MSG *msg = NULL; \
68         int good = fixture->expected != 0 ? \
69             TEST_ptr(msg = (expr)) && TEST_true(valid_asn1_encoding(msg)) : \
70             TEST_ptr_null(msg = (expr)); \
71  \
72         OSSL_CMP_MSG_free(msg); \
73         return good; \
74     } while (0)
75
76 /*-
77  * The following tests call a cmp message creation function.
78  * if fixture->expected != 0:
79  *         returns 1 if the message is created and syntactically correct.
80  * if fixture->expected == 0
81  *         returns 1 if message creation returns NULL
82  */
83 static int execute_certreq_create_test(CMP_MSG_TEST_FIXTURE *fixture)
84 {
85     EXECUTE_MSG_CREATION_TEST(ossl_cmp_certReq_new(fixture->cmp_ctx,
86                                                    fixture->bodytype,
87                                                    fixture->err_code));
88 }
89
90 static int execute_errormsg_create_test(CMP_MSG_TEST_FIXTURE *fixture)
91 {
92     EXECUTE_MSG_CREATION_TEST(ossl_cmp_error_new(fixture->cmp_ctx, fixture->si,
93                                                  fixture->err_code,
94                                                  NULL /* fixture->free_text */,
95                                                  0));
96 }
97
98 static int execute_rr_create_test(CMP_MSG_TEST_FIXTURE *fixture)
99 {
100     EXECUTE_MSG_CREATION_TEST(ossl_cmp_rr_new(fixture->cmp_ctx));
101 }
102
103 static int execute_certconf_create_test(CMP_MSG_TEST_FIXTURE *fixture)
104 {
105     EXECUTE_MSG_CREATION_TEST(ossl_cmp_certConf_new
106                               (fixture->cmp_ctx, fixture->fail_info, NULL));
107 }
108
109 static int execute_genm_create_test(CMP_MSG_TEST_FIXTURE *fixture)
110 {
111     EXECUTE_MSG_CREATION_TEST(ossl_cmp_genm_new(fixture->cmp_ctx));
112 }
113
114 static int execute_pollreq_create_test(CMP_MSG_TEST_FIXTURE *fixture)
115 {
116     EXECUTE_MSG_CREATION_TEST(ossl_cmp_pollReq_new(fixture->cmp_ctx, 4711));
117 }
118
119 static int execute_pkimessage_create_test(CMP_MSG_TEST_FIXTURE *fixture)
120 {
121     EXECUTE_MSG_CREATION_TEST(ossl_cmp_msg_create
122                               (fixture->cmp_ctx, fixture->bodytype));
123 }
124
125 static int set1_newPkey(OSSL_CMP_CTX *ctx, EVP_PKEY *pkey)
126 {
127     if (!EVP_PKEY_up_ref(pkey))
128         return 0;
129
130     if (!OSSL_CMP_CTX_set0_newPkey(ctx, 1, pkey)) {
131         EVP_PKEY_free(pkey);
132         return 0;
133     }
134     return 1;
135 }
136
137 static int test_cmp_create_ir_protection_set(void)
138 {
139     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
140     OSSL_CMP_CTX *ctx = fixture->cmp_ctx;
141     unsigned char secret[16];
142
143     fixture->bodytype = OSSL_CMP_PKIBODY_IR;
144     fixture->err_code = -1;
145     fixture->expected = 1;
146     if (!TEST_int_eq(1, RAND_bytes(secret, sizeof(secret)))
147             || !TEST_true(SET_OPT_UNPROTECTED_SEND(ctx, 0))
148             || !TEST_true(set1_newPkey(ctx, newkey))
149             || !TEST_true(OSSL_CMP_CTX_set1_secretValue(ctx, secret,
150                                                         sizeof(secret)))) {
151         tear_down(fixture);
152         fixture = NULL;
153     }
154     EXECUTE_TEST(execute_certreq_create_test, tear_down);
155     return result;
156 }
157
158 static int test_cmp_create_ir_protection_fails(void)
159 {
160     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
161     fixture->bodytype = OSSL_CMP_PKIBODY_IR;
162     fixture->err_code = -1;
163     fixture->expected = 0;
164     if (!TEST_true(OSSL_CMP_CTX_set1_pkey(fixture->cmp_ctx, newkey))
165             || !TEST_true(SET_OPT_UNPROTECTED_SEND(fixture->cmp_ctx, 0))
166             || !TEST_true(OSSL_CMP_CTX_set1_clCert(fixture->cmp_ctx, cert))) {
167         tear_down(fixture);
168         fixture = NULL;
169     }
170     EXECUTE_TEST(execute_certreq_create_test, tear_down);
171     return result;
172 }
173
174 static int test_cmp_create_cr_without_key(void)
175 {
176     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
177     fixture->bodytype = OSSL_CMP_PKIBODY_CR;
178     fixture->err_code = -1;
179     fixture->expected = 0;
180     EXECUTE_TEST(execute_certreq_create_test, tear_down);
181     return result;
182 }
183
184 static int test_cmp_create_cr(void)
185 {
186     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
187     fixture->bodytype = OSSL_CMP_PKIBODY_CR;
188     fixture->err_code = -1;
189     fixture->expected = 1;
190     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
191         tear_down(fixture);
192         fixture = NULL;
193     }
194     EXECUTE_TEST(execute_certreq_create_test, tear_down);
195     return result;
196 }
197
198 static int test_cmp_create_certreq_with_invalid_bodytype(void)
199 {
200     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
201     fixture->bodytype = OSSL_CMP_PKIBODY_RR;
202     fixture->err_code = -1;
203     fixture->expected = 0;
204     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
205         tear_down(fixture);
206         fixture = NULL;
207     }
208     EXECUTE_TEST(execute_certreq_create_test, tear_down);
209     return result;
210 }
211
212 static int test_cmp_create_p10cr(void)
213 {
214     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
215     OSSL_CMP_CTX *ctx = fixture->cmp_ctx;
216     X509_REQ *p10cr = NULL;
217
218     fixture->bodytype = OSSL_CMP_PKIBODY_P10CR;
219     fixture->err_code = CMP_R_ERROR_CREATING_P10CR;
220     fixture->expected = 1;
221     if (!TEST_ptr(p10cr = load_csr(pkcs10_f))
222             || !TEST_true(set1_newPkey(ctx, newkey))
223             || !TEST_true(OSSL_CMP_CTX_set1_p10CSR(ctx, p10cr))) {
224         tear_down(fixture);
225         fixture = NULL;
226     }
227     X509_REQ_free(p10cr);
228     EXECUTE_TEST(execute_certreq_create_test, tear_down);
229     return result;
230 }
231
232 static int test_cmp_create_p10cr_null(void)
233 {
234     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
235     fixture->bodytype = OSSL_CMP_PKIBODY_P10CR;
236     fixture->err_code = CMP_R_ERROR_CREATING_P10CR;
237     fixture->expected = 0;
238     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
239         tear_down(fixture);
240         fixture = NULL;
241     }
242     EXECUTE_TEST(execute_certreq_create_test, tear_down);
243     return result;
244 }
245
246 static int test_cmp_create_kur(void)
247 {
248     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
249     fixture->bodytype = OSSL_CMP_PKIBODY_KUR;
250     fixture->err_code = -1;
251     fixture->expected = 1;
252     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))
253             || !TEST_true(OSSL_CMP_CTX_set1_oldCert(fixture->cmp_ctx, cert))) {
254         tear_down(fixture);
255         fixture = NULL;
256     }
257     EXECUTE_TEST(execute_certreq_create_test, tear_down);
258     return result;
259 }
260
261 static int test_cmp_create_kur_without_oldcert(void)
262 {
263     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
264     fixture->bodytype = OSSL_CMP_PKIBODY_KUR;
265     fixture->err_code = -1;
266     fixture->expected = 0;
267     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
268         tear_down(fixture);
269         fixture = NULL;
270     }
271     EXECUTE_TEST(execute_certreq_create_test, tear_down);
272     return result;
273 }
274
275 static int test_cmp_create_certconf(void)
276 {
277     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
278     fixture->fail_info = 0;
279     fixture->expected = 1;
280     if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
281                                              X509_dup(cert)))) {
282         tear_down(fixture);
283         fixture = NULL;
284     }
285     EXECUTE_TEST(execute_certconf_create_test, tear_down);
286     return result;
287 }
288
289 static int test_cmp_create_certconf_badAlg(void)
290 {
291     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
292     fixture->fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_badAlg;
293     fixture->expected = 1;
294     if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
295                                              X509_dup(cert)))) {
296         tear_down(fixture);
297         fixture = NULL;
298     }
299     EXECUTE_TEST(execute_certconf_create_test, tear_down);
300     return result;
301 }
302
303 static int test_cmp_create_certconf_fail_info_max(void)
304 {
305     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
306     fixture->fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_MAX;
307     fixture->expected = 1;
308     if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx,
309                                              X509_dup(cert)))) {
310         tear_down(fixture);
311         fixture = NULL;
312     }
313     EXECUTE_TEST(execute_certconf_create_test, tear_down);
314     return result;
315 }
316
317 static int test_cmp_create_error_msg(void)
318 {
319     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
320     fixture->si = ossl_cmp_statusinfo_new(OSSL_CMP_PKISTATUS_rejection,
321                                           OSSL_CMP_PKIFAILUREINFO_systemFailure,
322                                           NULL);
323     fixture->err_code = -1;
324     fixture->expected = 1; /* expected: message creation is successful */
325     if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) {
326         tear_down(fixture);
327         fixture = NULL;
328     }
329     EXECUTE_TEST(execute_errormsg_create_test, tear_down);
330     return result;
331 }
332
333
334 static int test_cmp_create_pollreq(void)
335 {
336     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
337     fixture->expected = 1;
338     EXECUTE_TEST(execute_pollreq_create_test, tear_down);
339     return result;
340 }
341
342 static int test_cmp_create_rr(void)
343 {
344     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
345     fixture->expected = 1;
346     if (!TEST_true(OSSL_CMP_CTX_set1_oldCert(fixture->cmp_ctx, cert))) {
347         tear_down(fixture);
348         fixture = NULL;
349     }
350     EXECUTE_TEST(execute_rr_create_test, tear_down);
351     return result;
352 }
353
354 static int test_cmp_create_genm(void)
355 {
356     OSSL_CMP_ITAV *iv = NULL;
357
358     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
359     fixture->expected = 1;
360     iv = OSSL_CMP_ITAV_create(OBJ_nid2obj(NID_id_it_implicitConfirm), NULL);
361     if (!TEST_true(SET_OPT_UNPROTECTED_SEND(fixture->cmp_ctx, 1))
362             || !TEST_ptr(iv)
363             || !TEST_true(OSSL_CMP_CTX_push0_genm_ITAV(fixture->cmp_ctx, iv))) {
364         OSSL_CMP_ITAV_free(iv);
365         tear_down(fixture);
366         fixture = NULL;
367     }
368
369     EXECUTE_TEST(execute_genm_create_test, tear_down);
370     return result;
371 }
372
373 static int execute_certrep_create(CMP_MSG_TEST_FIXTURE *fixture)
374 {
375     OSSL_CMP_CERTREPMESSAGE *crepmsg = OSSL_CMP_CERTREPMESSAGE_new();
376     OSSL_CMP_CERTRESPONSE *read_cresp, *cresp = OSSL_CMP_CERTRESPONSE_new();
377     EVP_PKEY *privkey;
378     X509 *certfromresp = NULL;
379     int res = 0;
380
381     if (crepmsg == NULL || cresp == NULL)
382         goto err;
383     if (!ASN1_INTEGER_set(cresp->certReqId, 99))
384         goto err;
385     if ((cresp->certifiedKeyPair = OSSL_CMP_CERTIFIEDKEYPAIR_new()) == NULL)
386         goto err;
387     cresp->certifiedKeyPair->certOrEncCert->type =
388         OSSL_CMP_CERTORENCCERT_CERTIFICATE;
389     if ((cresp->certifiedKeyPair->certOrEncCert->value.certificate =
390          X509_dup(cert)) == NULL
391             || !sk_OSSL_CMP_CERTRESPONSE_push(crepmsg->response, cresp))
392         goto err;
393     cresp = NULL;
394     read_cresp = ossl_cmp_certrepmessage_get0_certresponse(crepmsg, 99);
395     if (!TEST_ptr(read_cresp))
396         goto err;
397     if (!TEST_ptr_null(ossl_cmp_certrepmessage_get0_certresponse(crepmsg, 88)))
398         goto err;
399     privkey = OSSL_CMP_CTX_get0_newPkey(fixture->cmp_ctx, 1); /* may be NULL */
400     certfromresp = ossl_cmp_certresponse_get1_certificate(privkey, read_cresp);
401     if (certfromresp == NULL || !TEST_int_eq(X509_cmp(cert, certfromresp), 0))
402         goto err;
403
404     res = 1;
405  err:
406     X509_free(certfromresp);
407     OSSL_CMP_CERTRESPONSE_free(cresp);
408     OSSL_CMP_CERTREPMESSAGE_free(crepmsg);
409     return res;
410 }
411
412 static int test_cmp_create_certrep(void)
413 {
414     SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up);
415     EXECUTE_TEST(execute_certrep_create, tear_down);
416     return result;
417 }
418
419
420 static int execute_rp_create(CMP_MSG_TEST_FIXTURE *fixture)
421 {
422     OSSL_CMP_PKISI *si = ossl_cmp_statusinfo_new(33, 44, "a text");
423     X509_NAME *issuer = X509_NAME_new();
424     ASN1_INTEGER *serial = ASN1_INTEGER_new();
425     OSSL_CRMF_CERTID *cid = NULL;
426     OSSL_CMP_MSG *rpmsg = NULL;
427     int res = 0;
428
429     if (si == NULL || issuer == NULL || serial == NULL)
430         goto err;
431
432     if (!X509_NAME_add_entry_by_txt(issuer, "CN", MBSTRING_ASC,
433                                     (unsigned char *)"The Issuer", -1, -1, 0)
434             || !ASN1_INTEGER_set(serial, 99)
435             || (cid = OSSL_CRMF_CERTID_gen(issuer, serial)) == NULL
436             || (rpmsg = ossl_cmp_rp_new(fixture->cmp_ctx, si, cid, 1)) == NULL)
437         goto err;
438
439     if (!TEST_ptr(ossl_cmp_revrepcontent_get_CertId(rpmsg->body->value.rp, 0)))
440         goto err;
441
442     if (!TEST_ptr(ossl_cmp_revrepcontent_get_pkistatusinfo(rpmsg->body->
443                                                            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 }