summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-07-01 14:39:34 +0000
committertb <>2023-07-01 14:39:34 +0000
commit0b62628544207292086b9e49e37fcd12d51198dd (patch)
treef46b92f6ee36b58f00ed56adef02f9491252b31c /src/lib
parenta74136f19ed149310b64404ef25b80776e327e13 (diff)
downloadopenbsd-0b62628544207292086b9e49e37fcd12d51198dd.tar.gz
openbsd-0b62628544207292086b9e49e37fcd12d51198dd.tar.bz2
openbsd-0b62628544207292086b9e49e37fcd12d51198dd.zip
Remove unused y from ECDH key computation
ok jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/ecdh/ech_key.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c
index e41092a411..1dfb3c0fa9 100644
--- a/src/lib/libcrypto/ecdh/ech_key.c
+++ b/src/lib/libcrypto/ecdh/ech_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ech_key.c,v 1.19 2023/06/25 19:35:56 tb Exp $ */ 1/* $OpenBSD: ech_key.c,v 1.20 2023/07/01 14:39:34 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -94,7 +94,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
94{ 94{
95 BN_CTX *ctx; 95 BN_CTX *ctx;
96 EC_POINT *tmp = NULL; 96 EC_POINT *tmp = NULL;
97 BIGNUM *x = NULL, *y = NULL; 97 BIGNUM *x;
98 const BIGNUM *priv_key; 98 const BIGNUM *priv_key;
99 const EC_GROUP* group; 99 const EC_GROUP* group;
100 int ret = -1; 100 int ret = -1;
@@ -109,11 +109,11 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
109 109
110 if ((ctx = BN_CTX_new()) == NULL) 110 if ((ctx = BN_CTX_new()) == NULL)
111 goto err; 111 goto err;
112
112 BN_CTX_start(ctx); 113 BN_CTX_start(ctx);
114
113 if ((x = BN_CTX_get(ctx)) == NULL) 115 if ((x = BN_CTX_get(ctx)) == NULL)
114 goto err; 116 goto err;
115 if ((y = BN_CTX_get(ctx)) == NULL)
116 goto err;
117 117
118 priv_key = EC_KEY_get0_private_key(ecdh); 118 priv_key = EC_KEY_get0_private_key(ecdh);
119 if (priv_key == NULL) { 119 if (priv_key == NULL) {
@@ -136,7 +136,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
136 goto err; 136 goto err;
137 } 137 }
138 138
139 if (!EC_POINT_get_affine_coordinates(group, tmp, x, y, ctx)) { 139 if (!EC_POINT_get_affine_coordinates(group, tmp, x, NULL, ctx)) {
140 ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); 140 ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE);
141 goto err; 141 goto err;
142 } 142 }