From: tb Date: Sat, 1 Jul 2023 14:56:12 +0000 (+0000) Subject: Test and assign for EC_KEY_get0_private_key() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e5a5fed7e30eec5f095d542a9d4be4968729d5bb;p=openbsd Test and assign for EC_KEY_get0_private_key() --- 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; }