CORE & PROV: make export of key data leaner through callback
authorRichard Levitte <levitte@openssl.org>
Fri, 8 Nov 2019 14:24:42 +0000 (15:24 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 14 Nov 2019 09:53:14 +0000 (10:53 +0100)
commit1640d48c5b4ee0a3ff5a2a5015ee17ac163d9cd4
tree24fb95a9c51ec8fac457e00b924b853ad098bffc
parent726ad13c4e720daeda5f56326aebcd27b4615d6c
CORE & PROV: make export of key data leaner through callback

Exporting data from a provider owned domainparams or key is quite an
ordeal, with having to figure out what parameter keys an
implementation supports, call the export function a first time to find
out how large each parameter buffer must be, allocate the necessary
space for it, and call the export function again.

So how about letting the export function build up the key data params
and call back with that?  This change implements exactly such a
mechanism.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10414)
crypto/evp/keymgmt_lib.c
include/crypto/evp.h
include/openssl/core_numbers.h
providers/implementations/keymgmt/dh_kmgmt.c
providers/implementations/keymgmt/dsa_kmgmt.c
providers/implementations/keymgmt/rsa_kmgmt.c
test/keymgmt_internal_test.c