summaryrefslogtreecommitdiffstats
path: root/crypto/core_fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/core_fetch.c')
-rw-r--r--crypto/core_fetch.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/core_fetch.c b/crypto/core_fetch.c
index 4fb432754b..12d52a03d0 100644
--- a/crypto/core_fetch.c
+++ b/crypto/core_fetch.c
@@ -128,6 +128,16 @@ void *ossl_method_construct(OSSL_LIB_CTX *libctx, int operation_id,
&cbdata);
method = mcm->get(libctx, cbdata.store, mcm_data);
+ if (method == NULL) {
+ /*
+ * If we get here then we did not construct the method that we
+ * attempted to construct. It's possible that another thread got
+ * there first and so we skipped construction (pre-condition
+ * failed). We check the global store again to see if it has
+ * appeared by now.
+ */
+ method = mcm->get(libctx, NULL, mcm_data);
+ }
mcm->dealloc_tmp_store(cbdata.store);
}