Fix crash in genpkey app when -pkeyopt digest:name is used for DH or DSA.
authorShane Lontis <shane.lontis@oracle.com>
Wed, 18 Nov 2020 01:32:33 +0000 (11:32 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Fri, 20 Nov 2020 01:59:23 +0000 (11:59 +1000)
commitf2a7151849a566892912737f7b633c04f64a2b9e
treed0f3046e6d519d66137111a426c80a60fbd22adf
parentae2e4d1fd11910245b6f7b4db31cccf1ff4bec60
Fix crash in genpkey app when -pkeyopt digest:name is used for DH or DSA.

By the time the keygen is called the references to strings inside the
gen ctx are floating pointers. A strdup solves this problem.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13432)
providers/implementations/keymgmt/dh_kmgmt.c
providers/implementations/keymgmt/dsa_kmgmt.c
test/recipes/15-test_gendh.t
test/recipes/15-test_gendsa.t