From e5a5fed7e30eec5f095d542a9d4be4968729d5bb Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 1 Jul 2023 14:56:12 +0000 Subject: [PATCH] Test and assign for EC_KEY_get0_private_key() --- lib/libcrypto/ecdh/ech_key.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/ecdh/ech_key.c b/lib/libcrypto/ecdh/ech_key.c index fc023af986f..f4d20cd0cee 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.24 2023/07/01 14:53:48 tb Exp $ */ +/* $OpenBSD: ech_key.c,v 1.25 2023/07/01 14:56:12 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -115,8 +115,7 @@ ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, if ((x = BN_CTX_get(ctx)) == NULL) goto err; - priv_key = EC_KEY_get0_private_key(ecdh); - if (priv_key == NULL) { + if ((priv_key = EC_KEY_get0_private_key(ecdh)) == NULL) { ECDHerror(ECDH_R_NO_PRIVATE_VALUE); goto err; } -- 2.20.1