Skip to content

Commit 6a00056

Browse files
author
schwarze
committed
Move the explanations related to *ptree closer together and correct
the lie that *ptree is set upon success - in some cases of success, it is set to NULL, whereas in some cases of failure, a non-trivial tree may be returned. beck@ pointed out that statements related to *ptree were scattered all over the place, and this patch works for him.
1 parent 66e6fb6 commit 6a00056

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

src/lib/libcrypto/man/X509_policy_check.3

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $OpenBSD: X509_policy_check.3,v 1.4 2021/07/29 12:39:47 schwarze Exp $
1+
.\" $OpenBSD: X509_policy_check.3,v 1.5 2021/07/30 15:01:40 schwarze Exp $
22
.\"
33
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
44
.\"
@@ -14,7 +14,7 @@
1414
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1515
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1616
.\"
17-
.Dd $Mdocdate: July 29 2021 $
17+
.Dd $Mdocdate: July 30 2021 $
1818
.Dt X509_POLICY_CHECK 3
1919
.Os
2020
.Sh NAME
@@ -44,9 +44,6 @@ The
4444
input argument contains the prospective certification path
4545
according to RFC 5280 paragraph 6.1.1(a), starting with the
4646
target certificate and ending with the trust anchor.
47-
If a policy tree is returned, the reference count of each of the
48-
.Fa certs
49-
is incremented by 1.
5047
.Pp
5148
The
5249
.Fa policy_oids
@@ -79,7 +76,14 @@ as defined by RFC 5280 paragraph 6.1.1(e).
7976
It disables policy mapping in the certification path.
8077
.El
8178
.Pp
82-
Upon success, a pointer to the
79+
Upon success and in some cases of failure, the storage location pointed to by
80+
.Fa pexplicit_policy
81+
is set to 1 if
82+
.Dv X509_V_FLAG_EXPLICIT_POLICY
83+
was requested.
84+
Otherwise, it is set to 0.
85+
.Pp
86+
In many cases of success and in a few cases of failure, a pointer to the
8387
.Vt valid_policy_tree
8488
output value mentioned in RFC 5280 section 6.1.6 is returned in
8589
.Pf * Fa ptree .
@@ -94,23 +98,22 @@ of
9498
and an empty
9599
.Fa qualifier_set .
96100
.Pp
97-
Upon success and in some cases of failure, the storage location pointed to by
98-
.Fa pexplicit_policy
99-
is set to 1 if
100-
.Dv X509_V_FLAG_EXPLICIT_POLICY
101-
was requested.
102-
Otherwise, it is set to 0.
103-
.Pp
101+
If a policy tree is returned, the reference count of each of the
102+
.Fa certs
103+
is incremented by 1.
104+
In that case, the caller is responsible for calling
104105
.Fn X509_policy_tree_free
105-
releases all memory used by the
106+
to release all memory used by the
106107
.Fa tree
107-
and decrements the reference counts
108+
and to decrement the reference counts
108109
of the certificates referenced from it by 1.
109110
If
110111
.Fa tree
111112
is a
112113
.Dv NULL
113-
pointer, no action occurs.
114+
pointer,
115+
.Fn X509_policy_tree_free
116+
has no effect.
114117
.Sh RETURN VALUES
115118
.Fn X509_policy_check
116119
returns these values:

0 commit comments

Comments
 (0)