openssl/crypto
Richard Levitte f11f24e79d 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)

(cherry picked from commit 1296c2ec78)
2023-10-04 08:14:07 +02:00
..
aes Copyright year updates 2023-09-19 14:57:48 +02:00
aria
asn1 Copyright year updates 2023-09-19 14:57:48 +02:00
async Update copyright year 2022-03-15 13:52:58 +00:00
bf Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
bio Update copyright year 2023-03-14 12:49:46 +00:00
bn Copyright year updates 2023-09-19 14:57:48 +02:00
buffer
camellia Rename x86-32 assembly files from .s to .S. 2022-05-24 13:17:03 +10:00
cast Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
chacha Copyright year updates 2023-09-19 14:57:48 +02:00
cmac Update copyright year 2022-06-21 14:03:39 +01:00
cmp Copyright year updates 2023-09-19 14:57:48 +02:00
cms Copyright year updates 2023-09-19 14:57:48 +02:00
comp Fix coverity 1493364 & 1493375: unchecked return value 2021-11-08 08:56:38 +10:00
conf OPENSSL_init_crypto load config into initial global default library context 2023-08-31 17:07:34 +02:00
crmf Fix the check of EVP_PKEY_decrypt_init 2022-12-05 13:05:43 +01:00
ct Update copyright year 2022-06-21 14:03:39 +01:00
des Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
dh Copyright year updates 2023-08-01 14:35:30 +01:00
dsa Update copyright year 2023-05-30 14:11:01 +02:00
dso Update copyright year 2022-12-01 12:47:05 +01:00
ec Copyright year updates 2023-09-19 14:57:48 +02:00
encode_decode Copyright year updates 2023-09-19 14:57:48 +02:00
engine Improved detection of engine-provided private "classic" keys 2023-10-04 11:02:40 +11:00
err rand: add extra error code 2023-10-03 18:54:03 +11:00
ess
evp Restore the meaning of EVP_PKEY_print_private() 2023-10-04 08:14:07 +02:00
ffc Update copyright year 2023-03-14 12:49:46 +00:00
hmac
http OSSL_HTTP_{REQ_CTX_set_request_line(),_set1_request()}: backward compat w.r.t. path parameter 2023-08-10 17:30:06 +02:00
idea Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
kdf
lhash Fix error handling in lhash contract 2023-09-21 14:50:58 +02:00
md2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
md4 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
md5 Update copyright year 2023-05-30 14:11:01 +02:00
mdc2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
modes Do not use stitched AES-GCM implementation on PPC32 2023-06-30 08:31:20 +10:00
objects no_autoload: make the no-autoload-config option work again. 2023-08-04 11:58:09 +10:00
ocsp Update copyright year 2023-03-14 12:49:46 +00:00
pem Copyright year updates 2023-09-19 14:57:48 +02:00
perlasm Copyright year updates 2023-09-19 14:57:48 +02:00
pkcs7 Update copyright year 2023-03-14 12:49:46 +00:00
pkcs12 Copyright year updates 2023-09-19 14:57:48 +02:00
poly1305 Copyright year updates 2023-09-19 14:57:48 +02:00
property no_autoload: make the no-autoload-config option work again. 2023-08-04 11:58:09 +10:00
rand Coverity 1545175: use after free 2023-10-03 19:03:41 +11:00
rc2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
rc4 Set RC4 defines on libcrypto/liblegacy 2023-06-10 13:01:58 +02:00
rc5 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
ripemd Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
rsa Fix a possible memleak in rsa_pub_encode 2023-09-11 10:49:25 +02:00
seed Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
sha Copyright year updates 2023-09-19 14:57:48 +02:00
siphash crypto/*: Fix various typos, repeated words, align some spelling to LDP. 2022-11-23 18:21:47 +01:00
sm2 Update copyright year 2023-05-30 14:11:01 +02:00
sm3 Copyright year updates 2023-08-01 14:35:30 +01:00
sm4 Use armv8 .quad instead of .dword 2023-09-05 13:35:27 +02:00
srp Copyright year updates 2023-09-19 14:57:48 +02:00
stack Errors raised from OPENSSL_sk_set should have ERR_LIB_CRYPTO 2022-10-21 18:03:37 +02:00
store Copyright year updates 2023-09-19 14:57:48 +02:00
ts Update copyright year 2022-12-01 12:47:05 +01:00
txt_db Update copyright year 2022-12-01 12:47:05 +01:00
ui Update copyright year 2023-05-30 14:11:01 +02:00
whrlpool Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:59 +11:00
x509 Check i2d_X509_NAME return in X509_NAME_hash_ex/old 2023-08-16 10:47:32 +02:00
LPdir_nyi.c
LPdir_unix.c Copyright year updates 2023-08-01 14:35:30 +01:00
LPdir_vms.c
LPdir_win.c
LPdir_win32.c
LPdir_wince.c
README-sparse_array.md
alphacpuid.pl
arm64cpuid.pl Update copyright year 2022-12-01 12:47:05 +01:00
arm_arch.h Copyright year updates 2023-09-19 14:57:48 +02:00
armcap.c Backport crypto/armcap.c from master branch 2023-08-01 19:12:33 +02:00
armv4cpuid.pl Copyright year updates 2023-09-19 14:57:48 +02:00
asn1_dsa.c
bsearch.c
build.info Do not include sparse_array.o in libssl 2023-09-22 20:42:31 +02:00
c64xpluscpuid.pl
context.c Update copyright year 2023-05-30 14:11:01 +02:00
core_algorithm.c "Reserve" the method store when constructing methods 2022-07-20 07:29:23 +01:00
core_fetch.c "Reserve" the method store when constructing methods 2022-07-20 07:29:23 +01:00
core_namemap.c Copyright year updates 2023-08-01 14:35:30 +01:00
cpt_err.c err: add additional errors 2022-11-09 15:30:52 +01:00
cpuid.c Update copyright year 2022-12-01 12:47:05 +01:00
cryptlib.c Update copyright year 2022-12-01 12:47:05 +01:00
ctype.c tolower: refine the tolower code to avoid a memory access 2022-05-23 09:52:54 +10:00
cversion.c
der_writer.c Update copyright year 2022-07-05 10:33:12 +02:00
dllmain.c Update copyright year 2022-12-01 12:47:05 +01:00
ebcdic.c
ex_data.c Fix error handling in CRYPTO_get_ex_new_index 2023-09-21 14:46:01 +02:00
getenv.c Update copyright year 2022-12-01 12:47:05 +01:00
ia64cpuid.S
info.c Update copyright year 2023-03-14 12:49:46 +00:00
init.c Move e_os.h to include/internal 2022-11-11 10:03:45 +01:00
initthread.c Fix a mem leak when the FIPS provider is used in a different thread 2023-10-03 18:54:03 +11:00
loongarch64cpuid.pl Add LoongArch64 cpuid and OPENSSL_loongarchcap_P 2022-11-23 18:21:53 +01:00
loongarch_arch.h Resolve assembler complains when including loongarch_arch.h 2023-08-28 09:59:59 +02:00
loongarchcap.c Copyright year updates 2023-08-01 14:35:30 +01:00
mem.c Copyright year updates 2023-09-19 14:57:48 +02:00
mem_clr.c
mem_sec.c Update copyright year 2023-03-14 12:49:46 +00:00
mips_arch.h
o_dir.c Update copyright year 2022-12-01 12:47:05 +01:00
o_fopen.c Update copyright year 2022-12-01 12:47:05 +01:00
o_init.c Update copyright year 2022-12-01 12:47:05 +01:00
o_str.c Move e_os.h to include/internal 2022-11-11 10:03:45 +01:00
o_time.c
packet.c Update copyright year 2022-10-11 13:20:27 +01:00
param_build.c Update copyright year 2023-03-14 12:49:46 +00:00
param_build_set.c Update copyright year 2022-12-01 12:47:05 +01:00
params.c crypto/params: drop float for UEFI 2023-06-14 16:04:50 +02:00
params_dup.c param dup: add errors to failure returns 2022-11-09 15:31:22 +01:00
params_from_text.c Allow sign extension in OSSL_PARAM_allocate_from_text() 2021-11-24 19:21:41 +01:00
pariscid.pl
passphrase.c Update copyright year 2022-03-15 13:52:58 +00:00
ppccap.c Update copyright year 2022-12-01 12:47:05 +01:00
ppccpuid.pl Update copyright year 2022-12-01 12:47:05 +01:00
provider.c Correctly activate the provider in OSSL_PROVIDER_try_load 2021-11-15 14:22:41 +00:00
provider_child.c Update copyright year 2023-03-14 12:49:46 +00:00
provider_conf.c Update copyright year 2022-12-01 12:47:05 +01:00
provider_core.c fips: use seed source requested 2023-10-03 18:54:03 +11:00
provider_local.h
provider_predefined.c
punycode.c Update copyright year 2022-12-01 12:47:05 +01:00
riscv32cpuid.pl Add RISC-V 32 cpuid support 2022-11-23 18:21:43 +01:00
riscv64cpuid.pl Add basic RISC-V cpuid and OPENSSL_riscvcap 2022-11-21 10:49:52 +01:00
riscvcap.c Add basic RISC-V cpuid and OPENSSL_riscvcap 2022-11-21 10:49:52 +01:00
s390x_arch.h Update copyright year 2022-05-03 13:36:42 +01:00
s390xcap.c Copyright year updates 2023-08-01 14:35:30 +01:00
s390xcpuid.pl
self_test_core.c Update copyright year 2022-12-01 12:47:05 +01:00
sparccpuid.S
sparcv9cap.c
sparse_array.c Coverity 1507376: Dereference after null check 2022-07-22 14:42:44 +02:00
threads_lib.c Update copyright year 2022-12-21 11:17:29 +01:00
threads_none.c
threads_pthread.c Copyright year updates 2023-09-19 14:57:48 +02:00
threads_win.c Update copyright year 2023-05-30 14:11:01 +02:00
trace.c Update copyright year 2023-03-14 12:49:46 +00:00
uid.c Openssl fails to compile on Debian with kfreebsd kernels 2021-09-02 10:05:51 +10:00
vms_rms.h
x86_64cpuid.pl
x86cpuid.pl