summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/man/X509_STORE_get_by_subject.377
1 files changed, 51 insertions, 26 deletions
diff --git a/src/lib/libcrypto/man/X509_STORE_get_by_subject.3 b/src/lib/libcrypto/man/X509_STORE_get_by_subject.3
index 6c8b8f8b5e..3fb6c1c251 100644
--- a/src/lib/libcrypto/man/X509_STORE_get_by_subject.3
+++ b/src/lib/libcrypto/man/X509_STORE_get_by_subject.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: X509_STORE_get_by_subject.3,v 1.3 2021/11/12 14:05:28 schwarze Exp $ 1.\" $OpenBSD: X509_STORE_get_by_subject.3,v 1.4 2023/08/10 14:15:16 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2021, 2023 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
5.\" Permission to use, copy, modify, and distribute this software for any 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 6.\" purpose with or without fee is hereby granted, provided that the above
@@ -14,16 +14,18 @@
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: November 12 2021 $ 17.Dd $Mdocdate: August 10 2023 $
18.Dt X509_STORE_GET_BY_SUBJECT 3 18.Dt X509_STORE_GET_BY_SUBJECT 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
21.Nm X509_STORE_CTX_get_by_subject , 21.Nm X509_STORE_CTX_get_by_subject ,
22.Nm X509_STORE_CTX_get_obj_by_subject , 22.Nm X509_STORE_CTX_get_obj_by_subject ,
23.Nm X509_STORE_CTX_get1_certs ,
24.Nm X509_STORE_CTX_get1_crls ,
25.Nm X509_STORE_CTX_get1_issuer ,
23.Nm X509_STORE_get_by_subject , 26.Nm X509_STORE_get_by_subject ,
24.Nm X509_STORE_get1_certs , 27.Nm X509_STORE_get1_certs ,
25.Nm X509_STORE_get1_crls , 28.Nm X509_STORE_get1_crls
26.Nm X509_STORE_CTX_get1_issuer
27.Nd retrieve objects from a certificate store 29.Nd retrieve objects from a certificate store
28.Sh SYNOPSIS 30.Sh SYNOPSIS
29.In openssl/x509_vfy.h 31.In openssl/x509_vfy.h
@@ -40,6 +42,22 @@
40.Fa "X509_LOOKUP_TYPE type" 42.Fa "X509_LOOKUP_TYPE type"
41.Fa "X509_NAME *name" 43.Fa "X509_NAME *name"
42.Fc 44.Fc
45.Ft STACK_OF(X509) *
46.Fo X509_STORE_CTX_get1_certs
47.Fa "X509_STORE_CTX *ctx"
48.Fa "X509_NAME *name"
49.Fc
50.Ft STACK_OF(X509_CRL) *
51.Fo X509_STORE_CTX_get1_crls
52.Fa "X509_STORE_CTX *ctx"
53.Fa "X509_NAME *name"
54.Fc
55.Ft int
56.Fo X509_STORE_CTX_get1_issuer
57.Fa "X509 **issuer"
58.Fa "X509_STORE_CTX *ctx"
59.Fa "X509 *certificate"
60.Fc
43.Ft int 61.Ft int
44.Fo X509_STORE_get_by_subject 62.Fo X509_STORE_get_by_subject
45.Fa "X509_STORE_CTX *ctx" 63.Fa "X509_STORE_CTX *ctx"
@@ -57,12 +75,6 @@
57.Fa "X509_STORE_CTX *ctx" 75.Fa "X509_STORE_CTX *ctx"
58.Fa "X509_NAME *name" 76.Fa "X509_NAME *name"
59.Fc 77.Fc
60.Ft int
61.Fo X509_STORE_CTX_get1_issuer
62.Fa "X509 **issuer"
63.Fa "X509_STORE_CTX *ctx"
64.Fa "X509 *certificate"
65.Fc
66.Sh DESCRIPTION 78.Sh DESCRIPTION
67.Fn X509_STORE_CTX_get_by_subject 79.Fn X509_STORE_CTX_get_by_subject
68retrieves the first object having a matching 80retrieves the first object having a matching
@@ -101,11 +113,7 @@ is empty is the responsibility of the caller.
101.Fn X509_STORE_CTX_get_obj_by_subject 113.Fn X509_STORE_CTX_get_obj_by_subject
102is similar except that a new object is allocated and returned. 114is similar except that a new object is allocated and returned.
103.Pp 115.Pp
104.Fn X509_STORE_get_by_subject 116.Fn X509_STORE_CTX_get1_certs
105is a deprecated alias for
106.Fn X509_STORE_CTX_get_by_subject .
107.Pp
108.Fn X509_STORE_get1_certs
109retrieves all certificates matching the subject 117retrieves all certificates matching the subject
110.Vt name 118.Vt name
111from the 119from the
@@ -113,15 +121,15 @@ from the
113associated with 121associated with
114.Fa ctx . 122.Fa ctx .
115If there are none yet, 123If there are none yet,
116.Fn X509_STORE_get_by_subject 124.Fn X509_STORE_CTX_get_by_subject
117is called to try and add some. 125is called to try and add some.
118In case of success, the reference counts of all certificates 126In case of success, the reference counts of all certificates
119added to the returned array are incremented by 1. 127added to the returned array are incremented by 1.
120.Pp 128.Pp
121.Fn X509_STORE_get1_crls 129.Fn X509_STORE_CTX_get1_crls
122is similar except that it operates on certificate revocation lists 130is similar except that it operates on certificate revocation lists
123rather than on certificates and that it always calls 131rather than on certificates and that it always calls
124.Fn X509_STORE_get_by_subject , 132.Fn X509_STORE_CTX_get_by_subject ,
125even if the 133even if the
126.Vt X509_STORE 134.Vt X509_STORE
127already contains a matching revocation list. 135already contains a matching revocation list.
@@ -138,7 +146,7 @@ associated with
138Internally, the issuer name is retrieved with 146Internally, the issuer name is retrieved with
139.Xr X509_get_issuer_name 3 147.Xr X509_get_issuer_name 3
140and the candidate issuer CA certificate with 148and the candidate issuer CA certificate with
141.Fn X509_STORE_get_by_subject 149.Fn X509_STORE_X509_get_by_subject
142using that issuer name. 150using that issuer name.
143.Xr X509_check_issued 3 151.Xr X509_check_issued 3
144or a user-supplied replacement function is used to check whether the 152or a user-supplied replacement function is used to check whether the
@@ -151,6 +159,13 @@ If verification parameters associated with
151encourage checking of validity times, CAs with a valid time are 159encourage checking of validity times, CAs with a valid time are
152preferred, but if no matching CA has a valid time, one with an 160preferred, but if no matching CA has a valid time, one with an
153invalid time is accepted anyway. 161invalid time is accepted anyway.
162.Pp
163The following are deprecated aliases:
164.Bl -column X509_STORE_get_by_subject F X509_STORE_CTX_get_by_subject
165.It Fn X509_STORE_get_by_subject Ta for Ta Fn X509_STORE_CTX_get_by_subject
166.It Fn X509_STORE_get1_certs Ta for Ta Fn X509_STORE_CTX_get1_certs
167.It Fn X509_STORE_get1_crls Ta for Ta Fn X509_STORE_CTX_get1_crls
168.El
154.Sh RETURN VALUES 169.Sh RETURN VALUES
155.Fn X509_STORE_CTX_get_by_subject 170.Fn X509_STORE_CTX_get_by_subject
156and 171and
@@ -167,20 +182,24 @@ returns the new object or
167.Dv NULL 182.Dv NULL
168on failure, in particular if no match is found or memory allocation fails. 183on failure, in particular if no match is found or memory allocation fails.
169.Pp 184.Pp
185.Fn X509_STORE_CTX_get1_certs
186and
170.Fn X509_STORE_get1_certs 187.Fn X509_STORE_get1_certs
171returns a newly allocated and populated array of certificates or 188return a newly allocated and populated array of certificates or
172.Dv NULL 189.Dv NULL
173on failure. 190on failure.
174It fails if no match is found, if 191They fail if no match is found, if
175.Fn X509_STORE_get_by_subject 192.Fn X509_STORE_CTX_get_by_subject
176fails, or if memory allocation fails. 193fails, or if memory allocation fails.
177.Pp 194.Pp
195.Fn X509_STORE_CTX_get1_crls
196and
178.Fn X509_STORE_get1_crls 197.Fn X509_STORE_get1_crls
179returns a newly allocated and populated array of CRLs or 198return a newly allocated and populated array of CRLs or
180.Dv NULL 199.Dv NULL
181on failure. 200on failure.
182It fails if 201They fail if
183.Fn X509_STORE_get_by_subject 202.Fn X509_STORE_CTX_get_by_subject
184finds no new match, even if the associated 203finds no new match, even if the associated
185.Vt X509_STORE 204.Vt X509_STORE
186already contains matching CRLs, or if memory allocation fails. 205already contains matching CRLs, or if memory allocation fails.
@@ -222,3 +241,9 @@ and
222.Fn X509_STORE_CTX_get_obj_by_subject 241.Fn X509_STORE_CTX_get_obj_by_subject
223first appeared in OpenSSL 1.1.0 and have been available since 242first appeared in OpenSSL 1.1.0 and have been available since
224.Ox 7.1 . 243.Ox 7.1 .
244.Pp
245.Fn X509_STORE_CTX_get1_certs
246and
247.Fn X509_STORE_CTX_get1_crls
248first appeared in OpenSSL 1.1.0 and have been available since
249.Ox 7.4 .