]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix enable-ec_nistp_64_gcc_128
authorMatt Caswell <matt@openssl.org>
Wed, 7 Aug 2019 09:03:12 +0000 (10:03 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 7 Aug 2019 14:50:55 +0000 (15:50 +0100)
When creating a BN_CTX, make sure we store it in the right variable!

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9546)

crypto/ec/ecp_nistp224.c
crypto/ec/ecp_nistp256.c
crypto/ec/ecp_nistp521.c

index a9f40d09c709759f4c3714c8f2580504fd249ef2..2ad9903c90137cbca376dea87ca3df2378737292 100644 (file)
@@ -1286,7 +1286,7 @@ int ec_GFp_nistp224_group_set_curve(EC_GROUP *group, const BIGNUM *p,
     BN_CTX *new_ctx = NULL;
 
     if (ctx == NULL)
-        new_ctx = BN_CTX_new();
+        ctx = new_ctx = BN_CTX_new();
 #endif
     if (ctx == NULL)
         return 0;
@@ -1606,7 +1606,7 @@ int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
 
 #ifndef FIPS_MODE
     if (ctx == NULL)
-        new_ctx = BN_CTX_new();
+        ctx = new_ctx = BN_CTX_new();
 #endif
     if (ctx == NULL)
         return 0;
index 4fc589b913a11ccc7bc055686098203068f5526a..624ee1621fa7a8b3ba48fb03a2f7bb844353c429 100644 (file)
@@ -1906,7 +1906,7 @@ int ec_GFp_nistp256_group_set_curve(EC_GROUP *group, const BIGNUM *p,
     BN_CTX *new_ctx = NULL;
 
     if (ctx == NULL)
-        new_ctx = BN_CTX_new();
+        ctx = new_ctx = BN_CTX_new();
 #endif
     if (ctx == NULL)
         return 0;
@@ -2234,7 +2234,7 @@ int ec_GFp_nistp256_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
 
 #ifndef FIPS_MODE
     if (ctx == NULL)
-        new_ctx = BN_CTX_new();
+        ctx = new_ctx = BN_CTX_new();
 #endif
     if (ctx == NULL)
         return 0;
index ff5c2cfa6494759aa71a6a39b823bf8aca0ad00f..6de37f663b17e16dde3b0b956858308615e89bba 100644 (file)
@@ -1748,7 +1748,7 @@ int ec_GFp_nistp521_group_set_curve(EC_GROUP *group, const BIGNUM *p,
     BN_CTX *new_ctx = NULL;
 
     if (ctx == NULL)
-        new_ctx = BN_CTX_new();
+        ctx = new_ctx = BN_CTX_new();
 #endif
     if (ctx == NULL)
         return 0;
@@ -2072,7 +2072,7 @@ int ec_GFp_nistp521_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
 
 #ifndef FIPS_MODE
     if (ctx == NULL)
-        new_ctx = BN_CTX_new();
+        ctx = new_ctx = BN_CTX_new();
 #endif
     if (ctx == NULL)
         return 0;