2 * Copyright 2007-2019 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 */
15 static const char *server_f
;
16 static const char *client_f
;
17 static const char *endentity1_f
;
18 static const char *endentity2_f
;
19 static const char *root_f
;
20 static const char *intermediate_f
;
21 static const char *ir_protected_f
;
22 static const char *ir_unprotected_f
;
23 static const char *ir_rmprotection_f
;
24 static const char *ip_waiting_f
;
25 static const char *instacert_f
;
26 static const char *instaca_f
;
27 static const char *ir_protected_0_extracerts
;
28 static const char *ir_protected_2_extracerts
;
30 typedef struct test_fixture
{
31 const char *test_case_name
;
33 OSSL_CMP_CTX
*cmp_ctx
;
36 ossl_cmp_allow_unprotected_cb_t allow_unprotected_cb
;
38 } CMP_VFY_TEST_FIXTURE
;
40 static void tear_down(CMP_VFY_TEST_FIXTURE
*fixture
)
42 OSSL_CMP_MSG_free(fixture
->msg
);
43 OSSL_CMP_CTX_free(fixture
->cmp_ctx
);
44 OPENSSL_free(fixture
);
47 static int print_to_bio_out(const char *func
, const char *file
, int line
,
48 OSSL_CMP_severity level
, const char *msg
)
50 return OSSL_CMP_print_to_bio(bio_out
, func
, file
, line
, level
, msg
);
53 static time_t test_time_valid
= 0, test_time_after_expiration
= 0;
55 static CMP_VFY_TEST_FIXTURE
*set_up(const char *const test_case_name
)
57 X509_STORE
*ts
= X509_STORE_new();
58 CMP_VFY_TEST_FIXTURE
*fixture
;
60 if (!TEST_ptr(fixture
= OPENSSL_zalloc(sizeof(*fixture
))))
62 fixture
->test_case_name
= test_case_name
;
64 || !TEST_ptr(fixture
->cmp_ctx
= OSSL_CMP_CTX_new())
65 || !OSSL_CMP_CTX_set0_trustedStore(fixture
->cmp_ctx
, ts
)
66 || !OSSL_CMP_CTX_set_log_cb(fixture
->cmp_ctx
, print_to_bio_out
)) {
71 X509_VERIFY_PARAM_set_time(X509_STORE_get0_param(ts
), test_time_valid
);
72 X509_STORE_set_verify_cb(ts
, OSSL_CMP_print_cert_verify_cb
);
76 static X509
*srvcert
= NULL
;
77 static X509
*clcert
= NULL
;
79 static X509
*endentity1
= NULL
, *endentity2
= NULL
,
80 *intermediate
= NULL
, *root
= NULL
;
82 static X509
*insta_cert
= NULL
, *instaca_cert
= NULL
;
84 static unsigned char rand_data
[OSSL_CMP_TRANSACTIONID_LENGTH
];
85 static OSSL_CMP_MSG
*ir_unprotected
, *ir_rmprotection
;
87 static int flip_bit(ASN1_BIT_STRING
*bitstr
)
90 int bit
= ASN1_BIT_STRING_get_bit(bitstr
, bit_num
);
92 return ASN1_BIT_STRING_set_bit(bitstr
, bit_num
, !bit
);
95 static int execute_verify_popo_test(CMP_VFY_TEST_FIXTURE
*fixture
)
97 if ((fixture
->msg
= load_pkimsg(ir_protected_f
)) == NULL
)
99 if (fixture
->expected
== 0) {
100 const OSSL_CRMF_MSGS
*reqs
= fixture
->msg
->body
->value
.ir
;
101 const OSSL_CRMF_MSG
*req
= sk_OSSL_CRMF_MSG_value(reqs
, 0);
102 if (req
== NULL
|| !flip_bit(req
->popo
->value
.signature
->signature
))
105 return TEST_int_eq(fixture
->expected
,
106 ossl_cmp_verify_popo(fixture
->msg
,
107 fixture
->additional_arg
));
110 static int test_verify_popo(void)
112 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
113 fixture
->expected
= 1;
114 EXECUTE_TEST(execute_verify_popo_test
, tear_down
);
118 static int test_verify_popo_bad(void)
120 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
121 fixture
->expected
= 0;
122 EXECUTE_TEST(execute_verify_popo_test
, tear_down
);
126 static int execute_validate_msg_test(CMP_VFY_TEST_FIXTURE
*fixture
)
128 return TEST_int_eq(fixture
->expected
,
129 OSSL_CMP_validate_msg(fixture
->cmp_ctx
, fixture
->msg
));
132 static int execute_validate_cert_path_test(CMP_VFY_TEST_FIXTURE
*fixture
)
134 X509_STORE
*ts
= OSSL_CMP_CTX_get0_trustedStore(fixture
->cmp_ctx
);
135 int res
= TEST_int_eq(fixture
->expected
,
136 OSSL_CMP_validate_cert_path(fixture
->cmp_ctx
,
139 OSSL_CMP_CTX_print_errors(fixture
->cmp_ctx
);
143 static int test_validate_msg_mac_alg_protection(void)
145 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
146 /* secret value belonging to cmp-test/CMP_IP_waitingStatus_PBM.der */
147 const unsigned char sec_1
[] = {
148 '9', 'p', 'p', '8', '-', 'b', '3', '5', 'i', '-', 'X', 'd', '3',
149 'Q', '-', 'u', 'd', 'N', 'R'
152 fixture
->expected
= 1;
153 if (!TEST_true(OSSL_CMP_CTX_set1_secretValue(fixture
->cmp_ctx
, sec_1
,
155 || !TEST_ptr(fixture
->msg
= load_pkimsg(ip_waiting_f
))) {
159 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
163 static int test_validate_msg_mac_alg_protection_bad(void)
165 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
166 const unsigned char sec_bad
[] = {
167 '9', 'p', 'p', '8', '-', 'b', '3', '5', 'i', '-', 'X', 'd', '3',
168 'Q', '-', 'u', 'd', 'N', 'r'
170 fixture
->expected
= 0;
172 if (!TEST_true(OSSL_CMP_CTX_set1_secretValue(fixture
->cmp_ctx
, sec_bad
,
174 || !TEST_ptr(fixture
->msg
= load_pkimsg(ip_waiting_f
))) {
178 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
182 static int add_trusted(OSSL_CMP_CTX
*ctx
, X509
*cert
)
184 return X509_STORE_add_cert(OSSL_CMP_CTX_get0_trustedStore(ctx
), cert
);
187 static int add_untrusted(OSSL_CMP_CTX
*ctx
, X509
*cert
)
189 return ossl_cmp_sk_X509_add1_cert(OSSL_CMP_CTX_get0_untrusted_certs(ctx
),
193 static int test_validate_msg_signature_partial_chain(int expired
)
195 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
196 X509_STORE
*ts
= OSSL_CMP_CTX_get0_trustedStore(fixture
->cmp_ctx
);
198 fixture
->expected
= !expired
;
200 || !TEST_ptr(fixture
->msg
= load_pkimsg(ir_protected_f
))
201 || !add_trusted(fixture
->cmp_ctx
, srvcert
)) {
205 X509_VERIFY_PARAM
*vpm
= X509_STORE_get0_param(ts
);
206 X509_VERIFY_PARAM_set_flags(vpm
, X509_V_FLAG_PARTIAL_CHAIN
);
208 X509_VERIFY_PARAM_set_time(vpm
, test_time_after_expiration
);
210 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
214 static int test_validate_msg_signature_trusted_ok(void)
216 return test_validate_msg_signature_partial_chain(0);
219 static int test_validate_msg_signature_trusted_expired(void)
221 return test_validate_msg_signature_partial_chain(1);
224 static int test_validate_msg_signature_srvcert_wrong(void)
226 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
227 fixture
->expected
= 0;
228 if (!TEST_ptr(fixture
->msg
= load_pkimsg(ir_protected_f
))
229 || !TEST_true(OSSL_CMP_CTX_set1_srvCert(fixture
->cmp_ctx
, clcert
))) {
233 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
237 static int test_validate_msg_signature_srvcert(int bad_sig
)
239 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
240 fixture
->expected
= !bad_sig
;
241 if (!TEST_ptr(fixture
->msg
= load_pkimsg(ir_protected_f
))
242 || !TEST_true(OSSL_CMP_CTX_set1_srvCert(fixture
->cmp_ctx
, srvcert
))
243 || (bad_sig
&& !flip_bit(fixture
->msg
->protection
))) {
247 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
251 static int test_validate_msg_signature_bad(void)
253 return test_validate_msg_signature_srvcert(1);
256 static int test_validate_msg_signature_sender_cert_srvcert(void)
258 return test_validate_msg_signature_srvcert(0);
261 static int test_validate_msg_signature_sender_cert_untrusted(void)
263 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
264 fixture
->expected
= 1;
265 if (!TEST_ptr(fixture
->msg
= load_pkimsg(ir_protected_0_extracerts
))
266 || !add_trusted(fixture
->cmp_ctx
, instaca_cert
)
267 || !add_untrusted(fixture
->cmp_ctx
, insta_cert
)) {
271 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
275 static int test_validate_msg_signature_sender_cert_trusted(void)
277 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
278 fixture
->expected
= 1;
279 if (!TEST_ptr(fixture
->msg
= load_pkimsg(ir_protected_0_extracerts
))
280 || !add_trusted(fixture
->cmp_ctx
, instaca_cert
)
281 || !add_trusted(fixture
->cmp_ctx
, insta_cert
)) {
285 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
289 static int test_validate_msg_signature_sender_cert_extracert(void)
291 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
292 fixture
->expected
= 1;
293 if (!TEST_ptr(fixture
->msg
= load_pkimsg(ir_protected_2_extracerts
))
294 || !add_trusted(fixture
->cmp_ctx
, instaca_cert
)) {
298 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
303 static int test_validate_msg_signature_sender_cert_absent(void)
305 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
306 fixture
->expected
= 0;
307 if (!TEST_ptr(fixture
->msg
= load_pkimsg(ir_protected_0_extracerts
))) {
311 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
316 static int test_validate_with_sender(X509_NAME
*name
, int expected
)
318 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
319 fixture
->expected
= expected
;
320 if (!TEST_ptr(fixture
->msg
= load_pkimsg(ir_protected_f
))
321 || !TEST_true(OSSL_CMP_CTX_set1_expected_sender(fixture
->cmp_ctx
, name
))
322 || !TEST_true(OSSL_CMP_CTX_set1_srvCert(fixture
->cmp_ctx
, srvcert
))) {
326 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
330 static int test_validate_msg_signature_expected_sender(void)
332 return test_validate_with_sender(X509_get_subject_name(srvcert
), 1);
335 static int test_validate_msg_signature_unexpected_sender(void)
337 return test_validate_with_sender(X509_get_subject_name(root
), 0);
340 static int test_validate_msg_unprotected_request(void)
342 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
343 fixture
->expected
= 0;
344 if (!TEST_ptr(fixture
->msg
= load_pkimsg(ir_unprotected_f
))) {
348 EXECUTE_TEST(execute_validate_msg_test
, tear_down
);
352 static void setup_path(CMP_VFY_TEST_FIXTURE
**fixture
, X509
*wrong
, int expired
)
354 (*fixture
)->cert
= endentity2
;
355 (*fixture
)->expected
= wrong
== NULL
&& !expired
;
357 X509_STORE
*ts
= OSSL_CMP_CTX_get0_trustedStore((*fixture
)->cmp_ctx
);
358 X509_VERIFY_PARAM
*vpm
= X509_STORE_get0_param(ts
);
359 X509_VERIFY_PARAM_set_time(vpm
, test_time_after_expiration
);
361 if (!add_trusted((*fixture
)->cmp_ctx
, wrong
== NULL
? root
: wrong
)
362 || !add_untrusted((*fixture
)->cmp_ctx
, endentity1
)
363 || !add_untrusted((*fixture
)->cmp_ctx
, intermediate
)) {
364 tear_down((*fixture
));
369 static int test_validate_cert_path_ok(void)
371 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
372 setup_path(&fixture
, NULL
, 0);
373 EXECUTE_TEST(execute_validate_cert_path_test
, tear_down
);
377 static int test_validate_cert_path_wrong_anchor(void)
379 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
380 setup_path(&fixture
, srvcert
/* wrong/non-root cert */, 0);
381 EXECUTE_TEST(execute_validate_cert_path_test
, tear_down
);
385 static int test_validate_cert_path_expired(void)
387 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
388 setup_path(&fixture
, NULL
, 1);
389 EXECUTE_TEST(execute_validate_cert_path_test
, tear_down
);
393 static int execute_MSG_check_received_test(CMP_VFY_TEST_FIXTURE
*fixture
)
395 const OSSL_CMP_PKIHEADER
*hdr
= OSSL_CMP_MSG_get0_header(fixture
->msg
);
396 const ASN1_OCTET_STRING
*tid
= OSSL_CMP_HDR_get0_transactionID(hdr
);
398 if (!TEST_int_eq(fixture
->expected
,
399 ossl_cmp_msg_check_received(fixture
->cmp_ctx
,
401 fixture
->allow_unprotected_cb
,
402 fixture
->additional_arg
)))
405 if (fixture
->expected
< 0) /* error expected aready during above check */
409 ASN1_OCTET_STRING_cmp(ossl_cmp_hdr_get0_senderNonce(hdr
),
410 fixture
->cmp_ctx
->recipNonce
))
412 ASN1_OCTET_STRING_cmp(tid
,
413 fixture
->cmp_ctx
->transactionID
));
416 static int allow_unprotected(const OSSL_CMP_CTX
*ctx
, const OSSL_CMP_MSG
*msg
,
417 int invalid_protection
, int allow
)
422 static void setup_check_received(CMP_VFY_TEST_FIXTURE
**fixture
, int expected
,
423 ossl_cmp_allow_unprotected_cb_t cb
, int arg
,
424 const unsigned char *trid_data
,
425 const unsigned char *nonce_data
)
427 OSSL_CMP_CTX
*ctx
= (*fixture
)->cmp_ctx
;
428 int nonce_len
= OSSL_CMP_SENDERNONCE_LENGTH
;
430 (*fixture
)->expected
= expected
;
431 (*fixture
)->allow_unprotected_cb
= cb
;
432 (*fixture
)->additional_arg
= arg
;
433 (*fixture
)->msg
= OSSL_CMP_MSG_dup(ir_rmprotection
);
434 if ((*fixture
)->msg
== NULL
435 || (nonce_data
!= NULL
436 && !ossl_cmp_asn1_octet_string_set1_bytes(&ctx
->senderNonce
,
437 nonce_data
, nonce_len
))) {
438 tear_down((*fixture
));
441 else if (trid_data
!= NULL
) {
442 ASN1_OCTET_STRING
*trid
= ASN1_OCTET_STRING_new();
444 || !ASN1_OCTET_STRING_set(trid
, trid_data
,
445 OSSL_CMP_TRANSACTIONID_LENGTH
)
446 || !OSSL_CMP_CTX_set1_transactionID(ctx
, trid
)) {
447 tear_down((*fixture
));
450 ASN1_OCTET_STRING_free(trid
);
454 static int test_MSG_check_received_no_protection_no_cb(void)
456 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
457 setup_check_received(&fixture
, -1, NULL
, 0, NULL
, NULL
);
458 EXECUTE_TEST(execute_MSG_check_received_test
, tear_down
);
462 static int test_MSG_check_received_no_protection_restrictive_cb(void)
464 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
465 setup_check_received(&fixture
, -1, allow_unprotected
, 0, NULL
, NULL
);
466 EXECUTE_TEST(execute_MSG_check_received_test
, tear_down
);
470 static int test_MSG_check_received_no_protection_permissive_cb(void)
472 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
473 setup_check_received(&fixture
, OSSL_CMP_PKIBODY_IP
, allow_unprotected
, 1,
475 EXECUTE_TEST(execute_MSG_check_received_test
, tear_down
);
479 static int test_MSG_check_received_check_transaction_id(void)
481 /* Transaction id belonging to CMP_IR_rmprotection.der */
482 const unsigned char trans_id
[OSSL_CMP_TRANSACTIONID_LENGTH
] = {
483 0x39, 0xB6, 0x90, 0x28, 0xC4, 0xBC, 0x7A, 0xF6,
484 0xBE, 0xC6, 0x4A, 0x88, 0x97, 0xA6, 0x95, 0x0B
487 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
488 setup_check_received(&fixture
, OSSL_CMP_PKIBODY_IP
, allow_unprotected
, 1,
490 EXECUTE_TEST(execute_MSG_check_received_test
, tear_down
);
494 static int test_MSG_check_received_check_transaction_id_bad(void)
496 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
497 setup_check_received(&fixture
, -1, allow_unprotected
, 1, rand_data
, NULL
);
498 EXECUTE_TEST(execute_MSG_check_received_test
, tear_down
);
502 static int test_MSG_check_received_check_recipient_nonce(void)
504 /* Recipient nonce belonging to CMP_IP_ir_rmprotection.der */
505 const unsigned char rec_nonce
[OSSL_CMP_SENDERNONCE_LENGTH
] = {
506 0x48, 0xF1, 0x71, 0x1F, 0xE5, 0xAF, 0x1C, 0x8B,
507 0x21, 0x97, 0x5C, 0x84, 0x74, 0x49, 0xBA, 0x32
510 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
511 setup_check_received(&fixture
, OSSL_CMP_PKIBODY_IP
, allow_unprotected
, 1,
513 EXECUTE_TEST(execute_MSG_check_received_test
, tear_down
);
517 static int test_MSG_check_received_check_recipient_nonce_bad(void)
519 SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE
, set_up
);
520 setup_check_received(&fixture
, -1, allow_unprotected
, 1, NULL
, rand_data
);
521 EXECUTE_TEST(execute_MSG_check_received_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 RAND_bytes(rand_data
, OSSL_CMP_TRANSACTIONID_LENGTH
);
553 if (!TEST_ptr(server_f
= test_get_argument(0))
554 || !TEST_ptr(client_f
= test_get_argument(1))
555 || !TEST_ptr(endentity1_f
= test_get_argument(2))
556 || !TEST_ptr(endentity2_f
= test_get_argument(3))
557 || !TEST_ptr(root_f
= test_get_argument(4))
558 || !TEST_ptr(intermediate_f
= test_get_argument(5))
559 || !TEST_ptr(ir_protected_f
= test_get_argument(6))
560 || !TEST_ptr(ir_unprotected_f
= test_get_argument(7))
561 || !TEST_ptr(ip_waiting_f
= test_get_argument(8))
562 || !TEST_ptr(ir_rmprotection_f
= test_get_argument(9))
563 || !TEST_ptr(instacert_f
= test_get_argument(10))
564 || !TEST_ptr(instaca_f
= test_get_argument(11))
565 || !TEST_ptr(ir_protected_0_extracerts
= test_get_argument(12))
566 || !TEST_ptr(ir_protected_2_extracerts
= test_get_argument(13))) {
567 TEST_error("usage: cmp_vfy_test server.crt client.crt "
568 "EndEntity1.crt EndEntity2.crt "
569 "Root_CA.crt Intermediate_CA.crt "
570 "CMP_IR_protected.der CMP_IR_unprotected.der "
571 "IP_waitingStatus_PBM.der IR_rmprotection.der "
572 "insta.cert.pem insta_ca.cert.pem "
573 "IR_protected_0_extraCerts.der "
574 "IR_protected_2_extraCerts.der\n");
578 /* Load certificates for cert chain */
579 if (!TEST_ptr(endentity1
= load_pem_cert(endentity1_f
))
580 || !TEST_ptr(endentity2
= load_pem_cert(endentity2_f
))
581 || !TEST_ptr(root
= load_pem_cert(root_f
))
582 || !TEST_ptr(intermediate
= load_pem_cert(intermediate_f
)))
585 if (!TEST_ptr(insta_cert
= load_pem_cert(instacert_f
))
586 || !TEST_ptr(instaca_cert
= load_pem_cert(instaca_f
)))
589 /* Load certificates for message validation */
590 if (!TEST_ptr(srvcert
= load_pem_cert(server_f
))
591 || !TEST_ptr(clcert
= load_pem_cert(client_f
)))
593 if (!TEST_int_eq(1, RAND_bytes(rand_data
, OSSL_CMP_TRANSACTIONID_LENGTH
)))
595 if (!TEST_ptr(ir_unprotected
= load_pkimsg(ir_unprotected_f
))
596 || !TEST_ptr(ir_rmprotection
= load_pkimsg(ir_rmprotection_f
)))
599 /* Message validation tests */
600 ADD_TEST(test_verify_popo
);
601 ADD_TEST(test_verify_popo_bad
);
602 ADD_TEST(test_validate_msg_signature_trusted_ok
);
603 ADD_TEST(test_validate_msg_signature_trusted_expired
);
604 ADD_TEST(test_validate_msg_signature_srvcert_wrong
);
605 ADD_TEST(test_validate_msg_signature_bad
);
606 ADD_TEST(test_validate_msg_signature_sender_cert_srvcert
);
607 ADD_TEST(test_validate_msg_signature_sender_cert_untrusted
);
608 ADD_TEST(test_validate_msg_signature_sender_cert_trusted
);
609 ADD_TEST(test_validate_msg_signature_sender_cert_extracert
);
610 ADD_TEST(test_validate_msg_signature_sender_cert_absent
);
611 ADD_TEST(test_validate_msg_signature_expected_sender
);
612 ADD_TEST(test_validate_msg_signature_unexpected_sender
);
613 ADD_TEST(test_validate_msg_unprotected_request
);
614 ADD_TEST(test_validate_msg_mac_alg_protection
);
615 ADD_TEST(test_validate_msg_mac_alg_protection_bad
);
617 /* Cert path validation tests */
618 ADD_TEST(test_validate_cert_path_ok
);
619 ADD_TEST(test_validate_cert_path_expired
);
620 ADD_TEST(test_validate_cert_path_wrong_anchor
);
622 ADD_TEST(test_MSG_check_received_no_protection_no_cb
);
623 ADD_TEST(test_MSG_check_received_no_protection_restrictive_cb
);
624 ADD_TEST(test_MSG_check_received_no_protection_permissive_cb
);
625 ADD_TEST(test_MSG_check_received_check_transaction_id
);
626 ADD_TEST(test_MSG_check_received_check_transaction_id_bad
);
627 ADD_TEST(test_MSG_check_received_check_recipient_nonce
);
628 ADD_TEST(test_MSG_check_received_check_recipient_nonce_bad
);