openssl/crypto
Richard Levitte 1296c2ec78 Restore the meaning of EVP_PKEY_print_private()
With pre-3.0 OpenSSL, EVP_PKEY_print_private() calls the EVP_PKEY_ASN1_METHOD
function "priv_print", effectively asking the backend to print whatever it
regards as private key components.

In all backends that were built into libcrypto, this function printed what
was included in the private key structure, which usually includes the
public key components as well.

With OpenSSL 3.0, some of the corresponding key2text encoders got a
slightly different behavior, where the presence of the selector
OSSL_KEYMGMT_SELECT_PRIVATE_KEY without the presence of the selector
OSSL_KEYMGMT_SELECT_PUBLIC_KEY would only get what would intuitively be
regarded as private key components printed.  This isn't entirely consistent,
though, as the RSA key2text encoder will still print the public key
components regardless.

To compensate for the changed backend behavior, EVP_PKEY_print_private()
was made to ask the encoder to print the keypair rather than just the
private key, thereby moving the backend semantics to the application API.
Unfortunately, this causes confusion for providers where the key2text
encoder really should print the private key only.

This change restores the built-in 1.1.1 backend behavior in the encoders
that OpenSSL provides, and renders EVP_PKEY_print_private() more true to its
documented behavior, leaving it to the backend to decide what it regards as
"private key components".

