summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_smpl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_smpl.c')
-rw-r--r--src/lib/libcrypto/ec/ecp_smpl.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/ec/ecp_smpl.c b/src/lib/libcrypto/ec/ecp_smpl.c
index 1fe55307b4..eabad4bd86 100644
--- a/src/lib/libcrypto/ec/ecp_smpl.c
+++ b/src/lib/libcrypto/ec/ecp_smpl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_smpl.c,v 1.20 2018/07/15 05:38:48 jsg Exp $ */ 1/* $OpenBSD: ecp_smpl.c,v 1.21 2018/07/15 16:27:39 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.
@@ -220,7 +220,7 @@ ec_GFp_simple_group_set_curve(EC_GROUP * group,
220 220
221 ret = 1; 221 ret = 1;
222 222
223err: 223 err:
224 BN_CTX_end(ctx); 224 BN_CTX_end(ctx);
225 BN_CTX_free(new_ctx); 225 BN_CTX_free(new_ctx);
226 return ret; 226 return ret;
@@ -265,7 +265,7 @@ ec_GFp_simple_group_get_curve(const EC_GROUP * group, BIGNUM * p, BIGNUM * a, BI
265 } 265 }
266 ret = 1; 266 ret = 1;
267 267
268err: 268 err:
269 BN_CTX_free(new_ctx); 269 BN_CTX_free(new_ctx);
270 return ret; 270 return ret;
271} 271}
@@ -346,7 +346,7 @@ ec_GFp_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx)
346 } 346 }
347 ret = 1; 347 ret = 1;
348 348
349err: 349 err:
350 if (ctx != NULL) 350 if (ctx != NULL)
351 BN_CTX_end(ctx); 351 BN_CTX_end(ctx);
352 BN_CTX_free(new_ctx); 352 BN_CTX_free(new_ctx);
@@ -456,7 +456,7 @@ ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP * group, EC_POINT *
456 } 456 }
457 ret = 1; 457 ret = 1;
458 458
459err: 459 err:
460 BN_CTX_free(new_ctx); 460 BN_CTX_free(new_ctx);
461 return ret; 461 return ret;
462} 462}
@@ -504,7 +504,7 @@ ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP * group, const EC_P
504 504
505 ret = 1; 505 ret = 1;
506 506
507err: 507 err:
508 BN_CTX_free(new_ctx); 508 BN_CTX_free(new_ctx);
509 return ret; 509 return ret;
510} 510}
@@ -624,7 +624,7 @@ ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP * group, const EC_POIN
624 624
625 ret = 1; 625 ret = 1;
626 626
627err: 627 err:
628 BN_CTX_end(ctx); 628 BN_CTX_end(ctx);
629 BN_CTX_free(new_ctx); 629 BN_CTX_free(new_ctx);
630 return ret; 630 return ret;
@@ -811,7 +811,7 @@ ec_GFp_simple_add(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, cons
811 811
812 ret = 1; 812 ret = 1;
813 813
814end: 814 end:
815 if (ctx) /* otherwise we already called BN_CTX_end */ 815 if (ctx) /* otherwise we already called BN_CTX_end */
816 BN_CTX_end(ctx); 816 BN_CTX_end(ctx);
817 BN_CTX_free(new_ctx); 817 BN_CTX_free(new_ctx);
@@ -954,7 +954,7 @@ ec_GFp_simple_dbl(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, BN_C
954 954
955 ret = 1; 955 ret = 1;
956 956
957err: 957 err:
958 BN_CTX_end(ctx); 958 BN_CTX_end(ctx);
959 BN_CTX_free(new_ctx); 959 BN_CTX_free(new_ctx);
960 return ret; 960 return ret;
@@ -1075,7 +1075,7 @@ ec_GFp_simple_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX
1075 1075
1076 ret = (0 == BN_ucmp(tmp, rh)); 1076 ret = (0 == BN_ucmp(tmp, rh));
1077 1077
1078err: 1078 err:
1079 BN_CTX_end(ctx); 1079 BN_CTX_end(ctx);
1080 BN_CTX_free(new_ctx); 1080 BN_CTX_free(new_ctx);
1081 return ret; 1081 return ret;
@@ -1177,7 +1177,7 @@ ec_GFp_simple_cmp(const EC_GROUP * group, const EC_POINT * a, const EC_POINT * b
1177 /* points are equal */ 1177 /* points are equal */
1178 ret = 0; 1178 ret = 0;
1179 1179
1180end: 1180 end:
1181 BN_CTX_end(ctx); 1181 BN_CTX_end(ctx);
1182 BN_CTX_free(new_ctx); 1182 BN_CTX_free(new_ctx);
1183 return ret; 1183 return ret;
@@ -1215,7 +1215,7 @@ ec_GFp_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx
1215 } 1215 }
1216 ret = 1; 1216 ret = 1;
1217 1217
1218err: 1218 err:
1219 BN_CTX_end(ctx); 1219 BN_CTX_end(ctx);
1220 BN_CTX_free(new_ctx); 1220 BN_CTX_free(new_ctx);
1221 return ret; 1221 return ret;
@@ -1380,7 +1380,7 @@ ec_GFp_simple_points_make_affine(const EC_GROUP * group, size_t num, EC_POINT *
1380 1380
1381 ret = 1; 1381 ret = 1;
1382 1382
1383err: 1383 err:
1384 BN_CTX_end(ctx); 1384 BN_CTX_end(ctx);
1385 BN_CTX_free(new_ctx); 1385 BN_CTX_free(new_ctx);
1386 if (heap != NULL) { 1386 if (heap != NULL) {