Keep the provided peer EVP_PKEY in the EVP_PKEY_CTX too
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26976)
(cherry picked from commit 2656922feb
)
This commit is contained in:
parent
6fdf39cc7d
commit
18a17538cf
1 changed files with 7 additions and 1 deletions
|
@ -430,7 +430,13 @@ int EVP_PKEY_derive_set_peer_ex(EVP_PKEY_CTX *ctx, EVP_PKEY *peer,
|
|||
*/
|
||||
if (provkey == NULL)
|
||||
goto legacy;
|
||||
return ctx->op.kex.exchange->set_peer(ctx->op.kex.algctx, provkey);
|
||||
ret = ctx->op.kex.exchange->set_peer(ctx->op.kex.algctx, provkey);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
EVP_PKEY_free(ctx->peerkey);
|
||||
ctx->peerkey = peer;
|
||||
EVP_PKEY_up_ref(peer);
|
||||
return 1;
|
||||
|
||||
legacy:
|
||||
#ifdef FIPS_MODULE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue