2 * Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
3 * Copyright Nokia 2007-2019
4 * Copyright Siemens AG 2015-2019
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
12 #include "cmp_testlib.h"
13 #include "../crypto/crmf/crmf_local.h" /* for manipulating POPO signature */
14 DEFINE_STACK_OF(OSSL_CRMF_MSG)
16 static const char *server_f;
17 static const char *client_f;
18 static const char *endentity1_f;
19 static const char *endentity2_f;
20 static const char *root_f;
21 static const char *intermediate_f;
22 static const char *ir_protected_f;
23 static const char *ir_unprotected_f;
24 static const char *ir_rmprotection_f;
25 static const char *ip_waiting_f;
26 static const char *instacert_f;
27 static const char *instaca_f;
28 static const char *ir_protected_0_extracerts;
29 static const char *ir_protected_2_extracerts;
31 typedef struct test_fixture {
32 const char *test_case_name;
34 OSSL_CMP_CTX *cmp_ctx;
37 ossl_cmp_allow_unprotected_cb_t allow_unprotected_cb;
39 } CMP_VFY_TEST_FIXTURE;
41 static void tear_down(CMP_VFY_TEST_FIXTURE *fixture)
43 OSSL_CMP_MSG_free(fixture->msg);
44 OSSL_CMP_CTX_free(fixture->cmp_ctx);
45 OPENSSL_free(fixture);
48 static time_t test_time_valid = 0, test_time_after_expiration = 0;
50 static CMP_VFY_TEST_FIXTURE *set_up(const char *const test_case_name)
52 X509_STORE *ts = X509_STORE_new();
53 CMP_VFY_TEST_FIXTURE *fixture;
55 if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture))))
57 fixture->test_case_name = test_case_name;
59 || !TEST_ptr(fixture->cmp_ctx = OSSL_CMP_CTX_new())
60 || !OSSL_CMP_CTX_set0_trustedStore(fixture->cmp_ctx, ts)
61 || !OSSL_CMP_CTX_set_log_cb(fixture->cmp_ctx, print_to_bio_out)) {
66 X509_VERIFY_PARAM_set_time(X509_STORE_get0_param(ts), test_time_valid);
67 X509_STORE_set_verify_cb(ts, X509_STORE_CTX_print_verify_cb);
71 static X509 *srvcert = NULL;
72 static X509 *clcert = NULL;
74 static X509 *endentity1 = NULL, *endentity2 = NULL,
75 *intermediate = NULL, *root = NULL;
77 static X509 *insta_cert = NULL, *instaca_cert = NULL;
79 static unsigned char rand_data[OSSL_CMP_TRANSACTIONID_LENGTH];
80 static OSSL_CMP_MSG *ir_unprotected, *ir_rmprotection;
82 static int flip_bit(ASN1_BIT_STRING *bitstr)
85 int bit = ASN1_BIT_STRING_get_bit(bitstr, bit_num);
87 return ASN1_BIT_STRING_set_bit(bitstr, bit_num, !bit);
90 static int execute_verify_popo_test(CMP_VFY_TEST_FIXTURE *fixture)
92 if ((fixture->msg = load_pkimsg(ir_protected_f)) == NULL)
94 if (fixture->expected == 0) {
95 const OSSL_CRMF_MSGS *reqs = fixture->msg->body->value.ir;
96 const OSSL_CRMF_MSG *req = sk_OSSL_CRMF_MSG_value(reqs, 0);
97 if (req == NULL || !flip_bit(req->popo->value.signature->signature))
100 return TEST_int_eq(fixture->expected,
101 ossl_cmp_verify_popo(fixture->msg,
102 fixture->additional_arg));
105 static int test_verify_popo(void)
107 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
108 fixture->expected = 1;
109 EXECUTE_TEST(execute_verify_popo_test, tear_down);
113 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
114 static int test_verify_popo_bad(void)
116 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
117 fixture->expected = 0;
118 EXECUTE_TEST(execute_verify_popo_test, tear_down);
123 static int execute_validate_msg_test(CMP_VFY_TEST_FIXTURE *fixture)
125 return TEST_int_eq(fixture->expected,
126 ossl_cmp_msg_check_update(fixture->cmp_ctx, fixture->msg,
130 static int execute_validate_cert_path_test(CMP_VFY_TEST_FIXTURE *fixture)
132 X509_STORE *ts = OSSL_CMP_CTX_get0_trustedStore(fixture->cmp_ctx);
133 int res = TEST_int_eq(fixture->expected,
134 OSSL_CMP_validate_cert_path(fixture->cmp_ctx,
137 OSSL_CMP_CTX_print_errors(fixture->cmp_ctx);
141 static int test_validate_msg_mac_alg_protection(void)
143 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
144 /* secret value belonging to cmp-test/CMP_IP_waitingStatus_PBM.der */
145 const unsigned char sec_1[] = {
146 '9', 'p', 'p', '8', '-', 'b', '3', '5', 'i', '-', 'X', 'd', '3',
147 'Q', '-', 'u', 'd', 'N', 'R'
150 fixture->expected = 1;
151 if (!TEST_true(OSSL_CMP_CTX_set1_secretValue(fixture->cmp_ctx, sec_1,
153 || !TEST_ptr(fixture->msg = load_pkimsg(ip_waiting_f))) {
157 EXECUTE_TEST(execute_validate_msg_test, tear_down);
161 static int test_validate_msg_mac_alg_protection_bad(void)
163 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
164 const unsigned char sec_bad[] = {
165 '9', 'p', 'p', '8', '-', 'b', '3', '5', 'i', '-', 'X', 'd', '3',
166 'Q', '-', 'u', 'd', 'N', 'r'
168 fixture->expected = 0;
170 if (!TEST_true(OSSL_CMP_CTX_set1_secretValue(fixture->cmp_ctx, sec_bad,
172 || !TEST_ptr(fixture->msg = load_pkimsg(ip_waiting_f))) {
176 EXECUTE_TEST(execute_validate_msg_test, tear_down);
180 static int add_trusted(OSSL_CMP_CTX *ctx, X509 *cert)
182 return X509_STORE_add_cert(OSSL_CMP_CTX_get0_trustedStore(ctx), cert);
185 static int add_untrusted(OSSL_CMP_CTX *ctx, X509 *cert)
187 return ossl_cmp_sk_X509_add1_cert(OSSL_CMP_CTX_get0_untrusted_certs(ctx),
191 static int test_validate_msg_signature_partial_chain(int expired)
193 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
194 X509_STORE *ts = OSSL_CMP_CTX_get0_trustedStore(fixture->cmp_ctx);
196 fixture->expected = !expired;
198 || !TEST_ptr(fixture->msg = load_pkimsg(ir_protected_f))
199 || !add_trusted(fixture->cmp_ctx, srvcert)) {
203 X509_VERIFY_PARAM *vpm = X509_STORE_get0_param(ts);
204 X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_PARTIAL_CHAIN);
206 X509_VERIFY_PARAM_set_time(vpm, test_time_after_expiration);
208 EXECUTE_TEST(execute_validate_msg_test, tear_down);
212 static int test_validate_msg_signature_trusted_ok(void)
214 return test_validate_msg_signature_partial_chain(0);
217 static int test_validate_msg_signature_trusted_expired(void)
219 return test_validate_msg_signature_partial_chain(1);
222 static int test_validate_msg_signature_srvcert_wrong(void)
224 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
225 fixture->expected = 0;
226 if (!TEST_ptr(fixture->msg = load_pkimsg(ir_protected_f))
227 || !TEST_true(OSSL_CMP_CTX_set1_srvCert(fixture->cmp_ctx, clcert))) {
231 EXECUTE_TEST(execute_validate_msg_test, tear_down);
235 static int test_validate_msg_signature_srvcert(int bad_sig)
237 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
238 fixture->expected = !bad_sig;
239 if (!TEST_ptr(fixture->msg = load_pkimsg(ir_protected_f))
240 || !TEST_true(OSSL_CMP_CTX_set1_srvCert(fixture->cmp_ctx, srvcert))
241 || (bad_sig && !flip_bit(fixture->msg->protection))) {
245 EXECUTE_TEST(execute_validate_msg_test, tear_down);
249 static int test_validate_msg_signature_bad(void)
251 return test_validate_msg_signature_srvcert(1);
254 static int test_validate_msg_signature_sender_cert_srvcert(void)
256 return test_validate_msg_signature_srvcert(0);
259 static int test_validate_msg_signature_sender_cert_untrusted(void)
261 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
262 fixture->expected = 1;
263 if (!TEST_ptr(fixture->msg = load_pkimsg(ir_protected_0_extracerts))
264 || !add_trusted(fixture->cmp_ctx, instaca_cert)
265 || !add_untrusted(fixture->cmp_ctx, insta_cert)) {
269 EXECUTE_TEST(execute_validate_msg_test, tear_down);
273 static int test_validate_msg_signature_sender_cert_trusted(void)
275 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
276 fixture->expected = 1;
277 if (!TEST_ptr(fixture->msg = load_pkimsg(ir_protected_0_extracerts))
278 || !add_trusted(fixture->cmp_ctx, instaca_cert)
279 || !add_trusted(fixture->cmp_ctx, insta_cert)) {
283 EXECUTE_TEST(execute_validate_msg_test, tear_down);
287 static int test_validate_msg_signature_sender_cert_extracert(void)
289 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
290 fixture->expected = 1;
291 if (!TEST_ptr(fixture->msg = load_pkimsg(ir_protected_2_extracerts))
292 || !add_trusted(fixture->cmp_ctx, instaca_cert)) {
296 EXECUTE_TEST(execute_validate_msg_test, tear_down);
301 static int test_validate_msg_signature_sender_cert_absent(void)
303 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
304 fixture->expected = 0;
305 if (!TEST_ptr(fixture->msg = load_pkimsg(ir_protected_0_extracerts))) {
309 EXECUTE_TEST(execute_validate_msg_test, tear_down);
314 static int test_validate_with_sender(const X509_NAME *name, int expected)
316 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
317 fixture->expected = expected;
318 if (!TEST_ptr(fixture->msg = load_pkimsg(ir_protected_f))
319 || !TEST_true(OSSL_CMP_CTX_set1_expected_sender(fixture->cmp_ctx, name))
320 || !TEST_true(OSSL_CMP_CTX_set1_srvCert(fixture->cmp_ctx, srvcert))) {
324 EXECUTE_TEST(execute_validate_msg_test, tear_down);
328 static int test_validate_msg_signature_expected_sender(void)
330 return test_validate_with_sender(X509_get_subject_name(srvcert), 1);
333 static int test_validate_msg_signature_unexpected_sender(void)
335 return test_validate_with_sender(X509_get_subject_name(root), 0);
338 static int test_validate_msg_unprotected_request(void)
340 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
341 fixture->expected = 0;
342 if (!TEST_ptr(fixture->msg = load_pkimsg(ir_unprotected_f))) {
346 EXECUTE_TEST(execute_validate_msg_test, tear_down);
350 static void setup_path(CMP_VFY_TEST_FIXTURE **fixture, X509 *wrong, int expired)
352 (*fixture)->cert = endentity2;
353 (*fixture)->expected = wrong == NULL && !expired;
355 X509_STORE *ts = OSSL_CMP_CTX_get0_trustedStore((*fixture)->cmp_ctx);
356 X509_VERIFY_PARAM *vpm = X509_STORE_get0_param(ts);
357 X509_VERIFY_PARAM_set_time(vpm, test_time_after_expiration);
359 if (!add_trusted((*fixture)->cmp_ctx, wrong == NULL ? root : wrong)
360 || !add_untrusted((*fixture)->cmp_ctx, endentity1)
361 || !add_untrusted((*fixture)->cmp_ctx, intermediate)) {
362 tear_down((*fixture));
367 static int test_validate_cert_path_ok(void)
369 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
370 setup_path(&fixture, NULL, 0);
371 EXECUTE_TEST(execute_validate_cert_path_test, tear_down);
375 static int test_validate_cert_path_wrong_anchor(void)
377 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
378 setup_path(&fixture, srvcert /* wrong/non-root cert */, 0);
379 EXECUTE_TEST(execute_validate_cert_path_test, tear_down);
383 static int test_validate_cert_path_expired(void)
385 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
386 setup_path(&fixture, NULL, 1);
387 EXECUTE_TEST(execute_validate_cert_path_test, tear_down);
391 static int execute_msg_check_test(CMP_VFY_TEST_FIXTURE *fixture)
393 const OSSL_CMP_PKIHEADER *hdr = OSSL_CMP_MSG_get0_header(fixture->msg);
394 const ASN1_OCTET_STRING *tid = OSSL_CMP_HDR_get0_transactionID(hdr);
396 if (!TEST_int_eq(fixture->expected,
397 ossl_cmp_msg_check_update(fixture->cmp_ctx,
399 fixture->allow_unprotected_cb,
400 fixture->additional_arg)))
403 if (fixture->expected == 0) /* error expected aready during above check */
407 ASN1_OCTET_STRING_cmp(ossl_cmp_hdr_get0_senderNonce(hdr),
408 fixture->cmp_ctx->recipNonce))
410 ASN1_OCTET_STRING_cmp(tid,
411 fixture->cmp_ctx->transactionID));
414 static int allow_unprotected(const OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
415 int invalid_protection, int allow)
420 static void setup_check_update(CMP_VFY_TEST_FIXTURE **fixture, int expected,
421 ossl_cmp_allow_unprotected_cb_t cb, int arg,
422 const unsigned char *trid_data,
423 const unsigned char *nonce_data)
425 OSSL_CMP_CTX *ctx = (*fixture)->cmp_ctx;
426 int nonce_len = OSSL_CMP_SENDERNONCE_LENGTH;
428 (*fixture)->expected = expected;
429 (*fixture)->allow_unprotected_cb = cb;
430 (*fixture)->additional_arg = arg;
431 (*fixture)->msg = OSSL_CMP_MSG_dup(ir_rmprotection);
432 if ((*fixture)->msg == NULL
433 || (nonce_data != NULL
434 && !ossl_cmp_asn1_octet_string_set1_bytes(&ctx->senderNonce,
435 nonce_data, nonce_len))) {
436 tear_down((*fixture));
438 } else if (trid_data != NULL) {
439 ASN1_OCTET_STRING *trid = ASN1_OCTET_STRING_new();
441 || !ASN1_OCTET_STRING_set(trid, trid_data,
442 OSSL_CMP_TRANSACTIONID_LENGTH)
443 || !OSSL_CMP_CTX_set1_transactionID(ctx, trid)) {
444 tear_down((*fixture));
447 ASN1_OCTET_STRING_free(trid);
451 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
452 static int test_msg_check_no_protection_no_cb(void)
454 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
455 setup_check_update(&fixture, 0, NULL, 0, NULL, NULL);
456 EXECUTE_TEST(execute_msg_check_test, tear_down);
460 static int test_msg_check_no_protection_restrictive_cb(void)
462 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
463 setup_check_update(&fixture, 0, allow_unprotected, 0, NULL, NULL);
464 EXECUTE_TEST(execute_msg_check_test, tear_down);
469 static int test_msg_check_no_protection_permissive_cb(void)
471 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
472 setup_check_update(&fixture, 1, allow_unprotected, 1, NULL, NULL);
473 EXECUTE_TEST(execute_msg_check_test, tear_down);
477 static int test_msg_check_transaction_id(void)
479 /* Transaction id belonging to CMP_IR_rmprotection.der */
480 const unsigned char trans_id[OSSL_CMP_TRANSACTIONID_LENGTH] = {
481 0x39, 0xB6, 0x90, 0x28, 0xC4, 0xBC, 0x7A, 0xF6,
482 0xBE, 0xC6, 0x4A, 0x88, 0x97, 0xA6, 0x95, 0x0B
485 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
486 setup_check_update(&fixture, 1, allow_unprotected, 1, trans_id, NULL);
487 EXECUTE_TEST(execute_msg_check_test, tear_down);
491 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
492 static int test_msg_check_transaction_id_bad(void)
494 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
495 setup_check_update(&fixture, 0, allow_unprotected, 1, rand_data, NULL);
496 EXECUTE_TEST(execute_msg_check_test, tear_down);
501 static int test_msg_check_recipient_nonce(void)
503 /* Recipient nonce belonging to CMP_IP_ir_rmprotection.der */
504 const unsigned char rec_nonce[OSSL_CMP_SENDERNONCE_LENGTH] = {
505 0x48, 0xF1, 0x71, 0x1F, 0xE5, 0xAF, 0x1C, 0x8B,
506 0x21, 0x97, 0x5C, 0x84, 0x74, 0x49, 0xBA, 0x32
509 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
510 setup_check_update(&fixture, 1, allow_unprotected, 1, NULL, rec_nonce);
511 EXECUTE_TEST(execute_msg_check_test, tear_down);
515 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
516 static int test_msg_check_recipient_nonce_bad(void)
518 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
519 setup_check_update(&fixture, 0, allow_unprotected, 1, NULL, rand_data);
520 EXECUTE_TEST(execute_msg_check_test, tear_down);
525 void cleanup_tests(void)
529 X509_free(endentity1);
530 X509_free(endentity2);
531 X509_free(intermediate);
533 X509_free(insta_cert);
534 X509_free(instaca_cert);
535 OSSL_CMP_MSG_free(ir_unprotected);
536 OSSL_CMP_MSG_free(ir_rmprotection);
540 int setup_tests(void)
542 /* Set test time stamps */
543 struct tm ts = { 0 };
545 ts.tm_year = 2018 - 1900; /* 2018 */
546 ts.tm_mon = 1; /* February */
547 ts.tm_mday = 18; /* 18th */
548 test_time_valid = mktime(&ts); /* February 18th 2018 */
549 ts.tm_year += 10; /* February 18th 2028 */
550 test_time_after_expiration = mktime(&ts);
552 if (!test_skip_common_options()) {
553 TEST_error("Error parsing test options\n");
557 RAND_bytes(rand_data, OSSL_CMP_TRANSACTIONID_LENGTH);
558 if (!TEST_ptr(server_f = test_get_argument(0))
559 || !TEST_ptr(client_f = test_get_argument(1))
560 || !TEST_ptr(endentity1_f = test_get_argument(2))
561 || !TEST_ptr(endentity2_f = test_get_argument(3))
562 || !TEST_ptr(root_f = test_get_argument(4))
563 || !TEST_ptr(intermediate_f = test_get_argument(5))
564 || !TEST_ptr(ir_protected_f = test_get_argument(6))
565 || !TEST_ptr(ir_unprotected_f = test_get_argument(7))
566 || !TEST_ptr(ip_waiting_f = test_get_argument(8))
567 || !TEST_ptr(ir_rmprotection_f = test_get_argument(9))
568 || !TEST_ptr(instacert_f = test_get_argument(10))
569 || !TEST_ptr(instaca_f = test_get_argument(11))
570 || !TEST_ptr(ir_protected_0_extracerts = test_get_argument(12))
571 || !TEST_ptr(ir_protected_2_extracerts = test_get_argument(13))) {
572 TEST_error("usage: cmp_vfy_test server.crt client.crt "
573 "EndEntity1.crt EndEntity2.crt "
574 "Root_CA.crt Intermediate_CA.crt "
575 "CMP_IR_protected.der CMP_IR_unprotected.der "
576 "IP_waitingStatus_PBM.der IR_rmprotection.der "
577 "insta.cert.pem insta_ca.cert.pem "
578 "IR_protected_0_extraCerts.der "
579 "IR_protected_2_extraCerts.der\n");
583 /* Load certificates for cert chain */
584 if (!TEST_ptr(endentity1 = load_pem_cert(endentity1_f))
585 || !TEST_ptr(endentity2 = load_pem_cert(endentity2_f))
586 || !TEST_ptr(root = load_pem_cert(root_f))
587 || !TEST_ptr(intermediate = load_pem_cert(intermediate_f)))
590 if (!TEST_ptr(insta_cert = load_pem_cert(instacert_f))
591 || !TEST_ptr(instaca_cert = load_pem_cert(instaca_f)))
594 /* Load certificates for message validation */
595 if (!TEST_ptr(srvcert = load_pem_cert(server_f))
596 || !TEST_ptr(clcert = load_pem_cert(client_f)))
598 if (!TEST_int_eq(1, RAND_bytes(rand_data, OSSL_CMP_TRANSACTIONID_LENGTH)))
600 if (!TEST_ptr(ir_unprotected = load_pkimsg(ir_unprotected_f))
601 || !TEST_ptr(ir_rmprotection = load_pkimsg(ir_rmprotection_f)))
604 /* Message validation tests */
605 ADD_TEST(test_verify_popo);
606 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
607 ADD_TEST(test_verify_popo_bad);
609 ADD_TEST(test_validate_msg_signature_trusted_ok);
610 ADD_TEST(test_validate_msg_signature_trusted_expired);
611 ADD_TEST(test_validate_msg_signature_srvcert_wrong);
612 ADD_TEST(test_validate_msg_signature_bad);
613 ADD_TEST(test_validate_msg_signature_sender_cert_srvcert);
614 ADD_TEST(test_validate_msg_signature_sender_cert_untrusted);
615 ADD_TEST(test_validate_msg_signature_sender_cert_trusted);
616 ADD_TEST(test_validate_msg_signature_sender_cert_extracert);
617 ADD_TEST(test_validate_msg_signature_sender_cert_absent);
618 ADD_TEST(test_validate_msg_signature_expected_sender);
619 ADD_TEST(test_validate_msg_signature_unexpected_sender);
620 ADD_TEST(test_validate_msg_unprotected_request);
621 ADD_TEST(test_validate_msg_mac_alg_protection);
622 ADD_TEST(test_validate_msg_mac_alg_protection_bad);
624 /* Cert path validation tests */
625 ADD_TEST(test_validate_cert_path_ok);
626 ADD_TEST(test_validate_cert_path_expired);
627 ADD_TEST(test_validate_cert_path_wrong_anchor);
629 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
630 ADD_TEST(test_msg_check_no_protection_no_cb);
631 ADD_TEST(test_msg_check_no_protection_restrictive_cb);
633 ADD_TEST(test_msg_check_no_protection_permissive_cb);
634 ADD_TEST(test_msg_check_transaction_id);
635 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
636 ADD_TEST(test_msg_check_transaction_id_bad);
638 ADD_TEST(test_msg_check_recipient_nonce);
639 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
640 ADD_TEST(test_msg_check_recipient_nonce_bad);