From 219f0b07279a03e1a7dae34072df1b15ffc8ffb1 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 1 Jul 2023 14:57:51 +0000 Subject: Garbage collect the now unused len --- src/lib/libcrypto/ecdh/ech_key.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c index f4d20cd0ce..7d4fba76fe 100644 --- a/src/lib/libcrypto/ecdh/ech_key.c +++ b/src/lib/libcrypto/ecdh/ech_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ech_key.c,v 1.25 2023/07/01 14:56:12 tb Exp $ */ +/* $OpenBSD: ech_key.c,v 1.26 2023/07/01 14:57:51 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -98,7 +98,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, const BIGNUM *priv_key; const EC_GROUP* group; unsigned char *buf = NULL; - int buflen, len; + int buflen; int ret = -1; if (outlen > INT_MAX) { @@ -141,9 +141,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, goto err; } - buflen = ECDH_size(ecdh); - len = BN_num_bytes(x); - if (len > buflen) { + if ((buflen = ECDH_size(ecdh)) < BN_num_bytes(x)) { ECDHerror(ERR_R_INTERNAL_ERROR); goto err; } -- cgit v1.2.3-55-g6feb