When looking in the stack of objects in the store we need to ensure we
are holding a read lock for the store.
Issue detected via thread sanitizer after the test from the previous
commit was added.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28385)
OSSL_STORE_SEARCH_free(criterion);
- if (ok)
+ if (ok) {
+ X509_STORE *store = X509_LOOKUP_get_store(ctx);
+
+ if (!X509_STORE_lock(store))
+ return 0;
tmp = X509_OBJECT_retrieve_by_subject(store_objects, type, name);
+ X509_STORE_unlock(store);
+ }
ok = 0;
if (tmp != NULL) {