diff options
author | Matt Caswell <matt@openssl.org> | 2016-08-23 00:01:57 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-08-23 00:19:15 +0100 |
commit | 8b7c51a0e4a03895a657cf2eb8d5c2aa1ca3586f (patch) | |
tree | bc644ca9def4bdf8bac4a7ae2c607c076db1c35e | |
parent | c6231e9c7baec688792e043d12508e608545fffb (diff) |
Add some sanity checks when checking CRL scores
Reviewed-by: Tim Hudson <tjh@openssl.org>
-rw-r--r-- | crypto/x509/x509_vfy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 13a9ba3c38..070afd1d2b 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -974,10 +974,10 @@ 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) + if (crl_score < best_score || crl_score == 0) continue; /* If current CRL is equivalent use it if it is newer */ - if (crl_score == best_score) { + if (crl_score == best_score && best_crl != NULL) { int day, sec; if (ASN1_TIME_diff(&day, &sec, X509_CRL_get0_lastUpdate(best_crl), X509_CRL_get0_lastUpdate(crl)) == 0) |