openssl/crypto/x509
Matt Caswell e3d897d3fa Fix a regression in X509_VERIFY_PARAM_add0_policy()
Also fixes a similar regression in X509_VERIFY_PARAM_add0_table().

Commit 38ebfc3 introduced a regression in 3.0.6 that changed the return
value of the two functions above from 1 on success to the number of entries
in the stack. If there are more than one entry then this is a change in
behaviour which should not have been introduced into a stable release.

This reverts the behaviour back to what it was prior to the change. The code
is slightly different to the original code in that we also handle a possible
-1 return value from the stack push function. This should never happen in
reality because we never pass a NULL stack as a parameter - but for the sake
of robustness we handle it anyway.

Note that the changed behaviour exists in all versions of 3.1 (it never had
the original version). But 3.1 should be fully backwards compatible with 3.0
so we should change it there too.

Fixes #21570

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/21576)
2023-07-31 14:11:03 +01:00
..
build.info
by_dir.c get_cert_by_subject_ex(): Check result of X509_STORE_lock() 2023-07-25 17:02:20 +02:00
by_file.c x509/by_file.c: fix unreachable and redundant code 2023-07-27 10:26:11 -04:00
by_store.c Partially revert #18070 (Add support for Windows CA certificate store) 2023-06-15 18:01:59 +10:00
ext_dat.h
pcy_cache.c x509: sort stacks before finds 2023-05-01 17:14:42 +10:00
pcy_data.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
pcy_lib.c
pcy_local.h x509: excessive resource use verifying policy constraints 2023-03-22 11:24:45 +11:00
pcy_map.c x509: fix double locking problem 2022-12-08 11:10:58 +01:00
pcy_node.c x509: Fix possible use-after-free when OOM 2023-05-29 14:52:26 +02:00
pcy_tree.c x509: Handle ossl_policy_level_add_node errors 2023-05-29 14:52:27 +02:00
standard_exts.h
t_crl.c
t_req.c
t_x509.c
v3_addr.c x509: sort stacks before finds 2023-05-01 17:14:42 +10:00
v3_admis.c Fix incorrect error return value in i2r_ADMISSION_SYNTAX() 2023-01-19 14:15:19 +01:00
v3_admis.h
v3_akeya.c
v3_akid.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_asid.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_bcons.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_bitst.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_conf.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_cpols.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_crld.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_enum.c
v3_extku.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_genn.c Fix GENERAL_NAME_cmp for x400Address (master) 2023-02-07 17:05:10 +01:00
v3_ia5.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_info.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_int.c
v3_ist.c x509: add ASN1_STRING_set() check result 2023-07-25 12:08:14 +10:00
v3_lib.c x509: sort stacks before finds 2023-05-01 17:14:42 +10:00
v3_ncons.c Fix type confusion in nc_match_single() 2023-02-07 17:05:10 +01:00
v3_pci.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_pcia.c
v3_pcons.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_pku.c
v3_pmaps.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_prn.c
v3_purp.c Fix incorrect ERR_raise() calls 2023-06-12 08:26:20 +02:00
v3_san.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_skid.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_sxnet.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_tlsf.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_utf8.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3_utl.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
v3err.c
x509_att.c fix: reject adding a duplicity into STACK_OF(X509_ATTRIBUTE) 2023-07-24 12:44:46 +10:00
x509_cmp.c X509_NAME_cmp fix for empty name 2023-06-12 15:25:43 +02:00
x509_d2.c
x509_def.c Partially revert #18070 (Add support for Windows CA certificate store) 2023-06-15 18:01:59 +10:00
x509_err.c Fix typos found by codespell 2023-06-15 10:11:46 +10:00
x509_ext.c
x509_local.h
x509_lu.c x509: update to structure based atomics 2023-07-01 21:18:25 +10:00
x509_meth.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
x509_obj.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
x509_r2x.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
x509_req.c Fix regression in i2d_re_X509_REQ_tbs() 2022-10-05 16:12:38 +02:00
x509_set.c x509: update to structure based atomics 2023-07-01 21:18:25 +10:00
x509_trust.c x509: sort stacks before finds 2023-05-01 17:14:42 +10:00
x509_txt.c RFC7250 (RPK) support 2023-03-28 13:49:54 -04:00
x509_v3.c Refine the documents of several APIs 2022-12-16 18:59:28 +01:00
x509_vfy.c Fix checking return code of EVP_PKEY_get_int_param at check_curve 2023-04-21 10:17:52 +02:00
x509_vpm.c Fix a regression in X509_VERIFY_PARAM_add0_policy() 2023-07-31 14:11:03 +01:00
x509cset.c x509: update to structure based atomics 2023-07-01 21:18:25 +10:00
x509name.c Refine the documents of several APIs 2022-12-16 18:59:28 +01:00
x509rset.c
x509spki.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
x509type.c
x_all.c allow to disable http 2023-06-06 11:05:02 +10:00
x_attrib.c
x_crl.c crypto/*: Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:01 +11:00
x_exten.c
x_name.c x509: fix -Wunused-but-set-variable 2022-10-21 15:56:32 +02:00
x_pubkey.c configure: introduce no-ecx to remove ECX related feature 2023-06-14 13:06:22 +10:00
x_req.c crypto/*: Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:01 +11:00
x_x509.c crypto/*: Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:01 +11:00
x_x509a.c