When exporting/importing decoded keys do not use 0 as selection
authorTomas Mraz <tomas@openssl.org>
Fri, 21 Jul 2023 15:40:31 +0000 (17:40 +0200)
committerTodd Short <todd.short@me.com>
Fri, 4 Aug 2023 14:13:40 +0000 (10:13 -0400)
commit137ba0567417441cd8b3d43cf23e27d73f7a7684
treeaf24f3f41223934a448e0e8c4242974a54368d2a
parent8865d7c4e8f9afac969fc927f2b24ee6d03868bd
When exporting/importing decoded keys do not use 0 as selection

When decoding 0 as the selection means to decode anything
you get.

However when exporting and then importing the key data 0 as
selection is not meaningful.
So we set it to OSSL_KEYMGMT_SELECT_ALL to make the export/import
function export/import everything that we have decoded.

Fixes #21493

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/21519)

(cherry picked from commit 2acb0d363c0032b5b97c4f6596609f40bd7d842f)
crypto/encode_decode/decoder_pkey.c
providers/implementations/encode_decode/decode_der2key.c
providers/implementations/encode_decode/decode_msblob2key.c
providers/implementations/encode_decode/decode_pvk2key.c