summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/X509_STORE_load_locations.3117
2 files changed, 119 insertions, 1 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 42ec3807a2..46e8ba5739 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.111 2017/01/05 22:38:04 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.112 2017/01/07 00:45:04 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -212,6 +212,7 @@ MAN= \
212 X509_STORE_CTX_get_ex_new_index.3 \ 212 X509_STORE_CTX_get_ex_new_index.3 \
213 X509_STORE_CTX_new.3 \ 213 X509_STORE_CTX_new.3 \
214 X509_STORE_CTX_set_verify_cb.3 \ 214 X509_STORE_CTX_set_verify_cb.3 \
215 X509_STORE_load_locations.3 \
215 X509_STORE_set_verify_cb_func.3 \ 216 X509_STORE_set_verify_cb_func.3 \
216 X509_STORE_set1_param.3 \ 217 X509_STORE_set1_param.3 \
217 X509_VERIFY_PARAM_set_flags.3 \ 218 X509_VERIFY_PARAM_set_flags.3 \
diff --git a/src/lib/libcrypto/man/X509_STORE_load_locations.3 b/src/lib/libcrypto/man/X509_STORE_load_locations.3
new file mode 100644
index 0000000000..fa24044a36
--- /dev/null
+++ b/src/lib/libcrypto/man/X509_STORE_load_locations.3
@@ -0,0 +1,117 @@
1.\" $OpenBSD: X509_STORE_load_locations.3,v 1.1 2017/01/07 00:45:04 schwarze Exp $
2.\"
3.\" Copyright (c) 2017 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: January 7 2017 $
18.Dt X509_STORE_LOAD_LOCATIONS 3
19.Os
20.Sh NAME
21.Nm X509_STORE_load_locations ,
22.Nm X509_STORE_set_default_paths
23.Nd configure files and directories used by a certificate store
24.Sh SYNOPSIS
25.In openssl/x509_vfy.h
26.Ft int
27.Fo X509_STORE_load_locations
28.Fa "X509_STORE *store"
29.Fa "const char *file"
30.Fa "const char *dirs"
31.Fc
32.Ft int
33.Fo X509_STORE_set_default_paths
34.Fa "X509_STORE *store"
35.Fc
36.Sh DESCRIPTION
37.Fn X509_STORE_load_locations
38instructs the
39.Fa store
40to use the PEM file
41.Fa file
42and all the PEM files in the directories
43contained in the colon-separated list
44.Fa dirs
45for looking up certificates, in addition to files and directories
46that are already configured.
47Directories already in use are not added again.
48If
49.Dv NULL
50is passed for
51.Fa file
52or
53.Fa dirs ,
54no new file or no new directories are added, respectively.
55.Pp
56.Fn X509_STORE_load_locations
57is identical to
58.Xr SSL_CTX_load_verify_locations 3
59except that it operates directly on an
60.Vt X509_STORE
61object, rather than on the store used by an SSL context.
62See that manual page for more information.
63.Pp
64.Fn X509_STORE_set_default_paths
65is similar except that it instructs the
66.Fa store
67to use the default PEM file and directory, see
68.Sx FILES ,
69in addition to what is already configured.
70It ignores errors that occur while trying to load the file or to
71add the directory, but it may still fail for other reasons, for
72example when out of memory while trying to allocate the required
73.Vt X509_LOOKUP
74objects.
75.Pp
76.Fn X509_STORE_set_default_paths
77is identical to
78.Xr SSL_CTX_set_default_verify_paths 3
79except that it operates directly on an
80.Vt X509_STORE
81object, rather than on the store used by an SSL context.
82See that manual page for more information.
83.Sh RETURN VALUES
84.Fn X509_STORE_load_locations
85returns 1 if all files and directories specified were successfully
86added.
87It returns 0 for failure.
88That can happen if adding the file failed, if adding any of the
89directories failed, or if both arguments were
90.Dv NULL .
91.Pp
92.Fn X509_STORE_set_default_paths
93returns 0 for some error conditions and 1 otherwise, not just for
94success, but also for various cases of failure.
95.Sh FILES
96.Bl -tag -width Ds
97.It Pa /etc/ssl/cert.pem
98default PEM file for
99.Fn X509_STORE_set_default_paths
100.It Pa /etc/ssl/certs/
101default directory for
102.Fn X509_STORE_set_default_paths
103.El
104.Sh SEE ALSO
105.Xr SSL_CTX_load_verify_locations 3 ,
106.Xr X509_LOOKUP_hash_dir 3 ,
107.Xr X509_STORE_set1_param 3 ,
108.Xr X509_STORE_set_verify_cb 3
109.Sh BUGS
110By the time adding a directory is found to fail, the file and some
111other directories may already have been successfully loaded, so
112these functions may change the state of the store even when they
113fail.
114.Pp
115.Fn X509_STORE_set_default_paths
116clears the error queue, deleting even error information that was
117already present when it was called.