]> git.ipfire.org Git - thirdparty/openssl.git/commit
Rework the "by store" X509_LOOKUP method to open the given URI early
authorRichard Levitte <levitte@openssl.org>
Wed, 30 Apr 2025 09:38:04 +0000 (11:38 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 4 May 2025 06:55:15 +0000 (08:55 +0200)
commit0c48ee2bf513cbc2f1de2ff8bc11750e4b593620
tree8d90005f64c45c42d39b2d0c1f12a52d0308c1f7
parent3513a830cc159c913b6c9bf1cbaf1577a1f47808
Rework the "by store" X509_LOOKUP method to open the given URI early

The cached X509_LOOKUP method data is no longer just the URI, but now
includes the OSSL_STORE_CTX pointer, and required parameters to reopen
the URI at any time.  cache_objects() is modified to handle this, and
only (re)open the URI when it wasn't previously opened, or when it was
closed by an earlier call.

This way, we can call OSSL_STORE_open_ex() in by_store_ctrl_ex(), and
get to see possible errors when the URI is loaded.

This assumes that if the URI could be opened once, it can be opened
again.

Fixes #27461

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27529)
crypto/x509/by_store.c