Moving notify check after the no time check
authorRyan Kelley <ryan.parker.kelley@gmail.com>
Tue, 16 Aug 2022 05:28:50 +0000 (05:28 +0000)
committerPauli <pauli@openssl.org>
Tue, 23 Aug 2022 01:03:59 +0000 (11:03 +1000)
CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19007)

(cherry picked from commit c92c3dfb99485eb2cfb840e92bd0ece8cdd72d0c)

crypto/x509/x509_vfy.c

index 575047cdb693c39fe04ee9f7e02ed4c04d70cd05..62d6991ec9045a8f2bbe01a025a0d2a440e1469a 100644 (file)
@@ -1007,14 +1007,14 @@ static int check_crl_time(X509_STORE_CTX *ctx, X509_CRL *crl, int notify)
     time_t *ptime;
     int i;
 
-    if (notify)
-        ctx->current_crl = crl;
     if ((ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME) != 0)
         ptime = &ctx->param->check_time;
     else if ((ctx->param->flags & X509_V_FLAG_NO_CHECK_TIME) != 0)
         return 1;
     else
         ptime = NULL;
+    if (notify)
+        ctx->current_crl = crl;
 
     i = X509_cmp_time(X509_CRL_get0_lastUpdate(crl), ptime);
     if (i == 0) {