EVP: Let EVP_PKEY_gen() initialize ctx->keygen_info
authorRichard Levitte <levitte@openssl.org>
Thu, 4 Jun 2020 18:05:26 +0000 (20:05 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 8 Jun 2020 21:50:22 +0000 (23:50 +0200)
commit4ec1463d71db6324abe9c91d2ed9aa1e136c9cb3
treefea3280e6d465bdcfe522157140f74613444fd3a
parenta6d36303e91b79379da2e2ffaa608dba704d3eb8
EVP: Let EVP_PKEY_gen() initialize ctx->keygen_info

In EVP_PKEY_METHOD code, the backend initializes ctx->keygen_info.
With provider side code, it's not possible to reach back into the
EVP_PKEY_CTX in the same manner, so we need to make that
initialization in the central generation function, EVP_PKEY_gen().

This isn't quite compatible with the idea that keygen_info could have
an arbitrary amount of elements, but since all our legacy backends use
exactly two elements, that's what we go for.

Fixes #12047

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/12048)
crypto/evp/pmeth_gn.c