Commit c2ebb79f8d for openssl.org
commit c2ebb79f8d9153343e422bc6fb3195e4bcb4f782
Author: Abel Thomas <abeltom.kernel@gmail.com>
Date: Wed Jul 8 10:19:40 2026 +0200
pkcs7_test: disable time checks in pkcs7_verify_test
The test certificate has a hardcoded validity period, making
`pkcs7_verify_test` fail when run under a faketime outside that
window. Set `X509_V_FLAG_NO_CHECK_TIME` on the store so verification
no longer depends on the system clock.
Fixes #31788
Reviewed-by: Andrew Dinh <andrewd@openssl.org>
Reviewed-by: Jakub Zelenka <jakub.zelenka@openssl.foundation>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Wed Jul 29 16:54:09 2026
(Merged from https://github.com/openssl/openssl/pull/31890)
diff --git a/test/pkcs7_test.c b/test/pkcs7_test.c
index 6362645e47..2fe7064c01 100644
--- a/test/pkcs7_test.c
+++ b/test/pkcs7_test.c
@@ -181,6 +181,7 @@ static int pkcs7_verify_test(void)
&& TEST_int_eq(ERR_peek_error(), 0)
&& TEST_ptr(store = X509_STORE_new())
&& TEST_true(X509_STORE_add_cert(store, cert))
+ && TEST_true(X509_STORE_set_flags(store, X509_V_FLAG_NO_CHECK_TIME))
&& TEST_ptr(p7 = SMIME_read_PKCS7(bio, NULL))
&& TEST_int_eq(ERR_peek_error(), 0)
&& TEST_true(PKCS7_verify(p7, NULL, store, msg_bio, NULL, PKCS7_TEXT))