]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
pkcs7_test: disable time checks in pkcs7_verify_test
authorAbel Thomas <abeltom.kernel@gmail.com>
Wed, 8 Jul 2026 08:19:40 +0000 (10:19 +0200)
committerTomas Mraz <tomas@openssl.foundation>
Wed, 29 Jul 2026 16:54:05 +0000 (18:54 +0200)
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)

test/pkcs7_test.c

index 6362645e47b92878b91d132efeea96e0acc363f2..2fe7064c01a755b7560fb77dcc0fc33e4f11d466 100644 (file)
@@ -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))