diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-07-01 14:56:13 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-07-01 14:56:13 +0000 |
commit | 9f47a110a1bcb281874be2012016f9916613e821 (patch) | |
tree | 2575a4754498dcdf98a32a368cf05edcc532b845 /lib | |
parent | 7fbf0b743e1509453e99492cfb70f46362ceb80b (diff) |
Test and assign for EC_KEY_get0_private_key()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/ecdh/ech_key.c | 5 |
1 files 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; } |