TSAN was reporting a race of the exported ciphers cache that we create in
the default and fips providers. This was because we cached it in the query
function rather than the init function, so this would cause a race if multiple
threads queried at the same time. In practice it probably wouldn't make much
difference since different threads should come up with the same answer.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13987)
case OSSL_OP_DIGEST:
return deflt_digests;
case OSSL_OP_CIPHER:
- ossl_prov_cache_exported_algorithms(deflt_ciphers, exported_ciphers);
return exported_ciphers;
case OSSL_OP_MAC:
return deflt_macs;
ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
*out = deflt_dispatch_table;
+ ossl_prov_cache_exported_algorithms(deflt_ciphers, exported_ciphers);
return 1;
}
case OSSL_OP_DIGEST:
return fips_digests;
case OSSL_OP_CIPHER:
- ossl_prov_cache_exported_algorithms(fips_ciphers,
- exported_fips_ciphers);
return exported_fips_ciphers;
case OSSL_OP_MAC:
return fips_macs;
fgbl->handle = handle;
+ ossl_prov_cache_exported_algorithms(fips_ciphers, exported_fips_ciphers);
+
selftest_params.libctx = libctx;
if (!SELF_TEST_post(&selftest_params, 0)) {
ERR_raise(ERR_LIB_PROV, PROV_R_SELF_TEST_POST_FAILURE);