summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index b8e87e8597..993d057d10 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.c,v 1.152 2026/06/22 19:29:41 tb Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.153 2026/06/26 06:03:32 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1074,12 +1074,24 @@ get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
1074 reasons = *preasons; 1074 reasons = *preasons;
1075 crl_score = get_crl_score(ctx, &crl_issuer, &reasons, crl, x); 1075 crl_score = get_crl_score(ctx, &crl_issuer, &reasons, crl, x);
1076 1076
1077 if (crl_score > best_score) { 1077 if (crl_score < best_score || crl_score == 0)
1078 best_crl = crl; 1078 continue;
1079 best_crl_issuer = crl_issuer; 1079
1080 best_score = crl_score; 1080 if (crl_score == best_score && best_crl != NULL) {
1081 best_reasons = reasons; 1081 int day, sec;
1082
1083 if (!ASN1_TIME_diff(&day, &sec, best_crl->crl->lastUpdate,
1084 crl->crl->lastUpdate))
1085 continue;
1086
1087 if (day <= 0 && sec <= 0)
1088 continue;
1082 } 1089 }
1090
1091 best_crl = crl;
1092 best_crl_issuer = crl_issuer;
1093 best_score = crl_score;
1094 best_reasons = reasons;
1083 } 1095 }
1084 1096
1085 if (best_crl != NULL) { 1097 if (best_crl != NULL) {