EVP: use evp_pkey_copy_downgraded() in EVP_PKEY_copy_parameters()
authorRichard Levitte <levitte@openssl.org>
Sat, 7 Nov 2020 10:31:35 +0000 (11:31 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 5 Feb 2021 13:16:17 +0000 (14:16 +0100)
commit93d6132a79d85127dffa1ce4e62b264cf38c296d
tree597c4d283c2527adc02d9b2ba00a23494cceca67
parent93bae03abfdb1cb8047c2bef85e48b60891ecf54
EVP: use evp_pkey_copy_downgraded() in EVP_PKEY_copy_parameters()

We used evp_pkey_downgrade() on 'from', which permanently converts 'from'
to have a legacy internal key.  Now that we have evp_pkey_copy_downgraded(),
it's better to use that (and thereby restore the constness contract).

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13341)
crypto/evp/p_lib.c