diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ec2_mult.c')
-rw-r--r-- | src/lib/libcrypto/ec/ec2_mult.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/ec/ec2_mult.c b/src/lib/libcrypto/ec/ec2_mult.c index dd113907be..8f0091efe1 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.6 2015/02/08 22:25:03 miod Exp $ */ | 1 | /* $OpenBSD: ec2_mult.c,v 1.7 2015/02/09 15:49:22 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -91,8 +91,7 @@ gf2m_Mdouble(const EC_GROUP *group, BIGNUM *x, BIGNUM *z, BN_CTX *ctx) | |||
91 | 91 | ||
92 | /* Since Mdouble is static we can guarantee that ctx != NULL. */ | 92 | /* Since Mdouble is static we can guarantee that ctx != NULL. */ |
93 | BN_CTX_start(ctx); | 93 | BN_CTX_start(ctx); |
94 | t1 = BN_CTX_get(ctx); | 94 | if ((t1 = BN_CTX_get(ctx)) == NULL) |
95 | if (t1 == NULL) | ||
96 | goto err; | 95 | goto err; |
97 | 96 | ||
98 | if (!group->meth->field_sqr(group, x, x, ctx)) | 97 | if (!group->meth->field_sqr(group, x, x, ctx)) |
@@ -132,9 +131,9 @@ gf2m_Madd(const EC_GROUP *group, const BIGNUM *x, BIGNUM *x1, BIGNUM *z1, | |||
132 | 131 | ||
133 | /* Since Madd is static we can guarantee that ctx != NULL. */ | 132 | /* Since Madd is static we can guarantee that ctx != NULL. */ |
134 | BN_CTX_start(ctx); | 133 | BN_CTX_start(ctx); |
135 | t1 = BN_CTX_get(ctx); | 134 | if ((t1 = BN_CTX_get(ctx)) == NULL) |
136 | t2 = BN_CTX_get(ctx); | 135 | goto err; |
137 | if (t2 == NULL) | 136 | if ((t2 = BN_CTX_get(ctx)) == NULL) |
138 | goto err; | 137 | goto err; |
139 | 138 | ||
140 | if (!BN_copy(t1, x)) | 139 | if (!BN_copy(t1, x)) |
@@ -191,10 +190,11 @@ gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIGNUM *x1, | |||
191 | } | 190 | } |
192 | /* Since Mxy is static we can guarantee that ctx != NULL. */ | 191 | /* Since Mxy is static we can guarantee that ctx != NULL. */ |
193 | BN_CTX_start(ctx); | 192 | BN_CTX_start(ctx); |
194 | t3 = BN_CTX_get(ctx); | 193 | if ((t3 = BN_CTX_get(ctx)) == NULL) |
195 | t4 = BN_CTX_get(ctx); | 194 | goto err; |
196 | t5 = BN_CTX_get(ctx); | 195 | if ((t4 = BN_CTX_get(ctx)) == NULL) |
197 | if (t5 == NULL) | 196 | goto err; |
197 | if ((t5 = BN_CTX_get(ctx)) == NULL) | ||
198 | goto err; | 198 | goto err; |
199 | 199 | ||
200 | if (!BN_one(t5)) | 200 | if (!BN_one(t5)) |
@@ -281,9 +281,9 @@ ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, | |||
281 | 281 | ||
282 | /* Since point_multiply is static we can guarantee that ctx != NULL. */ | 282 | /* Since point_multiply is static we can guarantee that ctx != NULL. */ |
283 | BN_CTX_start(ctx); | 283 | BN_CTX_start(ctx); |
284 | x1 = BN_CTX_get(ctx); | 284 | if ((x1 = BN_CTX_get(ctx)) == NULL) |
285 | z1 = BN_CTX_get(ctx); | 285 | goto err; |
286 | if (z1 == NULL) | 286 | if ((z1 = BN_CTX_get(ctx)) == NULL) |
287 | goto err; | 287 | goto err; |
288 | 288 | ||
289 | x2 = &r->X; | 289 | x2 = &r->X; |