]> git.ipfire.org Git - thirdparty/openssl.git/commit
Ensure current_crl always points to the crl we are considering
authorBob Beck <beck@openssl.org>
Wed, 21 Jan 2026 18:47:37 +0000 (11:47 -0700)
committerTomas Mraz <tomas@openssl.org>
Tue, 3 Feb 2026 08:50:50 +0000 (09:50 +0100)
commitc20ede00bb3c7df49110484380382326be005f84
treefeb3837d88957a1ea35219cfaf43e38e5e7c1e4f
parent4b09d0d04e46f05a9847a8f0d5dbf3b7b0b9753a
Ensure current_crl always points to the crl we are considering

As mentioned by Viktor Dukhovni, the desired behaviour is:

The current_crl is NULL when the running callback invocation is about errors
unrelated to validation failures via a particular CRL a user may want to
report the issuer of.

The current_crl is (whenever possible) not NULL when reporting errors
specifically related to that CRL.

The problem with this happens when we call check_crl with something that
is not what current_crl is set to. We can potentially enter the time check
code, and we then need to call the callback with the certificate that
failed the time check which is not current_crl.

Correct this by removing the dance in the time check code, and always
setting current_crl whenver we call check_crl.

This means that when we are considering a delta crl, we report the
correct crl to the callback, instead of possibly handing them NULL
(if they get called after a failing time check clobbers it), or the
non-delta crl (because we are looking at a delta while having
current_crl set to crl - which was why we had the dance in the time code
to begin with.  We don't need to change current_crl in the time check
code if we always have current_crl set to the thing we are evaluting.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Tue Feb  3 08:50:52 2026
(Merged from https://github.com/openssl/openssl/pull/29679)
crypto/x509/x509_vfy.c
doc/man3/X509_STORE_CTX_get_error.pod