summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/X509_STORE_load_locations.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/X509_STORE_load_locations.3')
-rw-r--r--src/lib/libcrypto/man/X509_STORE_load_locations.3188
1 files changed, 0 insertions, 188 deletions
diff --git a/src/lib/libcrypto/man/X509_STORE_load_locations.3 b/src/lib/libcrypto/man/X509_STORE_load_locations.3
deleted file mode 100644
index a8177b0fd4..0000000000
--- a/src/lib/libcrypto/man/X509_STORE_load_locations.3
+++ /dev/null
@@ -1,188 +0,0 @@
1.\" $OpenBSD: X509_STORE_load_locations.3,v 1.12 2024/09/02 07:20:21 tb Exp $
2.\" full merge up to:
3.\" OpenSSL X509_STORE_add_cert b0edda11 Mar 20 13:00:17 2018 +0000
4.\"
5.\" Copyright (c) 2017, 2021 Ingo Schwarze <schwarze@openbsd.org>
6.\"
7.\" Permission to use, copy, modify, and distribute this software for any
8.\" purpose with or without fee is hereby granted, provided that the above
9.\" copyright notice and this permission notice appear in all copies.
10.\"
11.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18.\"
19.Dd $Mdocdate: September 2 2024 $
20.Dt X509_STORE_LOAD_LOCATIONS 3
21.Os
22.Sh NAME
23.Nm X509_STORE_load_locations ,
24.Nm X509_STORE_set_default_paths ,
25.Nm X509_STORE_load_mem ,
26.Nm X509_STORE_add_lookup
27.Nd configure files and directories used by a certificate store
28.Sh SYNOPSIS
29.In openssl/x509_vfy.h
30.Ft int
31.Fo X509_STORE_load_locations
32.Fa "X509_STORE *store"
33.Fa "const char *file"
34.Fa "const char *dirs"
35.Fc
36.Ft int
37.Fo X509_STORE_set_default_paths
38.Fa "X509_STORE *store"
39.Fc
40.Ft int
41.Fo X509_STORE_load_mem
42.Fa "X509_STORE *store"
43.Fa "void *buffer"
44.Fa "int length"
45.Fc
46.Ft X509_LOOKUP *
47.Fo X509_STORE_add_lookup
48.Fa "X509_STORE *store"
49.Fa "const X509_LOOKUP_METHOD *method"
50.Fc
51.Sh DESCRIPTION
52.Fn X509_STORE_load_locations
53instructs the
54.Fa store
55to use the PEM
56.Fa file
57and all the PEM files in the directories
58contained in the colon-separated list
59.Fa dirs
60for looking up certificates, in addition to files and directories
61that are already configured.
62The certificates in the directories must be in hashed form, as documented in
63.Xr X509_LOOKUP_hash_dir 3 .
64Directories already in use are not added again.
65If
66.Dv NULL
67is passed for
68.Fa file
69or
70.Fa dirs ,
71no new file or no new directories are added, respectively.
72.Pp
73.Fn X509_STORE_load_locations
74is identical to
75.Xr SSL_CTX_load_verify_locations 3
76except that it operates directly on an
77.Vt X509_STORE
78object, rather than on the store used by an SSL context.
79See that manual page for more information.
80.Pp
81.Fn X509_STORE_set_default_paths
82is similar except that it instructs the
83.Fa store
84to use the default PEM file and directory
85(as documented in
86.Sx FILES )
87in addition to what is already configured.
88It ignores errors that occur while trying to load the file or to
89add the directory, but it may still fail for other reasons, for
90example when out of memory while trying to allocate the required
91.Vt X509_LOOKUP
92objects.
93.Pp
94.Fn X509_STORE_set_default_paths
95is identical to
96.Xr SSL_CTX_set_default_verify_paths 3
97except that it operates directly on an
98.Vt X509_STORE
99object, rather than on the store used by an SSL context.
100See that manual page for more information.
101.Pp
102The above functions are wrappers around
103.Xr X509_LOOKUP_load_file 3
104and
105.Xr X509_LOOKUP_add_dir 3 .
106.Pp
107.Fn X509_STORE_load_mem
108instructs the
109.Fa store
110to use the certificates contained in the memory
111.Fa buffer
112of the given
113.Fa length
114for certificate lookup.
115It is a wrapper around
116.Xr X509_LOOKUP_add_mem 3 .
117.Pp
118.Fn X509_STORE_add_lookup
119checks whether the
120.Fa store
121already contains an
122.Vt X509_LOOKUP
123object using the given
124.Fa method ;
125if it does, the existing object is returned and no other action occurs.
126Otherwise, a new
127.Vt X509_LOOKUP
128object is allocated, added, and returned.
129This function is used internally by all the functions listed above.
130.Sh RETURN VALUES
131.Fn X509_STORE_load_locations
132returns 1 if all files and directories specified were successfully
133added.
134It returns 0 for failure.
135That can happen if adding the file failed, if adding any of the
136directories failed, or if both arguments were
137.Dv NULL .
138.Pp
139.Fn X509_STORE_set_default_paths
140returns 0 for some error conditions and 1 otherwise, not just for
141success, but also for various cases of failure.
142.Pp
143.Fn X509_STORE_load_mem
144returns 1 for success or 0 for failure.
145In particular, parse errors or lack of memory can cause failure.
146.Pp
147.Fn X509_STORE_add_lookup
148returns the existing or new lookup object or
149.Dv NULL
150on failure.
151This is an internal pointer that must not be freed.
152With LibreSSL, the only reason for failure is lack of memory.
153.Sh FILES
154.Bl -tag -width Ds
155.It Pa /etc/ssl/cert.pem
156default PEM file for
157.Fn X509_STORE_set_default_paths
158.It Pa /etc/ssl/certs/
159default directory for
160.Fn X509_STORE_set_default_paths
161.El
162.Sh SEE ALSO
163.Xr SSL_CTX_load_verify_locations 3 ,
164.Xr X509_load_cert_file 3 ,
165.Xr X509_LOOKUP_hash_dir 3 ,
166.Xr X509_LOOKUP_new 3 ,
167.Xr X509_STORE_new 3 ,
168.Xr X509_STORE_set1_param 3 ,
169.Xr X509_STORE_set_verify_cb 3
170.Sh HISTORY
171.Fn X509_STORE_load_locations ,
172.Fn X509_STORE_set_default_paths ,
173and
174.Fn X509_STORE_add_lookup
175first appeared in SSLeay 0.8.0 and have been available since
176.Ox 2.4 .
177.Pp
178.Fn X509_STORE_load_mem
179first appeared in
180.Ox 5.7 .
181.Sh BUGS
182By the time that adding a directory is found to have failed,
183the file and some other directories may already have been successfully loaded,
184so these functions may change the state of the store even when they fail.
185.Pp
186.Fn X509_STORE_set_default_paths
187clears the error queue, deleting even error information that was
188already present when it was called.