EVP: Fix evp_keymgmt_util_copy() for to->keymgmt == NULL
authorRichard Levitte <levitte@openssl.org>
Tue, 28 Apr 2020 06:41:20 +0000 (08:41 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 29 Apr 2020 13:35:02 +0000 (15:35 +0200)
commit036ee3706352970a15300b5cd4bf0b2cb370e12a
treee06f3007a03ee087219754dd3cb613d066c0c323
parenta6ed19dc9a9fc263a3b2e6b990e2face28a1a70d
EVP: Fix evp_keymgmt_util_copy() for to->keymgmt == NULL

evp_keymgmt_util_copy() didn't treat the case to->keymgmt correctly.
The proper change is to use from->keymgmt when to->keymgmt is NULL.

Fixes coverity #1462553

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