summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ecp_methods.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lib/libcrypto/ec/ecp_methods.c b/src/lib/libcrypto/ec/ecp_methods.c
index a4713bdcdc..b394206aea 100644
--- a/src/lib/libcrypto/ec/ecp_methods.c
+++ b/src/lib/libcrypto/ec/ecp_methods.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_methods.c,v 1.10 2024/11/30 16:18:01 tb Exp $ */ 1/* $OpenBSD: ecp_methods.c,v 1.11 2024/11/30 16:34:34 tb Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. 3 * for the OpenSSL project.
4 * Includes code written by Bodo Moeller for the OpenSSL project. 4 * Includes code written by Bodo Moeller for the OpenSSL project.
@@ -1141,7 +1141,7 @@ ec_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[],
1141 if ((prod_Z = calloc(num, sizeof *prod_Z)) == NULL) 1141 if ((prod_Z = calloc(num, sizeof *prod_Z)) == NULL)
1142 goto err; 1142 goto err;
1143 for (i = 0; i < num; i++) { 1143 for (i = 0; i < num; i++) {
1144 if ((prod_Z[i] = BN_new()) == NULL) 1144 if ((prod_Z[i] = BN_CTX_get(ctx)) == NULL)
1145 goto err; 1145 goto err;
1146 } 1146 }
1147 1147
@@ -1253,12 +1253,7 @@ ec_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[],
1253 1253
1254 err: 1254 err:
1255 BN_CTX_end(ctx); 1255 BN_CTX_end(ctx);
1256 1256 free(prod_Z);
1257 if (prod_Z != NULL) {
1258 for (i = 0; i < num; i++)
1259 BN_free(prod_Z[i]);
1260 free(prod_Z);
1261 }
1262 1257
1263 return ret; 1258 return ret;
1264} 1259}