summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/man/Makefile5
-rw-r--r--src/lib/libcrypto/man/X509_STORE_CTX_get_error.340
-rw-r--r--src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.36
-rw-r--r--src/lib/libcrypto/man/X509_check_purpose.35
-rw-r--r--src/lib/libcrypto/man/X509_check_trust.35
-rw-r--r--src/lib/libcrypto/man/X509_new.36
-rw-r--r--src/lib/libcrypto/man/X509_policy_check.3192
-rw-r--r--src/lib/libcrypto/man/X509_policy_tree_get0_policies.3101
-rw-r--r--src/lib/libcrypto/man/X509_policy_tree_level_count.3178
9 files changed, 11 insertions, 527 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 3616c157d3..fc3204e3a2 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.248 2023/04/27 09:43:55 tb Exp $ 1# $OpenBSD: Makefile,v 1.249 2023/04/30 14:49:47 tb Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -377,9 +377,6 @@ MAN= \
377 X509_load_cert_file.3 \ 377 X509_load_cert_file.3 \
378 X509_new.3 \ 378 X509_new.3 \
379 X509_ocspid_print.3 \ 379 X509_ocspid_print.3 \
380 X509_policy_check.3 \
381 X509_policy_tree_get0_policies.3 \
382 X509_policy_tree_level_count.3 \
383 X509_print_ex.3 \ 380 X509_print_ex.3 \
384 X509_sign.3 \ 381 X509_sign.3 \
385 X509_signature_dump.3 \ 382 X509_signature_dump.3 \
diff --git a/src/lib/libcrypto/man/X509_STORE_CTX_get_error.3 b/src/lib/libcrypto/man/X509_STORE_CTX_get_error.3
index 30e4024736..b3d0ee3069 100644
--- a/src/lib/libcrypto/man/X509_STORE_CTX_get_error.3
+++ b/src/lib/libcrypto/man/X509_STORE_CTX_get_error.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_STORE_CTX_get_error.3,v 1.26 2023/04/21 06:45:56 tb Exp $ 1.\" $OpenBSD: X509_STORE_CTX_get_error.3,v 1.27 2023/04/30 14:49:47 tb Exp $
2.\" full merge up to: 2.\" full merge up to:
3.\" OpenSSL man3/X509_STORE_CTX_get_error 24a535ea Sep 22 13:14:20 2020 +0100 3.\" OpenSSL man3/X509_STORE_CTX_get_error 24a535ea Sep 22 13:14:20 2020 +0100
4.\" OpenSSL man3/X509_STORE_CTX_new 24a535ea Sep 22 13:14:20 2020 +0100 4.\" OpenSSL man3/X509_STORE_CTX_new 24a535ea Sep 22 13:14:20 2020 +0100
@@ -68,7 +68,7 @@
68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
69.\" OF THE POSSIBILITY OF SUCH DAMAGE. 69.\" OF THE POSSIBILITY OF SUCH DAMAGE.
70.\" 70.\"
71.Dd $Mdocdate: April 21 2023 $ 71.Dd $Mdocdate: April 30 2023 $
72.Dt X509_STORE_CTX_GET_ERROR 3 72.Dt X509_STORE_CTX_GET_ERROR 3
73.Os 73.Os
74.Sh NAME 74.Sh NAME
@@ -86,8 +86,6 @@
86.Nm X509_STORE_CTX_get_chain , 86.Nm X509_STORE_CTX_get_chain ,
87.Nm X509_STORE_CTX_get1_chain , 87.Nm X509_STORE_CTX_get1_chain ,
88.Nm X509_STORE_CTX_set0_verified_chain , 88.Nm X509_STORE_CTX_set0_verified_chain ,
89.Nm X509_STORE_CTX_get0_policy_tree ,
90.Nm X509_STORE_CTX_get_explicit_policy ,
91.Nm X509_verify_cert_error_string 89.Nm X509_verify_cert_error_string
92.Nd get or set certificate verification status information 90.Nd get or set certificate verification status information
93.Sh SYNOPSIS 91.Sh SYNOPSIS
@@ -152,14 +150,6 @@
152.Fa "X509_STORE_CTX *ctx" 150.Fa "X509_STORE_CTX *ctx"
153.Fa "STACK_OF(X509) *chain" 151.Fa "STACK_OF(X509) *chain"
154.Fc 152.Fc
155.Ft X509_POLICY_TREE *
156.Fo X509_STORE_CTX_get0_policy_tree
157.Fa "X509_STORE_CTX *ctx"
158.Fc
159.Ft int
160.Fo X509_STORE_CTX_get_explicit_policy
161.Fa "X509_STORE_CTX *ctx"
162.Fc
163.In openssl/x509.h 153.In openssl/x509.h
164.Ft const char * 154.Ft const char *
165.Fo X509_verify_cert_error_string 155.Fo X509_verify_cert_error_string
@@ -337,24 +327,6 @@ return a pointer to a stack of certificates or
337.Dv NULL 327.Dv NULL
338if an error occurs. 328if an error occurs.
339.Pp 329.Pp
340.Fn X509_STORE_CTX_get0_policy_tree
341returns an internal pointer to the
342.Fa valid_policy_tree
343created by
344.Xr X509_policy_check 3
345or
346.Dv NULL
347if validation failed or the resulting tree was empty.
348.Pp
349.Fn X509_STORE_CTX_get_explicit_policy
350returns the
351.Pf * Fa pexplicit_policy
352output argument of
353.Xr X509_policy_check 3 .
354If validation succeeded, it is 1 if
355.Dv X509_V_FLAG_EXPLICIT_POLICY
356was requested or 0 otherwise.
357.Pp
358.Fn X509_verify_cert_error_string 330.Fn X509_verify_cert_error_string
359returns a human readable error string for verification error 331returns a human readable error string for verification error
360.Fa n . 332.Fa n .
@@ -576,8 +548,6 @@ This will never be returned unless explicitly set by an application.
576.\" No CA signature digest algorithm too weak 548.\" No CA signature digest algorithm too weak
577.El 549.El
578.Sh SEE ALSO 550.Sh SEE ALSO
579.Xr X509_policy_check 3 ,
580.Xr X509_policy_tree_level_count 3 ,
581.Xr X509_STORE_CTX_new 3 , 551.Xr X509_STORE_CTX_new 3 ,
582.Xr X509_STORE_CTX_set_verify 3 , 552.Xr X509_STORE_CTX_set_verify 3 ,
583.Xr X509_STORE_CTX_set_verify_cb 3 , 553.Xr X509_STORE_CTX_set_verify_cb 3 ,
@@ -599,12 +569,6 @@ first appeared in SSLeay 0.8.0 and have been available since
599first appeared in OpenSSL 0.9.5 and has been available since 569first appeared in OpenSSL 0.9.5 and has been available since
600.Ox 2.7 . 570.Ox 2.7 .
601.Pp 571.Pp
602.Fn X509_STORE_CTX_get0_policy_tree
603and
604.Fn X509_STORE_CTX_get_explicit_policy
605first appeared in OpenSSL 0.9.8 and have been available since
606.Ox 4.5 .
607.Pp
608.Fn X509_STORE_CTX_get0_current_issuer , 572.Fn X509_STORE_CTX_get0_current_issuer ,
609.Fn X509_STORE_CTX_get0_current_crl , 573.Fn X509_STORE_CTX_get0_current_crl ,
610and 574and
diff --git a/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 b/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
index 08961eb4d3..65e20f1ad8 100644
--- a/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
+++ b/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.27 2022/12/01 05:33:55 tb Exp $ 1.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.28 2023/04/30 14:49:47 tb Exp $
2.\" full merge up to: OpenSSL d33def66 Feb 9 14:17:13 2016 -0500 2.\" full merge up to: OpenSSL d33def66 Feb 9 14:17:13 2016 -0500
3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
4.\" 4.\"
@@ -68,7 +68,7 @@
68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
69.\" OF THE POSSIBILITY OF SUCH DAMAGE. 69.\" OF THE POSSIBILITY OF SUCH DAMAGE.
70.\" 70.\"
71.Dd $Mdocdate: December 1 2022 $ 71.Dd $Mdocdate: April 30 2023 $
72.Dt X509_VERIFY_PARAM_SET_FLAGS 3 72.Dt X509_VERIFY_PARAM_SET_FLAGS 3
73.Os 73.Os
74.Sh NAME 74.Sh NAME
@@ -566,8 +566,6 @@ If
566.Dv X509_V_FLAG_NOTIFY_POLICY 566.Dv X509_V_FLAG_NOTIFY_POLICY
567is set and policy checking is successful, a special status code is 567is set and policy checking is successful, a special status code is
568sent to the verification callback. 568sent to the verification callback.
569This permits it to examine the valid policy tree and perform additional
570checks or simply log it for debugging purposes.
571.Pp 569.Pp
572By default some additional features such as indirect CRLs and CRLs 570By default some additional features such as indirect CRLs and CRLs
573signed by different keys are disabled. 571signed by different keys are disabled.
diff --git a/src/lib/libcrypto/man/X509_check_purpose.3 b/src/lib/libcrypto/man/X509_check_purpose.3
index 611697fa30..6356081137 100644
--- a/src/lib/libcrypto/man/X509_check_purpose.3
+++ b/src/lib/libcrypto/man/X509_check_purpose.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_check_purpose.3,v 1.9 2022/12/17 12:48:53 tb Exp $ 1.\" $OpenBSD: X509_check_purpose.3,v 1.10 2023/04/30 14:49:47 tb Exp $
2.\" 2.\"
3.\" Copyright (c) 2019, 2021 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2019, 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: December 17 2022 $ 17.Dd $Mdocdate: April 30 2023 $
18.Dt X509_CHECK_PURPOSE 3 18.Dt X509_CHECK_PURPOSE 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -412,7 +412,6 @@ can be used as a CA for the
412.Xr EXTENDED_KEY_USAGE_new 3 , 412.Xr EXTENDED_KEY_USAGE_new 3 ,
413.Xr X509_check_trust 3 , 413.Xr X509_check_trust 3 ,
414.Xr X509_new 3 , 414.Xr X509_new 3 ,
415.Xr X509_policy_check 3 ,
416.Xr X509_PURPOSE_set 3 , 415.Xr X509_PURPOSE_set 3 ,
417.Xr X509V3_get_d2i 3 , 416.Xr X509V3_get_d2i 3 ,
418.Xr x509v3.cnf 5 417.Xr x509v3.cnf 5
diff --git a/src/lib/libcrypto/man/X509_check_trust.3 b/src/lib/libcrypto/man/X509_check_trust.3
index be4489e946..0f02a1b1ef 100644
--- a/src/lib/libcrypto/man/X509_check_trust.3
+++ b/src/lib/libcrypto/man/X509_check_trust.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_check_trust.3,v 1.7 2022/12/26 07:18:52 jmc Exp $ 1.\" $OpenBSD: X509_check_trust.3,v 1.8 2023/04/30 14:49:47 tb Exp $
2.\" 2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: December 26 2022 $ 17.Dd $Mdocdate: April 30 2023 $
18.Dt X509_CHECK_TRUST 3 18.Dt X509_CHECK_TRUST 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -238,7 +238,6 @@ was never called before.
238.Xr X509_CERT_AUX_new 3 , 238.Xr X509_CERT_AUX_new 3 ,
239.Xr X509_check_purpose 3 , 239.Xr X509_check_purpose 3 ,
240.Xr X509_new 3 , 240.Xr X509_new 3 ,
241.Xr X509_policy_check 3 ,
242.Xr X509_TRUST_set 3 , 241.Xr X509_TRUST_set 3 ,
243.Xr X509_VERIFY_PARAM_set_trust 3 242.Xr X509_VERIFY_PARAM_set_trust 3
244.Sh HISTORY 243.Sh HISTORY
diff --git a/src/lib/libcrypto/man/X509_new.3 b/src/lib/libcrypto/man/X509_new.3
index 4b85f67eb0..c38dfc00b1 100644
--- a/src/lib/libcrypto/man/X509_new.3
+++ b/src/lib/libcrypto/man/X509_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_new.3,v 1.36 2021/11/18 10:09:24 schwarze Exp $ 1.\" $OpenBSD: X509_new.3,v 1.37 2023/04/30 14:49:47 tb Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
@@ -66,7 +66,7 @@
66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
67.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
68.\" 68.\"
69.Dd $Mdocdate: November 18 2021 $ 69.Dd $Mdocdate: April 30 2023 $
70.Dt X509_NEW 3 70.Dt X509_NEW 3
71.Os 71.Os
72.Sh NAME 72.Sh NAME
@@ -229,8 +229,6 @@ if an error occurs.
229.Xr X509_NAME_new 3 , 229.Xr X509_NAME_new 3 ,
230.Xr X509_OBJECT_new 3 , 230.Xr X509_OBJECT_new 3 ,
231.Xr X509_PKEY_new 3 , 231.Xr X509_PKEY_new 3 ,
232.Xr X509_policy_check 3 ,
233.Xr X509_policy_tree_level_count 3 ,
234.Xr X509_print_ex 3 , 232.Xr X509_print_ex 3 ,
235.Xr X509_PUBKEY_new 3 , 233.Xr X509_PUBKEY_new 3 ,
236.Xr X509_PURPOSE_set 3 , 234.Xr X509_PURPOSE_set 3 ,
diff --git a/src/lib/libcrypto/man/X509_policy_check.3 b/src/lib/libcrypto/man/X509_policy_check.3
deleted file mode 100644
index 5ea774a3ef..0000000000
--- a/src/lib/libcrypto/man/X509_policy_check.3
+++ /dev/null
@@ -1,192 +0,0 @@
1.\" $OpenBSD: X509_policy_check.3,v 1.6 2021/11/11 12:06:25 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 11 2021 $
18.Dt X509_POLICY_CHECK 3
19.Os
20.Sh NAME
21.Nm X509_policy_check ,
22.Nm X509_policy_tree_free
23.Nd construct X.509 valid policy tree
24.Sh SYNOPSIS
25.In openssl/x509_vfy.h
26.Ft int
27.Fo X509_policy_check
28.Fa "X509_POLICY_TREE **ptree"
29.Fa "int *pexplicit_policy"
30.Fa "STACK_OF(X509) *certs"
31.Fa "STACK_OF(ASN1_OBJECT) *policy_oids"
32.Fa "unsigned int flags"
33.Fc
34.Ft void
35.Fn X509_policy_tree_free "X509_POLICY_TREE *tree"
36.Sh DESCRIPTION
37.Fn X509_policy_check
38performs those parts of Basic Certification Path Validation
39described in RFC 5280 section 6.1 that are related to the
40construction of the valid policy tree.
41.Pp
42The
43.Fa certs
44input argument contains the prospective certification path
45according to RFC 5280 paragraph 6.1.1(a), starting with the
46target certificate and ending with the trust anchor.
47.Pp
48The
49.Fa policy_oids
50input argument contains the
51.Va user-initial-policy-set
52according to RFC 5280 section 6.1.1(c).
53It specifies a set of certificate policies acceptable to the certificate user.
54.Pp
55The
56.Fa flags
57argument can contain zero or more of the following constants, OR'ed together:
58.Bl -tag -width Ds
59.It Dv X509_V_FLAG_EXPLICIT_POLICY
60Set
61.Va initial-explicit-policy
62as defined by RFC 5280 paragraph 6.1.1(f).
63It requires the path to be valid for at least one of the
64.Fa policy_oids .
65.It Dv X509_V_FLAG_INHIBIT_ANY
66Set
67.Va initial-any-policy-inhibit
68as defined by RFC 5280 paragraph 6.1.1(g).
69It causes the
70.Sy anyPolicy
71OID to be skipped if it is encountered in a certificate.
72.It Dv X509_V_FLAG_INHIBIT_MAP
73Set
74.Va initial-policy-mapping-inhibit
75as defined by RFC 5280 paragraph 6.1.1(e).
76It disables policy mapping in the certification path.
77.El
78.Pp
79Upon success and in some cases of failure, the storage location pointed to by
80.Fa pexplicit_policy
81is set to 1 if
82.Dv X509_V_FLAG_EXPLICIT_POLICY
83was requested.
84Otherwise, it is set to 0.
85.Pp
86In many cases of success and in a few cases of failure, a pointer to the
87.Vt valid_policy_tree
88output value mentioned in RFC 5280 section 6.1.6 is returned in
89.Pf * Fa ptree .
90It contains one level for each of the
91.Fa certs ,
92in reverse order: level 0 corresponds to the trust anchor,
93the last level corresponds to the target certificate.
94Level 0 is initialized to contain a single node with a
95.Fa valid_policy
96of
97.Sy anyPolicy
98and an empty
99.Fa qualifier_set .
100.Pp
101If a policy tree is returned, the reference count of each of the
102.Fa certs
103is incremented by 1.
104In that case, the caller is responsible for calling
105.Fn X509_policy_tree_free
106to release all memory used by the
107.Fa tree
108and to decrement the reference counts
109of the certificates referenced from it by 1.
110If
111.Fa tree
112is a
113.Dv NULL
114pointer,
115.Fn X509_policy_tree_free
116has no effect.
117.Sh RETURN VALUES
118.Fn X509_policy_check
119returns these values:
120.Bl -tag -width 2n
121.It \-2
122Validation failed because
123.Dv X509_V_FLAG_EXPLICIT_POLICY
124was requested but the resulting policy tree
125or the resulting user policy set would have been empty.
126In this case,
127.Pf * Fa pexplicit_policy
128is set to 1.
129If the resulting tree is empty,
130.Pf * Fa ptree
131is set to
132.Dv NULL ;
133otherwise, it is set to the resulting tree.
134.It \-1
135At least one of the
136.Fa certs
137contains invalid or inconsistent extensions.
138.Pf * Fa ptree
139is set to
140.Dv NULL
141and
142.Pf * Fa pexplicit_policy
143to 0.
144.It 0
145Internal error.
146For example, setting up the policy caches failed, or memory allocation
147failed while constructing the tree.
148.Pf * Fa ptree
149is set to
150.Dv NULL
151and
152.Pf * Fa pexplicit_policy
153may or may not be set.
154.It 1
155Validation succeeded and
156.Pf * Fa ptree
157and
158.Pf * Fa pexplicit_policy
159have been set.
160In the special cases that the
161.Fa certs
162argument contains exactly one certificate or that
163.Dv X509_V_FLAG_EXPLICIT_POLICY
164was not requested and at least one of the certificates contains no
165certificate policies or the resulting policy tree would have been empty,
166.Pf * Fa ptree
167is set to
168.Dv NULL
169and
170.Pf * Fa pexplicit_policy
171to 0.
172.El
173.Sh SEE ALSO
174.Xr ASN1_OBJECT_new 3 ,
175.Xr OBJ_nid2obj 3 ,
176.Xr STACK_OF 3 ,
177.Xr X509_check_purpose 3 ,
178.Xr X509_check_trust 3 ,
179.Xr X509_new 3 ,
180.Xr X509_policy_tree_get0_policies 3 ,
181.Xr X509_policy_tree_level_count 3 ,
182.Xr X509_verify_cert 3
183.Sh STANDARDS
184RFC 5280: Internet X.509 Public Key Infrastructure Certificate
185and Certificate Revocation List (CRL) Profile,
186section 6.1: Basic Path Validation
187.Sh HISTORY
188.Fn X509_policy_check
189and
190.Fn X509_policy_tree_free
191first appeared in OpenSSL 0.9.8 and have been available since
192.Ox 4.5 .
diff --git a/src/lib/libcrypto/man/X509_policy_tree_get0_policies.3 b/src/lib/libcrypto/man/X509_policy_tree_get0_policies.3
deleted file mode 100644
index cb0715d6cb..0000000000
--- a/src/lib/libcrypto/man/X509_policy_tree_get0_policies.3
+++ /dev/null
@@ -1,101 +0,0 @@
1.\" $OpenBSD: X509_policy_tree_get0_policies.3,v 1.1 2021/11/11 12:06:25 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 11 2021 $
18.Dt X509_POLICY_TREE_GET0_POLICIES 3
19.Os
20.Sh NAME
21.Nm X509_policy_tree_get0_policies ,
22.Nm X509_policy_tree_get0_user_policies
23.Nd retrieve arrays of policy tree nodes
24.Sh SYNOPSIS
25.In openssl/x509_vfy.h
26.Ft STACK_OF(X509_POLICY_NODE) *
27.Fn X509_policy_tree_get0_policies "const X509_POLICY_TREE *tree"
28.Ft STACK_OF(X509_POLICY_NODE) *
29.Fn X509_policy_tree_get0_user_policies "const X509_POLICY_TREE *tree"
30.Sh DESCRIPTION
31The
32.Em authority set
33and the
34.Em user set
35are arrays of nodes from a policy
36.Fa tree .
37.Pp
38If the last level of a
39.Fa tree ,
40or equivalently, all levels of it, contain an
41.Sy anyPolicy
42node, the authority set contains
43only this anyPolicy node from the last level.
44Unless the array of
45.Fa policy_oids
46passed to
47.Xr X509_policy_check 3
48contained an anyPolicy object,
49the user set contains one node for each of the
50.Fa policy_oids ;
51specifically, the first matching node that is a child of an anyPolicy node.
52.Pp
53If the last level of the
54.Fa tree
55does not contain an
56.Sy anyPolicy
57node, the authority set contains
58all non-anyPolicy nodes that are children of anyPolicy nodes.
59For each element of the
60.Fa policy_oids ,
61the user set contains the first node from the authority set
62matching it, if any.
63.Pp
64These functions are intended to be called after
65.Xr X509_policy_check 3
66was called either directly or indirectly through
67.Xr X509_verify_cert 3 .
68.Sh RETURN VALUES
69.Fn X509_policy_tree_get0_policies
70returns an internal pointer to the authority set
71or
72.Dv NULL
73if the
74.Fa tree
75argument is
76.Dv NULL .
77.Pp
78.Fn X509_policy_tree_get0_user_policies
79returns an internal pointer to the user set or
80.Dv NULL
81if the
82.Fa tree
83argument is
84.Dv NULL
85or if the array of
86.Fa policy_oids
87passed to
88.Xr X509_policy_check 3
89was empty or contained an anyPolicy object.
90.Sh SEE ALSO
91.Xr STACK_OF 3 ,
92.Xr X509_policy_check 3 ,
93.Xr X509_policy_level_get0_node 3 ,
94.Xr X509_STORE_CTX_get0_policy_tree 3
95.Sh STANDARDS
96RFC 5280: Internet X.509 Public Key Infrastructure Certificate
97and Certificate Revocation List (CRL) Profile,
98section 6.1: Basic Path Validation
99.Sh HISTORY
100These function first appeared in OpenSSL 0.9.8 and have been available since
101.Ox 4.5 .
diff --git a/src/lib/libcrypto/man/X509_policy_tree_level_count.3 b/src/lib/libcrypto/man/X509_policy_tree_level_count.3
deleted file mode 100644
index ff2036c40f..0000000000
--- a/src/lib/libcrypto/man/X509_policy_tree_level_count.3
+++ /dev/null
@@ -1,178 +0,0 @@
1.\" $OpenBSD: X509_policy_tree_level_count.3,v 1.5 2022/09/10 08:50:53 jsg Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: September 10 2022 $
18.Dt X509_POLICY_TREE_LEVEL_COUNT 3
19.Os
20.Sh NAME
21.Nm X509_policy_tree_level_count ,
22.Nm X509_policy_tree_get0_level ,
23.Nm X509_policy_level_node_count ,
24.Nm X509_policy_level_get0_node ,
25.Nm X509_policy_node_get0_policy ,
26.Nm X509_policy_node_get0_qualifiers ,
27.Nm X509_policy_node_get0_parent
28.Nd inspect X.509 policy tree objects
29.Sh SYNOPSIS
30.In openssl/x509_vfy.h
31.Ft int
32.Fn X509_policy_tree_level_count "const X509_POLICY_TREE *tree"
33.Ft X509_POLICY_LEVEL *
34.Fn X509_policy_tree_get0_level "const X509_POLICY_TREE *tree" "int index"
35.Ft int
36.Fn X509_policy_level_node_count "X509_POLICY_LEVEL *level"
37.Ft X509_POLICY_NODE *
38.Fn X509_policy_level_get0_node "X509_POLICY_LEVEL *level" "int index"
39.Ft const ASN1_OBJECT *
40.Fn X509_policy_node_get0_policy "const X509_POLICY_NODE *node"
41.Ft STACK_OF(POLICYQUALINFO) *
42.Fn X509_policy_node_get0_qualifiers "const X509_POLICY_NODE *node"
43.Ft const X509_POLICY_NODE *
44.Fn X509_policy_node_get0_parent "const X509_POLICY_NODE *node"
45.Sh DESCRIPTION
46The
47.Vt X509_POLICY_TREE
48object represents a
49.Vt valid_policy_tree
50as described in RFC 5280 section 6.1.
51.Pp
52The
53.Vt X509_POLICY_LEVEL
54object represents one level of such a tree,
55corresponding to one certificate.
56.Pp
57The
58.Vt X509_POLICY_NODE
59object represents one node in the tree.
60.Sh RETURN VALUES
61.Fn X509_policy_tree_level_count
62returns the number of levels in the
63.Fa tree
64or 0 if the
65.Fa tree
66argument is
67.Dv NULL .
68If it is not 0, it equals the number of certificates in the
69certification path the tree was created from, including both
70the target certificate and the trust anchor.
71.Pp
72.Fn X509_policy_tree_get0_level
73returns an internal pointer to the level of the
74.Fa tree
75with the given
76.Fa index
77or
78.Dv NULL
79if the
80.Fa tree
81argument is
82.Dv NULL
83or the
84.Fa index
85is less than 0 or greater than or equal to the number of levels in the
86.Fa tree .
87An
88.Fa index
89of 0 corresponds to the trust anchor
90and the last level corresponds to the target certificate.
91.Pp
92.Fn X509_policy_level_node_count
93returns the number of nodes on the
94.Fa level ,
95including an
96.Sy anyPolicy
97node if it is present, or 0 if the
98.Fa level
99argument is
100.Dv NULL .
101.Pp
102.Fn X509_policy_level_get0_node
103returns an internal pointer to the node on the
104.Fa level
105with the given
106.Fa index
107or
108.Dv NULL
109if the
110.Fa level
111argument is
112.Dv NULL
113or the
114.Fa index
115is less than 0 or greater than or equal to the number of nodes on the level.
116If an
117.Sy anyPolicy
118node is present on the level, it can be retrieved by passing an
119.Fa index
120of 0.
121.Pp
122.Fn X509_policy_node_get0_policy
123returns an internal pointer to the
124.Fa valid_policy
125child object of the node or
126.Dv NULL
127if the
128.Fa node
129argument is
130.Dv NULL .
131It represents a single policy that is valid for the path
132from the trust anchor to the certificate corresponding
133to the level containing the
134.Fa node .
135.Pp
136.Fn X509_policy_node_get0_qualifiers
137returns an internal pointer to the
138.Fa qualifier_set
139child object of the node or
140.Dv NULL
141if the
142.Fa node
143argument is
144.Dv NULL .
145It contains the policy qualifiers associated with the
146.Fa valid_policy
147of the
148.Fa node
149in the certificate corresponding to the level containing the
150.Fa node .
151.Pp
152.Fn X509_policy_node_get0_parent
153returns
154.Dv NULL
155if the
156.Fa node
157argument is
158.Dv NULL
159or located on level 0.
160Otherwise, it returns an internal pointer to the parent node of the
161.Fa node
162argument.
163The parent node is always located on the previous level.
164.Sh SEE ALSO
165.Xr ASN1_OBJECT_new 3 ,
166.Xr OBJ_obj2txt 3 ,
167.Xr POLICYQUALINFO_new 3 ,
168.Xr STACK_OF 3 ,
169.Xr X509_new 3 ,
170.Xr X509_policy_check 3 ,
171.Xr X509_policy_tree_get0_policies 3
172.Sh STANDARDS
173RFC 5280: Internet X.509 Public Key Infrastructure Certificate
174and Certificate Revocation List (CRL) Profile,
175section 6.1: Basic Path Validation
176.Sh HISTORY
177These function first appeared in OpenSSL 0.9.8 and have been available since
178.Ox 4.5 .