diff options
author | tb <> | 2018-07-10 22:06:14 +0000 |
---|---|---|
committer | tb <> | 2018-07-10 22:06:14 +0000 |
commit | 265d2eba7d6daa9b8c60bbca09c0ed21ccaa608c (patch) | |
tree | 6d237bcab226d8f03451822634086051ffd8b44d /src | |
parent | 0b6b704dd844fd7a8f8afc5534d7f341f709693e (diff) | |
download | openbsd-265d2eba7d6daa9b8c60bbca09c0ed21ccaa608c.tar.gz openbsd-265d2eba7d6daa9b8c60bbca09c0ed21ccaa608c.tar.bz2 openbsd-265d2eba7d6daa9b8c60bbca09c0ed21ccaa608c.zip |
Indent labels by a space so they don't obliterate function names in diffs.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/ec/ec2_mult.c | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec2_oct.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec2_smpl.c | 20 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 14 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_asn1.c | 18 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_check.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_curve.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_key.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_lib.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ec_mult.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/eck_prn.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ecp_mont.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ecp_nist.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ecp_nistp224.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ecp_nistp256.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ecp_nistp521.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ecp_nistz256.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ecp_oct.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/ec/ecp_smpl.c | 26 |
19 files changed, 93 insertions, 91 deletions
diff --git a/src/lib/libcrypto/ec/ec2_mult.c b/src/lib/libcrypto/ec/ec2_mult.c index 1c8bb18076..463802950d 100644 --- a/src/lib/libcrypto/ec/ec2_mult.c +++ b/src/lib/libcrypto/ec/ec2_mult.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec2_mult.c,v 1.9 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ec2_mult.c,v 1.10 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -111,7 +111,7 @@ gf2m_Mdouble(const EC_GROUP *group, BIGNUM *x, BIGNUM *z, BN_CTX *ctx) | |||
111 | 111 | ||
112 | ret = 1; | 112 | ret = 1; |
113 | 113 | ||
114 | err: | 114 | err: |
115 | BN_CTX_end(ctx); | 115 | BN_CTX_end(ctx); |
116 | return ret; | 116 | return ret; |
117 | } | 117 | } |
@@ -155,7 +155,7 @@ gf2m_Madd(const EC_GROUP *group, const BIGNUM *x, BIGNUM *x1, BIGNUM *z1, | |||
155 | 155 | ||
156 | ret = 1; | 156 | ret = 1; |
157 | 157 | ||
158 | err: | 158 | err: |
159 | BN_CTX_end(ctx); | 159 | BN_CTX_end(ctx); |
160 | return ret; | 160 | return ret; |
161 | } | 161 | } |
@@ -243,7 +243,7 @@ gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIGNUM *x1, | |||
243 | 243 | ||
244 | ret = 2; | 244 | ret = 2; |
245 | 245 | ||
246 | err: | 246 | err: |
247 | BN_CTX_end(ctx); | 247 | BN_CTX_end(ctx); |
248 | return ret; | 248 | return ret; |
249 | } | 249 | } |
@@ -356,7 +356,7 @@ ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, | |||
356 | 356 | ||
357 | ret = 1; | 357 | ret = 1; |
358 | 358 | ||
359 | err: | 359 | err: |
360 | BN_CTX_end(ctx); | 360 | BN_CTX_end(ctx); |
361 | return ret; | 361 | return ret; |
362 | } | 362 | } |
@@ -424,7 +424,7 @@ ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | |||
424 | 424 | ||
425 | ret = 1; | 425 | ret = 1; |
426 | 426 | ||
427 | err: | 427 | err: |
428 | EC_POINT_free(p); | 428 | EC_POINT_free(p); |
429 | EC_POINT_free(acc); | 429 | EC_POINT_free(acc); |
430 | BN_CTX_free(new_ctx); | 430 | BN_CTX_free(new_ctx); |
diff --git a/src/lib/libcrypto/ec/ec2_oct.c b/src/lib/libcrypto/ec/ec2_oct.c index f434d726d2..1727f780a3 100644 --- a/src/lib/libcrypto/ec/ec2_oct.c +++ b/src/lib/libcrypto/ec/ec2_oct.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec2_oct.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ec2_oct.c,v 1.9 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -157,7 +157,7 @@ ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point | |||
157 | 157 | ||
158 | ret = 1; | 158 | ret = 1; |
159 | 159 | ||
160 | err: | 160 | err: |
161 | BN_CTX_end(ctx); | 161 | BN_CTX_end(ctx); |
162 | BN_CTX_free(new_ctx); | 162 | BN_CTX_free(new_ctx); |
163 | return ret; | 163 | return ret; |
@@ -272,7 +272,7 @@ ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, | |||
272 | BN_CTX_free(new_ctx); | 272 | BN_CTX_free(new_ctx); |
273 | return ret; | 273 | return ret; |
274 | 274 | ||
275 | err: | 275 | err: |
276 | if (used_ctx) | 276 | if (used_ctx) |
277 | BN_CTX_end(ctx); | 277 | BN_CTX_end(ctx); |
278 | BN_CTX_free(new_ctx); | 278 | BN_CTX_free(new_ctx); |
@@ -374,7 +374,7 @@ ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point, | |||
374 | } | 374 | } |
375 | ret = 1; | 375 | ret = 1; |
376 | 376 | ||
377 | err: | 377 | err: |
378 | BN_CTX_end(ctx); | 378 | BN_CTX_end(ctx); |
379 | BN_CTX_free(new_ctx); | 379 | BN_CTX_free(new_ctx); |
380 | return ret; | 380 | return ret; |
diff --git a/src/lib/libcrypto/ec/ec2_smpl.c b/src/lib/libcrypto/ec/ec2_smpl.c index 358664afc1..f1cbd3f3c4 100644 --- a/src/lib/libcrypto/ec/ec2_smpl.c +++ b/src/lib/libcrypto/ec/ec2_smpl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec2_smpl.c,v 1.16 2018/07/10 21:55:49 tb Exp $ */ | 1 | /* $OpenBSD: ec2_smpl.c,v 1.17 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -228,7 +228,7 @@ ec_GF2m_simple_group_set_curve(EC_GROUP * group, | |||
228 | group->b.d[i] = 0; | 228 | group->b.d[i] = 0; |
229 | 229 | ||
230 | ret = 1; | 230 | ret = 1; |
231 | err: | 231 | err: |
232 | return ret; | 232 | return ret; |
233 | } | 233 | } |
234 | 234 | ||
@@ -256,7 +256,7 @@ ec_GF2m_simple_group_get_curve(const EC_GROUP *group, | |||
256 | } | 256 | } |
257 | ret = 1; | 257 | ret = 1; |
258 | 258 | ||
259 | err: | 259 | err: |
260 | return ret; | 260 | return ret; |
261 | } | 261 | } |
262 | 262 | ||
@@ -302,7 +302,7 @@ ec_GF2m_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) | |||
302 | 302 | ||
303 | ret = 1; | 303 | ret = 1; |
304 | 304 | ||
305 | err: | 305 | err: |
306 | if (ctx != NULL) | 306 | if (ctx != NULL) |
307 | BN_CTX_end(ctx); | 307 | BN_CTX_end(ctx); |
308 | BN_CTX_free(new_ctx); | 308 | BN_CTX_free(new_ctx); |
@@ -394,7 +394,7 @@ ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * p | |||
394 | point->Z_is_one = 1; | 394 | point->Z_is_one = 1; |
395 | ret = 1; | 395 | ret = 1; |
396 | 396 | ||
397 | err: | 397 | err: |
398 | return ret; | 398 | return ret; |
399 | } | 399 | } |
400 | 400 | ||
@@ -428,7 +428,7 @@ ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group, | |||
428 | } | 428 | } |
429 | ret = 1; | 429 | ret = 1; |
430 | 430 | ||
431 | err: | 431 | err: |
432 | return ret; | 432 | return ret; |
433 | } | 433 | } |
434 | 434 | ||
@@ -545,7 +545,7 @@ ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, | |||
545 | 545 | ||
546 | ret = 1; | 546 | ret = 1; |
547 | 547 | ||
548 | err: | 548 | err: |
549 | BN_CTX_end(ctx); | 549 | BN_CTX_end(ctx); |
550 | BN_CTX_free(new_ctx); | 550 | BN_CTX_free(new_ctx); |
551 | return ret; | 551 | return ret; |
@@ -637,7 +637,7 @@ ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX | |||
637 | if (!BN_GF2m_add(lh, lh, y2)) | 637 | if (!BN_GF2m_add(lh, lh, y2)) |
638 | goto err; | 638 | goto err; |
639 | ret = BN_is_zero(lh); | 639 | ret = BN_is_zero(lh); |
640 | err: | 640 | err: |
641 | if (ctx) | 641 | if (ctx) |
642 | BN_CTX_end(ctx); | 642 | BN_CTX_end(ctx); |
643 | BN_CTX_free(new_ctx); | 643 | BN_CTX_free(new_ctx); |
@@ -689,7 +689,7 @@ ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, | |||
689 | goto err; | 689 | goto err; |
690 | ret = ((BN_cmp(aX, bX) == 0) && BN_cmp(aY, bY) == 0) ? 0 : 1; | 690 | ret = ((BN_cmp(aX, bX) == 0) && BN_cmp(aY, bY) == 0) ? 0 : 1; |
691 | 691 | ||
692 | err: | 692 | err: |
693 | if (ctx) | 693 | if (ctx) |
694 | BN_CTX_end(ctx); | 694 | BN_CTX_end(ctx); |
695 | BN_CTX_free(new_ctx); | 695 | BN_CTX_free(new_ctx); |
@@ -730,7 +730,7 @@ ec_GF2m_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ct | |||
730 | 730 | ||
731 | ret = 1; | 731 | ret = 1; |
732 | 732 | ||
733 | err: | 733 | err: |
734 | if (ctx) | 734 | if (ctx) |
735 | BN_CTX_end(ctx); | 735 | BN_CTX_end(ctx); |
736 | BN_CTX_free(new_ctx); | 736 | BN_CTX_free(new_ctx); |
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index 3d52b90383..21390aabd4 100644 --- a/src/lib/libcrypto/ec/ec_ameth.c +++ b/src/lib/libcrypto/ec/ec_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_ameth.c,v 1.20 2018/05/01 19:01:28 tb Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.21 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -126,7 +126,7 @@ eckey_pub_encode(X509_PUBKEY * pk, const EVP_PKEY * pkey) | |||
126 | if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(EVP_PKEY_EC), | 126 | if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(EVP_PKEY_EC), |
127 | ptype, pval, penc, penclen)) | 127 | ptype, pval, penc, penclen)) |
128 | return 1; | 128 | return 1; |
129 | err: | 129 | err: |
130 | if (ptype == V_ASN1_OBJECT) | 130 | if (ptype == V_ASN1_OBJECT) |
131 | ASN1_OBJECT_free(pval); | 131 | ASN1_OBJECT_free(pval); |
132 | else | 132 | else |
@@ -177,7 +177,7 @@ eckey_type2param(int ptype, const void *pval) | |||
177 | 177 | ||
178 | return eckey; | 178 | return eckey; |
179 | 179 | ||
180 | ecerr: | 180 | ecerr: |
181 | if (eckey) | 181 | if (eckey) |
182 | EC_KEY_free(eckey); | 182 | EC_KEY_free(eckey); |
183 | return NULL; | 183 | return NULL; |
@@ -210,7 +210,7 @@ eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey) | |||
210 | EVP_PKEY_assign_EC_KEY(pkey, eckey); | 210 | EVP_PKEY_assign_EC_KEY(pkey, eckey); |
211 | return 1; | 211 | return 1; |
212 | 212 | ||
213 | ecerr: | 213 | ecerr: |
214 | if (eckey) | 214 | if (eckey) |
215 | EC_KEY_free(eckey); | 215 | EC_KEY_free(eckey); |
216 | return 0; | 216 | return 0; |
@@ -290,9 +290,9 @@ eckey_priv_decode(EVP_PKEY * pkey, PKCS8_PRIV_KEY_INFO * p8) | |||
290 | EVP_PKEY_assign_EC_KEY(pkey, eckey); | 290 | EVP_PKEY_assign_EC_KEY(pkey, eckey); |
291 | return 1; | 291 | return 1; |
292 | 292 | ||
293 | ecliberr: | 293 | ecliberr: |
294 | ECerror(ERR_R_EC_LIB); | 294 | ECerror(ERR_R_EC_LIB); |
295 | ecerr: | 295 | ecerr: |
296 | if (eckey) | 296 | if (eckey) |
297 | EC_KEY_free(eckey); | 297 | EC_KEY_free(eckey); |
298 | return 0; | 298 | return 0; |
@@ -483,7 +483,7 @@ do_EC_KEY_print(BIO * bp, const EC_KEY * x, int off, int ktype) | |||
483 | if (!ECPKParameters_print(bp, group, off)) | 483 | if (!ECPKParameters_print(bp, group, off)) |
484 | goto err; | 484 | goto err; |
485 | ret = 1; | 485 | ret = 1; |
486 | err: | 486 | err: |
487 | if (!ret) | 487 | if (!ret) |
488 | ECerror(reason); | 488 | ECerror(reason); |
489 | BN_free(pub_key); | 489 | BN_free(pub_key); |
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c index 5da7b2be89..1fb0670efe 100644 --- a/src/lib/libcrypto/ec/ec_asn1.c +++ b/src/lib/libcrypto/ec/ec_asn1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_asn1.c,v 1.27 2018/05/19 10:37:02 tb Exp $ */ | 1 | /* $OpenBSD: ec_asn1.c,v 1.28 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -793,7 +793,7 @@ ec_asn1_group2fieldid(const EC_GROUP * group, X9_62_FIELDID * field) | |||
793 | 793 | ||
794 | ok = 1; | 794 | ok = 1; |
795 | 795 | ||
796 | err: | 796 | err: |
797 | BN_free(tmp); | 797 | BN_free(tmp); |
798 | return (ok); | 798 | return (ok); |
799 | } | 799 | } |
@@ -896,7 +896,7 @@ ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve) | |||
896 | 896 | ||
897 | ok = 1; | 897 | ok = 1; |
898 | 898 | ||
899 | err: | 899 | err: |
900 | free(buffer_1); | 900 | free(buffer_1); |
901 | free(buffer_2); | 901 | free(buffer_2); |
902 | BN_free(tmp_1); | 902 | BN_free(tmp_1); |
@@ -988,7 +988,8 @@ ec_asn1_group2parameters(const EC_GROUP * group, ECPARAMETERS * param) | |||
988 | } | 988 | } |
989 | ok = 1; | 989 | ok = 1; |
990 | 990 | ||
991 | err: if (!ok) { | 991 | err: |
992 | if (!ok) { | ||
992 | if (ret && !param) | 993 | if (ret && !param) |
993 | ECPARAMETERS_free(ret); | 994 | ECPARAMETERS_free(ret); |
994 | ret = NULL; | 995 | ret = NULL; |
@@ -1244,7 +1245,8 @@ ec_asn1_parameters2group(const ECPARAMETERS * params) | |||
1244 | } | 1245 | } |
1245 | ok = 1; | 1246 | ok = 1; |
1246 | 1247 | ||
1247 | err: if (!ok) { | 1248 | err: |
1249 | if (!ok) { | ||
1248 | EC_GROUP_clear_free(ret); | 1250 | EC_GROUP_clear_free(ret); |
1249 | ret = NULL; | 1251 | ret = NULL; |
1250 | } | 1252 | } |
@@ -1312,7 +1314,7 @@ d2i_ECPKParameters(EC_GROUP ** a, const unsigned char **in, long len) | |||
1312 | *a = group; | 1314 | *a = group; |
1313 | } | 1315 | } |
1314 | 1316 | ||
1315 | err: | 1317 | err: |
1316 | ECPKPARAMETERS_free(params); | 1318 | ECPKPARAMETERS_free(params); |
1317 | return (group); | 1319 | return (group); |
1318 | } | 1320 | } |
@@ -1425,7 +1427,7 @@ d2i_ECPrivateKey(EC_KEY ** a, const unsigned char **in, long len) | |||
1425 | *a = ret; | 1427 | *a = ret; |
1426 | return (ret); | 1428 | return (ret); |
1427 | 1429 | ||
1428 | err: | 1430 | err: |
1429 | if (a == NULL || *a != ret) | 1431 | if (a == NULL || *a != ret) |
1430 | EC_KEY_free(ret); | 1432 | EC_KEY_free(ret); |
1431 | if (priv_key) | 1433 | if (priv_key) |
@@ -1510,7 +1512,7 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out) | |||
1510 | goto err; | 1512 | goto err; |
1511 | } | 1513 | } |
1512 | ok = 1; | 1514 | ok = 1; |
1513 | err: | 1515 | err: |
1514 | free(buffer); | 1516 | free(buffer); |
1515 | if (priv_key) | 1517 | if (priv_key) |
1516 | EC_PRIVATEKEY_free(priv_key); | 1518 | EC_PRIVATEKEY_free(priv_key); |
diff --git a/src/lib/libcrypto/ec/ec_check.c b/src/lib/libcrypto/ec/ec_check.c index bbb03498ac..b0c63331c6 100644 --- a/src/lib/libcrypto/ec/ec_check.c +++ b/src/lib/libcrypto/ec/ec_check.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_check.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ec_check.c,v 1.7 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -106,7 +106,7 @@ EC_GROUP_check(const EC_GROUP * group, BN_CTX * ctx) | |||
106 | } | 106 | } |
107 | ret = 1; | 107 | ret = 1; |
108 | 108 | ||
109 | err: | 109 | err: |
110 | if (ctx != NULL) | 110 | if (ctx != NULL) |
111 | BN_CTX_end(ctx); | 111 | BN_CTX_end(ctx); |
112 | BN_CTX_free(new_ctx); | 112 | BN_CTX_free(new_ctx); |
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c index d4f6c28d1e..7bf85835dc 100644 --- a/src/lib/libcrypto/ec/ec_curve.c +++ b/src/lib/libcrypto/ec/ec_curve.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_curve.c,v 1.16 2018/03/16 12:31:09 mpi Exp $ */ | 1 | /* $OpenBSD: ec_curve.c,v 1.17 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -3235,7 +3235,7 @@ ec_group_new_from_data(const ec_list_element curve) | |||
3235 | } | 3235 | } |
3236 | } | 3236 | } |
3237 | ok = 1; | 3237 | ok = 1; |
3238 | err: | 3238 | err: |
3239 | if (!ok) { | 3239 | if (!ok) { |
3240 | EC_GROUP_free(group); | 3240 | EC_GROUP_free(group); |
3241 | group = NULL; | 3241 | group = NULL; |
diff --git a/src/lib/libcrypto/ec/ec_key.c b/src/lib/libcrypto/ec/ec_key.c index 595b88cefc..33c9acccd7 100644 --- a/src/lib/libcrypto/ec/ec_key.c +++ b/src/lib/libcrypto/ec/ec_key.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_key.c,v 1.14 2017/05/02 03:59:44 deraadt Exp $ */ | 1 | /* $OpenBSD: ec_key.c,v 1.15 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -253,7 +253,7 @@ EC_KEY_generate_key(EC_KEY * eckey) | |||
253 | 253 | ||
254 | ok = 1; | 254 | ok = 1; |
255 | 255 | ||
256 | err: | 256 | err: |
257 | BN_free(order); | 257 | BN_free(order); |
258 | if (pub_key != NULL && eckey->pub_key == NULL) | 258 | if (pub_key != NULL && eckey->pub_key == NULL) |
259 | EC_POINT_free(pub_key); | 259 | EC_POINT_free(pub_key); |
@@ -324,7 +324,7 @@ EC_KEY_check_key(const EC_KEY * eckey) | |||
324 | } | 324 | } |
325 | } | 325 | } |
326 | ok = 1; | 326 | ok = 1; |
327 | err: | 327 | err: |
328 | BN_CTX_free(ctx); | 328 | BN_CTX_free(ctx); |
329 | EC_POINT_free(point); | 329 | EC_POINT_free(point); |
330 | return (ok); | 330 | return (ok); |
@@ -395,7 +395,7 @@ EC_KEY_set_public_key_affine_coordinates(EC_KEY * key, BIGNUM * x, BIGNUM * y) | |||
395 | 395 | ||
396 | ok = 1; | 396 | ok = 1; |
397 | 397 | ||
398 | err: | 398 | err: |
399 | BN_CTX_free(ctx); | 399 | BN_CTX_free(ctx); |
400 | EC_POINT_free(point); | 400 | EC_POINT_free(point); |
401 | return ok; | 401 | return ok; |
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 5580375321..1d1daca166 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_lib.c,v 1.25 2018/07/10 21:55:49 tb Exp $ */ | 1 | /* $OpenBSD: ec_lib.c,v 1.26 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -526,7 +526,7 @@ EC_GROUP_cmp(const EC_GROUP * a, const EC_GROUP * b, BN_CTX * ctx) | |||
526 | 526 | ||
527 | return r; | 527 | return r; |
528 | 528 | ||
529 | err: | 529 | err: |
530 | BN_CTX_end(ctx); | 530 | BN_CTX_end(ctx); |
531 | if (ctx_new) | 531 | if (ctx_new) |
532 | BN_CTX_free(ctx); | 532 | BN_CTX_free(ctx); |
diff --git a/src/lib/libcrypto/ec/ec_mult.c b/src/lib/libcrypto/ec/ec_mult.c index a565263bb6..08bc8c380c 100644 --- a/src/lib/libcrypto/ec/ec_mult.c +++ b/src/lib/libcrypto/ec/ec_mult.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_mult.c,v 1.21 2017/05/02 03:59:44 deraadt Exp $ */ | 1 | /* $OpenBSD: ec_mult.c,v 1.22 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. | 3 | * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -301,7 +301,7 @@ compute_wNAF(const BIGNUM * scalar, int w, size_t * ret_len) | |||
301 | len = j; | 301 | len = j; |
302 | ok = 1; | 302 | ok = 1; |
303 | 303 | ||
304 | err: | 304 | err: |
305 | if (!ok) { | 305 | if (!ok) { |
306 | free(r); | 306 | free(r); |
307 | r = NULL; | 307 | r = NULL; |
@@ -678,7 +678,7 @@ ec_wNAF_mul(const EC_GROUP * group, EC_POINT * r, const BIGNUM * scalar, | |||
678 | 678 | ||
679 | ret = 1; | 679 | ret = 1; |
680 | 680 | ||
681 | err: | 681 | err: |
682 | BN_CTX_free(new_ctx); | 682 | BN_CTX_free(new_ctx); |
683 | EC_POINT_free(tmp); | 683 | EC_POINT_free(tmp); |
684 | free(wsize); | 684 | free(wsize); |
@@ -857,7 +857,7 @@ ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx) | |||
857 | pre_comp = NULL; | 857 | pre_comp = NULL; |
858 | 858 | ||
859 | ret = 1; | 859 | ret = 1; |
860 | err: | 860 | err: |
861 | if (ctx != NULL) | 861 | if (ctx != NULL) |
862 | BN_CTX_end(ctx); | 862 | BN_CTX_end(ctx); |
863 | BN_CTX_free(new_ctx); | 863 | BN_CTX_free(new_ctx); |
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c index 653d78e5cd..0291de9613 100644 --- a/src/lib/libcrypto/ec/eck_prn.c +++ b/src/lib/libcrypto/ec/eck_prn.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: eck_prn.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: eck_prn.c,v 1.13 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -321,7 +321,7 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off) | |||
321 | goto err; | 321 | goto err; |
322 | } | 322 | } |
323 | ret = 1; | 323 | ret = 1; |
324 | err: | 324 | err: |
325 | if (!ret) | 325 | if (!ret) |
326 | ECerror(reason); | 326 | ECerror(reason); |
327 | BN_free(p); | 327 | BN_free(p); |
diff --git a/src/lib/libcrypto/ec/ecp_mont.c b/src/lib/libcrypto/ec/ecp_mont.c index 8b4c529222..302f833306 100644 --- a/src/lib/libcrypto/ec/ecp_mont.c +++ b/src/lib/libcrypto/ec/ecp_mont.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecp_mont.c,v 1.12 2018/07/10 21:55:49 tb Exp $ */ | 1 | /* $OpenBSD: ecp_mont.c,v 1.13 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -175,7 +175,7 @@ ec_GFp_mont_group_copy(EC_GROUP * dest, const EC_GROUP * src) | |||
175 | } | 175 | } |
176 | return 1; | 176 | return 1; |
177 | 177 | ||
178 | err: | 178 | err: |
179 | if (dest->field_data1 != NULL) { | 179 | if (dest->field_data1 != NULL) { |
180 | BN_MONT_CTX_free(dest->field_data1); | 180 | BN_MONT_CTX_free(dest->field_data1); |
181 | dest->field_data1 = NULL; | 181 | dest->field_data1 = NULL; |
@@ -228,7 +228,7 @@ ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, | |||
228 | BN_free(group->field_data2); | 228 | BN_free(group->field_data2); |
229 | group->field_data2 = NULL; | 229 | group->field_data2 = NULL; |
230 | } | 230 | } |
231 | err: | 231 | err: |
232 | BN_CTX_free(new_ctx); | 232 | BN_CTX_free(new_ctx); |
233 | BN_MONT_CTX_free(mont); | 233 | BN_MONT_CTX_free(mont); |
234 | BN_free(one); | 234 | BN_free(one); |
diff --git a/src/lib/libcrypto/ec/ecp_nist.c b/src/lib/libcrypto/ec/ecp_nist.c index 24cba64d2e..8aa9f49592 100644 --- a/src/lib/libcrypto/ec/ecp_nist.c +++ b/src/lib/libcrypto/ec/ecp_nist.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecp_nist.c,v 1.10 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ecp_nist.c,v 1.11 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -151,7 +151,7 @@ ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p, | |||
151 | 151 | ||
152 | ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); | 152 | ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); |
153 | 153 | ||
154 | err: | 154 | err: |
155 | BN_CTX_end(ctx); | 155 | BN_CTX_end(ctx); |
156 | BN_CTX_free(new_ctx); | 156 | BN_CTX_free(new_ctx); |
157 | return ret; | 157 | return ret; |
@@ -179,7 +179,7 @@ ec_GFp_nist_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, | |||
179 | goto err; | 179 | goto err; |
180 | 180 | ||
181 | ret = 1; | 181 | ret = 1; |
182 | err: | 182 | err: |
183 | BN_CTX_free(ctx_new); | 183 | BN_CTX_free(ctx_new); |
184 | return ret; | 184 | return ret; |
185 | } | 185 | } |
@@ -206,7 +206,7 @@ ec_GFp_nist_field_sqr(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a, | |||
206 | goto err; | 206 | goto err; |
207 | 207 | ||
208 | ret = 1; | 208 | ret = 1; |
209 | err: | 209 | err: |
210 | BN_CTX_free(ctx_new); | 210 | BN_CTX_free(ctx_new); |
211 | return ret; | 211 | return ret; |
212 | } | 212 | } |
diff --git a/src/lib/libcrypto/ec/ecp_nistp224.c b/src/lib/libcrypto/ec/ecp_nistp224.c index fce74578c7..3921508094 100644 --- a/src/lib/libcrypto/ec/ecp_nistp224.c +++ b/src/lib/libcrypto/ec/ecp_nistp224.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecp_nistp224.c,v 1.19 2017/05/02 03:59:44 deraadt Exp $ */ | 1 | /* $OpenBSD: ecp_nistp224.c,v 1.20 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Emilia Kasper (Google) for the OpenSSL project. | 3 | * Written by Emilia Kasper (Google) for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -1281,7 +1281,7 @@ ec_GFp_nistp224_group_set_curve(EC_GROUP * group, const BIGNUM * p, | |||
1281 | } | 1281 | } |
1282 | group->field_mod_func = BN_nist_mod_224; | 1282 | group->field_mod_func = BN_nist_mod_224; |
1283 | ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); | 1283 | ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); |
1284 | err: | 1284 | err: |
1285 | BN_CTX_end(ctx); | 1285 | BN_CTX_end(ctx); |
1286 | BN_CTX_free(new_ctx); | 1286 | BN_CTX_free(new_ctx); |
1287 | return ret; | 1287 | return ret; |
@@ -1537,7 +1537,7 @@ ec_GFp_nistp224_points_mul(const EC_GROUP * group, EC_POINT * r, | |||
1537 | } | 1537 | } |
1538 | ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx); | 1538 | ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx); |
1539 | 1539 | ||
1540 | err: | 1540 | err: |
1541 | BN_CTX_end(ctx); | 1541 | BN_CTX_end(ctx); |
1542 | EC_POINT_free(generator); | 1542 | EC_POINT_free(generator); |
1543 | BN_CTX_free(new_ctx); | 1543 | BN_CTX_free(new_ctx); |
@@ -1666,7 +1666,7 @@ ec_GFp_nistp224_precompute_mult(EC_GROUP * group, BN_CTX * ctx) | |||
1666 | goto err; | 1666 | goto err; |
1667 | ret = 1; | 1667 | ret = 1; |
1668 | pre = NULL; | 1668 | pre = NULL; |
1669 | err: | 1669 | err: |
1670 | BN_CTX_end(ctx); | 1670 | BN_CTX_end(ctx); |
1671 | EC_POINT_free(generator); | 1671 | EC_POINT_free(generator); |
1672 | BN_CTX_free(new_ctx); | 1672 | BN_CTX_free(new_ctx); |
diff --git a/src/lib/libcrypto/ec/ecp_nistp256.c b/src/lib/libcrypto/ec/ecp_nistp256.c index 6f3ec3c250..7046dcebc0 100644 --- a/src/lib/libcrypto/ec/ecp_nistp256.c +++ b/src/lib/libcrypto/ec/ecp_nistp256.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecp_nistp256.c,v 1.18 2017/05/02 03:59:44 deraadt Exp $ */ | 1 | /* $OpenBSD: ecp_nistp256.c,v 1.19 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Adam Langley (Google) for the OpenSSL project | 3 | * Written by Adam Langley (Google) for the OpenSSL project |
4 | */ | 4 | */ |
@@ -1830,7 +1830,7 @@ ec_GFp_nistp256_group_set_curve(EC_GROUP * group, const BIGNUM * p, | |||
1830 | } | 1830 | } |
1831 | group->field_mod_func = BN_nist_mod_256; | 1831 | group->field_mod_func = BN_nist_mod_256; |
1832 | ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); | 1832 | ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); |
1833 | err: | 1833 | err: |
1834 | BN_CTX_end(ctx); | 1834 | BN_CTX_end(ctx); |
1835 | BN_CTX_free(new_ctx); | 1835 | BN_CTX_free(new_ctx); |
1836 | return ret; | 1836 | return ret; |
@@ -2090,7 +2090,7 @@ ec_GFp_nistp256_points_mul(const EC_GROUP * group, EC_POINT * r, | |||
2090 | } | 2090 | } |
2091 | ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx); | 2091 | ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx); |
2092 | 2092 | ||
2093 | err: | 2093 | err: |
2094 | BN_CTX_end(ctx); | 2094 | BN_CTX_end(ctx); |
2095 | EC_POINT_free(generator); | 2095 | EC_POINT_free(generator); |
2096 | BN_CTX_free(new_ctx); | 2096 | BN_CTX_free(new_ctx); |
@@ -2213,7 +2213,7 @@ ec_GFp_nistp256_precompute_mult(EC_GROUP * group, BN_CTX * ctx) | |||
2213 | goto err; | 2213 | goto err; |
2214 | ret = 1; | 2214 | ret = 1; |
2215 | pre = NULL; | 2215 | pre = NULL; |
2216 | err: | 2216 | err: |
2217 | BN_CTX_end(ctx); | 2217 | BN_CTX_end(ctx); |
2218 | EC_POINT_free(generator); | 2218 | EC_POINT_free(generator); |
2219 | BN_CTX_free(new_ctx); | 2219 | BN_CTX_free(new_ctx); |
diff --git a/src/lib/libcrypto/ec/ecp_nistp521.c b/src/lib/libcrypto/ec/ecp_nistp521.c index 6dbc266937..7c20daae28 100644 --- a/src/lib/libcrypto/ec/ecp_nistp521.c +++ b/src/lib/libcrypto/ec/ecp_nistp521.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecp_nistp521.c,v 1.19 2017/05/02 03:59:44 deraadt Exp $ */ | 1 | /* $OpenBSD: ecp_nistp521.c,v 1.20 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Adam Langley (Google) for the OpenSSL project | 3 | * Written by Adam Langley (Google) for the OpenSSL project |
4 | */ | 4 | */ |
@@ -1721,7 +1721,7 @@ ec_GFp_nistp521_group_set_curve(EC_GROUP * group, const BIGNUM * p, | |||
1721 | } | 1721 | } |
1722 | group->field_mod_func = BN_nist_mod_521; | 1722 | group->field_mod_func = BN_nist_mod_521; |
1723 | ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); | 1723 | ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); |
1724 | err: | 1724 | err: |
1725 | BN_CTX_end(ctx); | 1725 | BN_CTX_end(ctx); |
1726 | BN_CTX_free(new_ctx); | 1726 | BN_CTX_free(new_ctx); |
1727 | return ret; | 1727 | return ret; |
@@ -1979,7 +1979,7 @@ ec_GFp_nistp521_points_mul(const EC_GROUP * group, EC_POINT * r, | |||
1979 | } | 1979 | } |
1980 | ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx); | 1980 | ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx); |
1981 | 1981 | ||
1982 | err: | 1982 | err: |
1983 | BN_CTX_end(ctx); | 1983 | BN_CTX_end(ctx); |
1984 | EC_POINT_free(generator); | 1984 | EC_POINT_free(generator); |
1985 | BN_CTX_free(new_ctx); | 1985 | BN_CTX_free(new_ctx); |
@@ -2088,7 +2088,7 @@ ec_GFp_nistp521_precompute_mult(EC_GROUP * group, BN_CTX * ctx) | |||
2088 | goto err; | 2088 | goto err; |
2089 | ret = 1; | 2089 | ret = 1; |
2090 | pre = NULL; | 2090 | pre = NULL; |
2091 | err: | 2091 | err: |
2092 | BN_CTX_end(ctx); | 2092 | BN_CTX_end(ctx); |
2093 | EC_POINT_free(generator); | 2093 | EC_POINT_free(generator); |
2094 | BN_CTX_free(new_ctx); | 2094 | BN_CTX_free(new_ctx); |
diff --git a/src/lib/libcrypto/ec/ecp_nistz256.c b/src/lib/libcrypto/ec/ecp_nistz256.c index b3b8f74b14..3d52938721 100644 --- a/src/lib/libcrypto/ec/ecp_nistz256.c +++ b/src/lib/libcrypto/ec/ecp_nistz256.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecp_nistz256.c,v 1.3 2017/05/02 03:59:44 deraadt Exp $ */ | 1 | /* $OpenBSD: ecp_nistz256.c,v 1.4 2018/07/10 22:06:14 tb Exp $ */ |
2 | /* Copyright (c) 2014, Intel Corporation. | 2 | /* Copyright (c) 2014, Intel Corporation. |
3 | * | 3 | * |
4 | * Permission to use, copy, modify, and/or distribute this software for any | 4 | * Permission to use, copy, modify, and/or distribute this software for any |
@@ -565,7 +565,7 @@ ecp_nistz256_windowed_mul(const EC_GROUP *group, P256_POINT *r, | |||
565 | } | 565 | } |
566 | 566 | ||
567 | ret = 1; | 567 | ret = 1; |
568 | err: | 568 | err: |
569 | free(table); | 569 | free(table); |
570 | free(p_str); | 570 | free(p_str); |
571 | free(scalars); | 571 | free(scalars); |
@@ -712,7 +712,7 @@ ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx) | |||
712 | ec_pre_comp = NULL; | 712 | ec_pre_comp = NULL; |
713 | ret = 1; | 713 | ret = 1; |
714 | 714 | ||
715 | err: | 715 | err: |
716 | if (ctx != NULL) | 716 | if (ctx != NULL) |
717 | BN_CTX_end(ctx); | 717 | BN_CTX_end(ctx); |
718 | BN_CTX_free(new_ctx); | 718 | BN_CTX_free(new_ctx); |
@@ -985,7 +985,7 @@ ecp_nistz256_points_mul(const EC_GROUP *group, EC_POINT *r, | |||
985 | 985 | ||
986 | ret = 1; | 986 | ret = 1; |
987 | 987 | ||
988 | err: | 988 | err: |
989 | if (ctx) | 989 | if (ctx) |
990 | BN_CTX_end(ctx); | 990 | BN_CTX_end(ctx); |
991 | BN_CTX_free(new_ctx); | 991 | BN_CTX_free(new_ctx); |
diff --git a/src/lib/libcrypto/ec/ecp_oct.c b/src/lib/libcrypto/ec/ecp_oct.c index b93b516907..da9eccfe6a 100644 --- a/src/lib/libcrypto/ec/ecp_oct.c +++ b/src/lib/libcrypto/ec/ecp_oct.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecp_oct.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ecp_oct.c,v 1.9 2018/07/10 22:06:14 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. |
@@ -190,7 +190,7 @@ ec_GFp_simple_set_compressed_coordinates(const EC_GROUP * group, | |||
190 | 190 | ||
191 | ret = 1; | 191 | ret = 1; |
192 | 192 | ||
193 | err: | 193 | err: |
194 | BN_CTX_end(ctx); | 194 | BN_CTX_end(ctx); |
195 | BN_CTX_free(new_ctx); | 195 | BN_CTX_free(new_ctx); |
196 | return ret; | 196 | return ret; |
@@ -294,7 +294,7 @@ ec_GFp_simple_point2oct(const EC_GROUP * group, const EC_POINT * point, point_co | |||
294 | BN_CTX_free(new_ctx); | 294 | BN_CTX_free(new_ctx); |
295 | return ret; | 295 | return ret; |
296 | 296 | ||
297 | err: | 297 | err: |
298 | if (used_ctx) | 298 | if (used_ctx) |
299 | BN_CTX_end(ctx); | 299 | BN_CTX_end(ctx); |
300 | BN_CTX_free(new_ctx); | 300 | BN_CTX_free(new_ctx); |
@@ -388,7 +388,7 @@ ec_GFp_simple_oct2point(const EC_GROUP * group, EC_POINT * point, | |||
388 | } | 388 | } |
389 | ret = 1; | 389 | ret = 1; |
390 | 390 | ||
391 | err: | 391 | err: |
392 | BN_CTX_end(ctx); | 392 | BN_CTX_end(ctx); |
393 | BN_CTX_free(new_ctx); | 393 | BN_CTX_free(new_ctx); |
394 | return ret; | 394 | return ret; |
diff --git a/src/lib/libcrypto/ec/ecp_smpl.c b/src/lib/libcrypto/ec/ecp_smpl.c index 402ee2294d..57e8345364 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.18 2018/07/10 21:55:49 tb Exp $ */ | 1 | /* $OpenBSD: ecp_smpl.c,v 1.19 2018/07/10 22:06:14 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. |
@@ -223,7 +223,7 @@ ec_GFp_simple_group_set_curve(EC_GROUP * group, | |||
223 | 223 | ||
224 | ret = 1; | 224 | ret = 1; |
225 | 225 | ||
226 | err: | 226 | err: |
227 | BN_CTX_end(ctx); | 227 | BN_CTX_end(ctx); |
228 | BN_CTX_free(new_ctx); | 228 | BN_CTX_free(new_ctx); |
229 | return ret; | 229 | return ret; |
@@ -268,7 +268,7 @@ ec_GFp_simple_group_get_curve(const EC_GROUP * group, BIGNUM * p, BIGNUM * a, BI | |||
268 | } | 268 | } |
269 | ret = 1; | 269 | ret = 1; |
270 | 270 | ||
271 | err: | 271 | err: |
272 | BN_CTX_free(new_ctx); | 272 | BN_CTX_free(new_ctx); |
273 | return ret; | 273 | return ret; |
274 | } | 274 | } |
@@ -349,7 +349,7 @@ ec_GFp_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) | |||
349 | } | 349 | } |
350 | ret = 1; | 350 | ret = 1; |
351 | 351 | ||
352 | err: | 352 | err: |
353 | if (ctx != NULL) | 353 | if (ctx != NULL) |
354 | BN_CTX_end(ctx); | 354 | BN_CTX_end(ctx); |
355 | BN_CTX_free(new_ctx); | 355 | BN_CTX_free(new_ctx); |
@@ -459,7 +459,7 @@ ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP * group, EC_POINT * | |||
459 | } | 459 | } |
460 | ret = 1; | 460 | ret = 1; |
461 | 461 | ||
462 | err: | 462 | err: |
463 | BN_CTX_free(new_ctx); | 463 | BN_CTX_free(new_ctx); |
464 | return ret; | 464 | return ret; |
465 | } | 465 | } |
@@ -507,7 +507,7 @@ ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP * group, const EC_P | |||
507 | 507 | ||
508 | ret = 1; | 508 | ret = 1; |
509 | 509 | ||
510 | err: | 510 | err: |
511 | BN_CTX_free(new_ctx); | 511 | BN_CTX_free(new_ctx); |
512 | return ret; | 512 | return ret; |
513 | } | 513 | } |
@@ -627,7 +627,7 @@ ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP * group, const EC_POIN | |||
627 | 627 | ||
628 | ret = 1; | 628 | ret = 1; |
629 | 629 | ||
630 | err: | 630 | err: |
631 | BN_CTX_end(ctx); | 631 | BN_CTX_end(ctx); |
632 | BN_CTX_free(new_ctx); | 632 | BN_CTX_free(new_ctx); |
633 | return ret; | 633 | return ret; |
@@ -814,7 +814,7 @@ ec_GFp_simple_add(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, cons | |||
814 | 814 | ||
815 | ret = 1; | 815 | ret = 1; |
816 | 816 | ||
817 | end: | 817 | end: |
818 | if (ctx) /* otherwise we already called BN_CTX_end */ | 818 | if (ctx) /* otherwise we already called BN_CTX_end */ |
819 | BN_CTX_end(ctx); | 819 | BN_CTX_end(ctx); |
820 | BN_CTX_free(new_ctx); | 820 | BN_CTX_free(new_ctx); |
@@ -957,7 +957,7 @@ ec_GFp_simple_dbl(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, BN_C | |||
957 | 957 | ||
958 | ret = 1; | 958 | ret = 1; |
959 | 959 | ||
960 | err: | 960 | err: |
961 | BN_CTX_end(ctx); | 961 | BN_CTX_end(ctx); |
962 | BN_CTX_free(new_ctx); | 962 | BN_CTX_free(new_ctx); |
963 | return ret; | 963 | return ret; |
@@ -1078,7 +1078,7 @@ ec_GFp_simple_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX | |||
1078 | 1078 | ||
1079 | ret = (0 == BN_ucmp(tmp, rh)); | 1079 | ret = (0 == BN_ucmp(tmp, rh)); |
1080 | 1080 | ||
1081 | err: | 1081 | err: |
1082 | BN_CTX_end(ctx); | 1082 | BN_CTX_end(ctx); |
1083 | BN_CTX_free(new_ctx); | 1083 | BN_CTX_free(new_ctx); |
1084 | return ret; | 1084 | return ret; |
@@ -1180,7 +1180,7 @@ ec_GFp_simple_cmp(const EC_GROUP * group, const EC_POINT * a, const EC_POINT * b | |||
1180 | /* points are equal */ | 1180 | /* points are equal */ |
1181 | ret = 0; | 1181 | ret = 0; |
1182 | 1182 | ||
1183 | end: | 1183 | end: |
1184 | BN_CTX_end(ctx); | 1184 | BN_CTX_end(ctx); |
1185 | BN_CTX_free(new_ctx); | 1185 | BN_CTX_free(new_ctx); |
1186 | return ret; | 1186 | return ret; |
@@ -1218,7 +1218,7 @@ ec_GFp_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx | |||
1218 | } | 1218 | } |
1219 | ret = 1; | 1219 | ret = 1; |
1220 | 1220 | ||
1221 | err: | 1221 | err: |
1222 | BN_CTX_end(ctx); | 1222 | BN_CTX_end(ctx); |
1223 | BN_CTX_free(new_ctx); | 1223 | BN_CTX_free(new_ctx); |
1224 | return ret; | 1224 | return ret; |
@@ -1383,7 +1383,7 @@ ec_GFp_simple_points_make_affine(const EC_GROUP * group, size_t num, EC_POINT * | |||
1383 | 1383 | ||
1384 | ret = 1; | 1384 | ret = 1; |
1385 | 1385 | ||
1386 | err: | 1386 | err: |
1387 | BN_CTX_end(ctx); | 1387 | BN_CTX_end(ctx); |
1388 | BN_CTX_free(new_ctx); | 1388 | BN_CTX_free(new_ctx); |
1389 | if (heap != NULL) { | 1389 | if (heap != NULL) { |