summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/ec/ec2_mult.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/ec/ec2_mult.c')
-rw-r--r--lib/libcrypto/ec/ec2_mult.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/libcrypto/ec/ec2_mult.c b/lib/libcrypto/ec/ec2_mult.c
index dd113907be1..8f0091efe1c 100644
--- a/lib/libcrypto/ec/ec2_mult.c
+++ b/lib/libcrypto/ec/ec2_mult.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec2_mult.c,v 1.6 2015/02/08 22:25:03 miod Exp $ */
+/* $OpenBSD: ec2_mult.c,v 1.7 2015/02/09 15:49:22 jsing Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
@@ -91,8 +91,7 @@ gf2m_Mdouble(const EC_GROUP *group, BIGNUM *x, BIGNUM *z, BN_CTX *ctx)
/* Since Mdouble is static we can guarantee that ctx != NULL. */
BN_CTX_start(ctx);
- t1 = BN_CTX_get(ctx);
- if (t1 == NULL)
+ if ((t1 = BN_CTX_get(ctx)) == NULL)
goto err;
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,
/* Since Madd is static we can guarantee that ctx != NULL. */
BN_CTX_start(ctx);
- t1 = BN_CTX_get(ctx);
- t2 = BN_CTX_get(ctx);
- if (t2 == NULL)
+ if ((t1 = BN_CTX_get(ctx)) == NULL)
+ goto err;
+ if ((t2 = BN_CTX_get(ctx)) == NULL)
goto err;
if (!BN_copy(t1, x))
@@ -191,10 +190,11 @@ gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIGNUM *x1,
}
/* Since Mxy is static we can guarantee that ctx != NULL. */
BN_CTX_start(ctx);
- t3 = BN_CTX_get(ctx);
- t4 = BN_CTX_get(ctx);
- t5 = BN_CTX_get(ctx);
- if (t5 == NULL)
+ if ((t3 = BN_CTX_get(ctx)) == NULL)
+ goto err;
+ if ((t4 = BN_CTX_get(ctx)) == NULL)
+ goto err;
+ if ((t5 = BN_CTX_get(ctx)) == NULL)
goto err;
if (!BN_one(t5))
@@ -281,9 +281,9 @@ ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
/* Since point_multiply is static we can guarantee that ctx != NULL. */
BN_CTX_start(ctx);
- x1 = BN_CTX_get(ctx);
- z1 = BN_CTX_get(ctx);
- if (z1 == NULL)
+ if ((x1 = BN_CTX_get(ctx)) == NULL)
+ goto err;
+ if ((z1 = BN_CTX_get(ctx)) == NULL)
goto err;
x2 = &r->X;