summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/ecdh/ech_ossl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/ecdh/ech_ossl.c')
-rw-r--r--lib/libcrypto/ecdh/ech_ossl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libcrypto/ecdh/ech_ossl.c b/lib/libcrypto/ecdh/ech_ossl.c
index ee130edeee4..4fae7cacfdb 100644
--- a/lib/libcrypto/ecdh/ech_ossl.c
+++ b/lib/libcrypto/ecdh/ech_ossl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ech_ossl.c,v 1.8 2014/07/12 16:03:37 miod Exp $ */
+/* $OpenBSD: ech_ossl.c,v 1.9 2015/02/09 15:49:22 jsing Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
@@ -120,8 +120,10 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
if ((ctx = BN_CTX_new()) == NULL) goto err;
BN_CTX_start(ctx);
- x = BN_CTX_get(ctx);
- y = BN_CTX_get(ctx);
+ if ((x = BN_CTX_get(ctx)) == NULL)
+ goto err;
+ if ((y = BN_CTX_get(ctx)) == NULL)
+ goto err;
priv_key = EC_KEY_get0_private_key(ecdh);
if (priv_key == NULL)