[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Dr. Stephen Henson steve at openssl.org
Fri Jul 22 15:19:43 UTC 2016


The branch OpenSSL_1_0_2-stable has been updated
       via  325da8231c8d441e6bb7f15d1a5a23ff63c842e5 (commit)
      from  02f873c5410e8b96c6a55cc906b8f10cd84b0835 (commit)


- Log -----------------------------------------------------------------
commit 325da8231c8d441e6bb7f15d1a5a23ff63c842e5
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Fri Jul 22 13:43:41 2016 +0100

    Use newest CRL.
    
    If two CRLs are equivalent then use the one with a later lastUpdate field:
    this will result in the newest CRL available being used.
    
    RT#4615
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (cherry picked from commit 626aa24849be549b7ef4f049d8427989940c8a37)

-----------------------------------------------------------------------

Summary of changes:
 crypto/x509/x509_vfy.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index 389b1c2..5873ad4 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -1122,13 +1122,21 @@ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
         crl = sk_X509_CRL_value(crls, i);
         reasons = *preasons;
         crl_score = get_crl_score(ctx, &crl_issuer, &reasons, crl, x);
-
-        if (crl_score > best_score) {
-            best_crl = crl;
-            best_crl_issuer = crl_issuer;
-            best_score = crl_score;
-            best_reasons = reasons;
+        if (crl_score < best_score)
+            continue;
+        /* If current CRL is equivalent use it if it is newer */
+        if (crl_score == best_score) {
+            int day, sec;
+            if (ASN1_TIME_diff(&day, &sec, X509_CRL_get_lastUpdate(best_crl),
+                               X509_CRL_get_lastUpdate(crl)) == 0)
+                continue;
+            if (day < 0 || sec <= 0)
+                continue;
         }
+        best_crl = crl;
+        best_crl_issuer = crl_issuer;
+        best_score = crl_score;
+        best_reasons = reasons;
     }
 
     if (best_crl) {


More information about the openssl-commits mailing list