Fixes #22233

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22237)
2023-10-04 08:10:55 +02:00
..
aes Improve performance for 6x unrolling with vpermxor instruction 2023-10-02 14:00:23 +02:00
aria
asn1 Copyright year updates 2023-09-07 09:59:15 +01:00
async
bf
bio Copyright year updates 2023-09-28 14:23:29 +01:00
bn Copyright year updates 2023-09-07 09:59:15 +01:00
buffer
camellia
cast Copyright year updates 2023-09-07 09:59:15 +01:00
chacha LoongArch64 assembly pack: add ChaCha20 modules 2023-09-11 08:49:09 +10:00
cmac Copyright year updates 2023-09-07 09:59:15 +01:00
cmp cmp_vfy.c: Use verification callback if cert_acceptable() finds expired cert 2023-09-21 11:15:49 +10:00
cms Check error return from cms_sd_asn1_ctrl() correctly. 2023-09-08 16:31:47 +10:00
comp Copyright year updates 2023-09-07 09:59:15 +01:00
conf "foo * bar" should be "foo *bar" 2023-09-11 10:15:30 +02:00
crmf Copyright year updates 2023-09-07 09:59:15 +01:00
ct
des Copyright year updates 2023-09-07 09:59:15 +01:00
dh Copyright year updates 2023-09-07 09:59:15 +01:00
dsa Copyright year updates 2023-09-07 09:59:15 +01:00
dso Copyright year updates 2023-09-07 09:59:15 +01:00
ec Copyright year updates 2023-09-28 14:23:29 +01:00
encode_decode Copyright year updates 2023-09-07 09:59:15 +01:00
engine Improved detection of engine-provided private "classic" keys 2023-10-04 11:02:00 +11:00
err rand: add extra error code 2023-09-27 17:22:54 +01:00
ess
evp Restore the meaning of EVP_PKEY_print_private() 2023-10-04 08:10:55 +02:00
ffc Copyright year updates 2023-09-07 09:59:15 +01:00
hmac
hpke Copyright year updates 2023-09-07 09:59:15 +01:00
http Remove repeated words 2023-09-11 10:15:30 +02:00
idea
kdf
lhash All lh_stats functions were deprecated in 3.1 2023-10-04 07:52:41 +11:00
md2
md4
md5 Copyright year updates 2023-09-07 09:59:15 +01:00
mdc2
modes Copyright year updates 2023-09-07 09:59:15 +01:00
objects obj_xref.h: make update 2023-10-02 12:46:24 +02:00
ocsp Copyright year updates 2023-09-07 09:59:15 +01:00
pem Copyright year updates 2023-09-28 14:23:29 +01:00
perlasm Copyright year updates 2023-09-07 09:59:15 +01:00
pkcs7 Copyright year updates 2023-09-07 09:59:15 +01:00
pkcs12 Copyright year updates 2023-09-28 14:23:29 +01:00
poly1305 Copyright year updates 2023-09-07 09:59:15 +01:00
property Copyright year updates 2023-09-07 09:59:15 +01:00
rand Coverity 1545175: use after free 2023-10-02 19:18:21 +11:00
rc2 Copyright year updates 2023-09-07 09:59:15 +01:00
rc4 Copyright year updates 2023-09-07 09:59:15 +01:00
rc5 Copyright year updates 2023-09-07 09:59:15 +01:00
ripemd
rsa Fix a possible memleak in rsa_pub_encode 2023-09-11 10:48:54 +02:00
seed
sha Copyright year updates 2023-09-28 14:23:29 +01:00
siphash
sm2 Copyright year updates 2023-09-07 09:59:15 +01:00
sm3 Copyright year updates 2023-09-07 09:59:15 +01:00
sm4 Copyright year updates 2023-09-07 09:59:15 +01:00
srp Copyright year updates 2023-09-28 14:23:29 +01:00
stack Copyright year updates 2023-09-07 09:59:15 +01:00
store Copyright year updates 2023-09-28 14:23:29 +01:00
thread Copyright year updates 2023-09-07 09:59:15 +01:00
ts Copyright year updates 2023-09-07 09:59:15 +01:00
txt_db Copyright year updates 2023-09-07 09:59:15 +01:00
ui Copyright year updates 2023-09-07 09:59:15 +01:00
whrlpool Copyright year updates 2023-09-07 09:59:15 +01:00
x509 Copyright year updates 2023-09-28 14:23:29 +01:00
LPdir_nyi.c
LPdir_unix.c Copyright year updates 2023-09-07 09:59:15 +01:00
LPdir_vms.c
LPdir_win.c
LPdir_win32.c
LPdir_wince.c
README-sparse_array.md
alphacpuid.pl
arm64cpuid.pl
arm_arch.h Copyright year updates 2023-09-07 09:59:15 +01:00
armcap.c
armv4cpuid.pl Copyright year updates 2023-09-07 09:59:15 +01:00
asn1_dsa.c
bsearch.c
build.info Do not include sparse_array.o in libssl 2023-09-22 20:42:48 +02:00
c64xpluscpuid.pl
context.c Copyright year updates 2023-09-07 09:59:15 +01:00
core_algorithm.c
core_fetch.c
core_namemap.c Copyright year updates 2023-09-07 09:59:15 +01:00
cpt_err.c
cpuid.c Copyright year updates 2023-09-28 14:23:29 +01:00
cryptlib.c Copyright year updates 2023-09-07 09:59:15 +01:00
ctype.c Copyright year updates 2023-09-07 09:59:15 +01:00
cversion.c
der_writer.c
deterministic_nonce.c Copyright year updates 2023-09-07 09:59:15 +01:00
dllmain.c
ebcdic.c
ex_data.c Fix error handling in CRYPTO_get_ex_new_index 2023-09-21 14:43:08 +02:00
getenv.c
ia64cpuid.S
info.c Copyright year updates 2023-09-07 09:59:15 +01:00
init.c Copyright year updates 2023-09-07 09:59:15 +01:00
initthread.c Copyright year updates 2023-09-28 14:23:29 +01:00
loongarch64cpuid.pl
loongarch_arch.h Copyright year updates 2023-09-07 09:59:15 +01:00
loongarchcap.c Copyright year updates 2023-09-07 09:59:15 +01:00
mem.c Copyright year updates 2023-09-07 09:59:15 +01:00
mem_clr.c
mem_sec.c Copyright year updates 2023-09-07 09:59:15 +01:00
mips_arch.h
o_dir.c
o_fopen.c
o_init.c
o_str.c Copyright year updates 2023-09-28 14:23:29 +01:00
o_time.c
packet.c Copyright year updates 2023-09-07 09:59:15 +01:00
param_build.c Copyright year updates 2023-09-07 09:59:15 +01:00
param_build_set.c
params.c Copyright year updates 2023-09-07 09:59:15 +01:00
params_dup.c
params_from_text.c
params_idx.c.in
pariscid.pl
passphrase.c
ppccap.c
ppccpuid.pl
provider.c Copyright year updates 2023-09-07 09:59:15 +01:00
provider_child.c Copyright year updates 2023-09-07 09:59:15 +01:00
provider_conf.c Copyright year updates 2023-09-07 09:59:15 +01:00
provider_core.c fips: use seed source requested 2023-09-27 17:23:04 +01:00
provider_local.h
provider_predefined.c
punycode.c Copyright year updates 2023-09-07 09:59:15 +01:00
quic_vlint.c
riscv32cpuid.pl
riscv64cpuid.pl
riscvcap.c
s390x_arch.h Copyright year updates 2023-09-07 09:59:15 +01:00
s390xcap.c Copyright year updates 2023-09-07 09:59:15 +01:00
s390xcpuid.pl
self_test_core.c
sleep.c Copyright year updates 2023-09-07 09:59:15 +01:00
sparccpuid.S
sparcv9cap.c
sparse_array.c
threads_lib.c
threads_none.c Copyright year updates 2023-09-07 09:59:15 +01:00
threads_pthread.c Copyright year updates 2023-09-07 09:59:15 +01:00
threads_win.c Copyright year updates 2023-09-07 09:59:15 +01:00
time.c Copyright year updates 2023-09-07 09:59:15 +01:00
trace.c "foo * bar" should be "foo *bar" 2023-09-11 10:15:30 +02:00
uid.c Copyright year updates 2023-09-07 09:59:15 +01:00
vms_rms.h
x86_64cpuid.pl
x86cpuid.pl