diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/X509_STORE_load_locations.3 | 117 |
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 | ||
38 | instructs the | ||
39 | .Fa store | ||
40 | to use the PEM file | ||
41 | .Fa file | ||
42 | and all the PEM files in the directories | ||
43 | contained in the colon-separated list | ||
44 | .Fa dirs | ||
45 | for looking up certificates, in addition to files and directories | ||
46 | that are already configured. | ||
47 | Directories already in use are not added again. | ||
48 | If | ||
49 | .Dv NULL | ||
50 | is passed for | ||
51 | .Fa file | ||
52 | or | ||
53 | .Fa dirs , | ||
54 | no new file or no new directories are added, respectively. | ||
55 | .Pp | ||
56 | .Fn X509_STORE_load_locations | ||
57 | is identical to | ||
58 | .Xr SSL_CTX_load_verify_locations 3 | ||
59 | except that it operates directly on an | ||
60 | .Vt X509_STORE | ||
61 | object, rather than on the store used by an SSL context. | ||
62 | See that manual page for more information. | ||
63 | .Pp | ||
64 | .Fn X509_STORE_set_default_paths | ||
65 | is similar except that it instructs the | ||
66 | .Fa store | ||
67 | to use the default PEM file and directory, see | ||
68 | .Sx FILES , | ||
69 | in addition to what is already configured. | ||
70 | It ignores errors that occur while trying to load the file or to | ||
71 | add the directory, but it may still fail for other reasons, for | ||
72 | example when out of memory while trying to allocate the required | ||
73 | .Vt X509_LOOKUP | ||
74 | objects. | ||
75 | .Pp | ||
76 | .Fn X509_STORE_set_default_paths | ||
77 | is identical to | ||
78 | .Xr SSL_CTX_set_default_verify_paths 3 | ||
79 | except that it operates directly on an | ||
80 | .Vt X509_STORE | ||
81 | object, rather than on the store used by an SSL context. | ||
82 | See that manual page for more information. | ||
83 | .Sh RETURN VALUES | ||
84 | .Fn X509_STORE_load_locations | ||
85 | returns 1 if all files and directories specified were successfully | ||
86 | added. | ||
87 | It returns 0 for failure. | ||
88 | That can happen if adding the file failed, if adding any of the | ||
89 | directories failed, or if both arguments were | ||
90 | .Dv NULL . | ||
91 | .Pp | ||
92 | .Fn X509_STORE_set_default_paths | ||
93 | returns 0 for some error conditions and 1 otherwise, not just for | ||
94 | success, but also for various cases of failure. | ||
95 | .Sh FILES | ||
96 | .Bl -tag -width Ds | ||
97 | .It Pa /etc/ssl/cert.pem | ||
98 | default PEM file for | ||
99 | .Fn X509_STORE_set_default_paths | ||
100 | .It Pa /etc/ssl/certs/ | ||
101 | default 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 | ||
110 | By the time adding a directory is found to fail, the file and some | ||
111 | other directories may already have been successfully loaded, so | ||
112 | these functions may change the state of the store even when they | ||
113 | fail. | ||
114 | .Pp | ||
115 | .Fn X509_STORE_set_default_paths | ||
116 | clears the error queue, deleting even error information that was | ||
117 | already present when it was called. | ||