The fips provider was creating the OPENSSL_CTX twice due to a previous
merge error.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9184)
void **provctx)
{
FIPS_GLOBAL *fgbl;
- OPENSSL_CTX *ctx = OPENSSL_CTX_new();
-
- if (ctx == NULL)
- return 0;
-
- fgbl = openssl_ctx_get_data(ctx, OPENSSL_CTX_FIPS_PROV_INDEX,
- &fips_prov_ossl_ctx_method);
-
- if (fgbl == NULL)
- goto err;
-
- fgbl->prov = provider;
+ OPENSSL_CTX *ctx;
for (; in->function_id != 0; in++) {
switch (in->function_id) {
if (ctx == NULL)
return 0;
+ fgbl = openssl_ctx_get_data(ctx, OPENSSL_CTX_FIPS_PROV_INDEX,
+ &fips_prov_ossl_ctx_method);
+
+ if (fgbl == NULL)
+ goto err;
+
+ fgbl->prov = provider;
+
*out = fips_dispatch_table;
*provctx = ctx;