summaryrefslogtreecommitdiffstats
path: root/crypto/jpake
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-10-30 11:12:26 +0000
committerMatt Caswell <matt@openssl.org>2015-11-09 22:48:41 +0000
commit90945fa31a42dcf3beb90540c618e4d627c595ea (patch)
treee73870c253abf0c37ca618384e30a7937a996b55 /crypto/jpake
parenta71edf3ba275b946224b5bcded0a8ecfce1855c0 (diff)
Continue standardising malloc style for libcrypto
Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'crypto/jpake')
-rw-r--r--crypto/jpake/jpake.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/jpake/jpake.c b/crypto/jpake/jpake.c
index a8aa87d197..abbcb89a2a 100644
--- a/crypto/jpake/jpake.c
+++ b/crypto/jpake/jpake.c
@@ -201,6 +201,9 @@ static int generate_zkp(JPAKE_STEP_PART *p, const BIGNUM *x,
BIGNUM *h = BN_new();
BIGNUM *t = BN_new();
+ if (r == NULL || h == NULL || t == NULL)
+ goto end;
+
/*-
* r in [0,q)
* XXX: Java chooses r in [0, 2^160) - i.e. distribution not uniform
@@ -235,6 +238,9 @@ static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg,
BIGNUM *t3 = BN_new();
int ret = 0;
+ if (h == NULL || t1 == NULL || t2 == NULL || t3 == NULL)
+ goto end;
+
if (!zkp_hash(h, zkpg, p, ctx->p.peer_name))
goto end;