From f16eb02d40c6aec83f2b2f9bb48cf5081a7799ad Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Sat, 1 Jul 2023 14:39:35 +0000 Subject: Remove unused y from ECDH key computation ok jsing --- lib/libcrypto/ecdh/ech_key.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/libcrypto/ecdh/ech_key.c b/lib/libcrypto/ecdh/ech_key.c index e41092a411c..1dfb3c0fa90 100644 --- a/lib/libcrypto/ecdh/ech_key.c +++ b/lib/libcrypto/ecdh/ech_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ech_key.c,v 1.19 2023/06/25 19:35:56 tb Exp $ */ +/* $OpenBSD: ech_key.c,v 1.20 2023/07/01 14:39:34 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -94,7 +94,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, { BN_CTX *ctx; EC_POINT *tmp = NULL; - BIGNUM *x = NULL, *y = NULL; + BIGNUM *x; const BIGNUM *priv_key; const EC_GROUP* group; int ret = -1; @@ -109,11 +109,11 @@ ossl_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); + 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) { @@ -136,7 +136,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, goto err; } - if (!EC_POINT_get_affine_coordinates(group, tmp, x, y, ctx)) { + if (!EC_POINT_get_affine_coordinates(group, tmp, x, NULL, ctx)) { ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); goto err; } -- cgit v1.2.3