projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Swap to using _longjmp/_setjmp instead of longjmp/setjmp
[oweals/openssl.git]
/
crypto
/
ec
/
ecp_smpl.c
diff --git
a/crypto/ec/ecp_smpl.c
b/crypto/ec/ecp_smpl.c
index 2d42d34f51cb8dd580fc937b1b36b8ec72d7b82d..a4830cb0067207fb5c3b3797cf56fdb7c8030e4f 100644
(file)
--- a/
crypto/ec/ecp_smpl.c
+++ b/
crypto/ec/ecp_smpl.c
@@
-132,7
+132,7
@@
int ec_GFp_simple_group_init(EC_GROUP *group)
group->field = BN_new();
group->a = BN_new();
group->b = BN_new();
group->field = BN_new();
group->a = BN_new();
group->b = BN_new();
- if (
!group->field || !group->a || !group->b
) {
+ if (
group->field == NULL || group->a == NULL || group->b == NULL
) {
BN_free(group->field);
BN_free(group->a);
BN_free(group->b);
BN_free(group->field);
BN_free(group->a);
BN_free(group->b);
@@
-225,8
+225,7
@@
int ec_GFp_simple_group_set_curve(EC_GROUP *group,
err:
BN_CTX_end(ctx);
err:
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-271,8
+270,7
@@
int ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
ret = 1;
err:
ret = 1;
err:
- if (new_ctx)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-350,8
+348,7
@@
int ec_GFp_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
err:
if (ctx != NULL)
BN_CTX_end(ctx);
err:
if (ctx != NULL)
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-362,13
+359,10
@@
int ec_GFp_simple_point_init(EC_POINT *point)
point->Z = BN_new();
point->Z_is_one = 0;
point->Z = BN_new();
point->Z_is_one = 0;
- if (!point->X || !point->Y || !point->Z) {
- if (point->X)
- BN_free(point->X);
- if (point->Y)
- BN_free(point->Y);
- if (point->Z)
- BN_free(point->Z);
+ if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
+ BN_free(point->X);
+ BN_free(point->Y);
+ BN_free(point->Z);
return 0;
}
return 1;
return 0;
}
return 1;
@@
-466,8
+460,7
@@
int ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
ret = 1;
err:
ret = 1;
err:
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-516,8
+509,7
@@
int ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
ret = 1;
err:
ret = 1;
err:
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-649,8
+641,7
@@
int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group,
err:
BN_CTX_end(ctx);
err:
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-836,8
+827,7
@@
int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
end:
if (ctx) /* otherwise we already called BN_CTX_end */
BN_CTX_end(ctx);
end:
if (ctx) /* otherwise we already called BN_CTX_end */
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-979,8
+969,7
@@
int ec_GFp_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
err:
BN_CTX_end(ctx);
err:
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-1097,8
+1086,7
@@
int ec_GFp_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
err:
BN_CTX_end(ctx);
err:
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-1206,8
+1194,7
@@
int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
end:
BN_CTX_end(ctx);
end:
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-1246,8
+1233,7
@@
int ec_GFp_simple_make_affine(const EC_GROUP *group, EC_POINT *point,
err:
BN_CTX_end(ctx);
err:
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
return ret;
}
return ret;
}
@@
-1398,8
+1384,7
@@
int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num,
err:
BN_CTX_end(ctx);
err:
BN_CTX_end(ctx);
- if (new_ctx != NULL)
- BN_CTX_free(new_ctx);
+ BN_CTX_free(new_ctx);
if (prod_Z != NULL) {
for (i = 0; i < num; i++) {
if (prod_Z[i] == NULL)
if (prod_Z != NULL) {
for (i = 0; i < num; i++) {
if (prod_Z[i] == NULL)