[openssl] master update

Matt Caswell matt at openssl.org
Wed Jun 19 09:03:47 UTC 2019


The branch master has been updated
       via  03361afb3ca27a32e1215e482236c2185f5df1ac (commit)
      from  b720949ec09f4dfbff1becc75ca808997e5b51bd (commit)


- Log -----------------------------------------------------------------
commit 03361afb3ca27a32e1215e482236c2185f5df1ac
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Jun 18 18:36:36 2019 +0100

    Don't create an OPENSSL_CTX twice
    
    The fips provider was creating the OPENSSL_CTX twice due to a previous
    merge error.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9184)

-----------------------------------------------------------------------

Summary of changes:
 providers/fips/fipsprov.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c
index a30ece8..61729e5 100644
--- a/providers/fips/fipsprov.c
+++ b/providers/fips/fipsprov.c
@@ -216,18 +216,7 @@ int OSSL_provider_init(const OSSL_PROVIDER *provider,
                        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) {
@@ -256,6 +245,14 @@ int OSSL_provider_init(const OSSL_PROVIDER *provider,
     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;
 


More information about the openssl-commits mailing list