diff options
Diffstat (limited to 'src/lib/libcrypto/man/openssl.cnf.5')
-rw-r--r-- | src/lib/libcrypto/man/openssl.cnf.5 | 361 |
1 files changed, 0 insertions, 361 deletions
diff --git a/src/lib/libcrypto/man/openssl.cnf.5 b/src/lib/libcrypto/man/openssl.cnf.5 deleted file mode 100644 index 4047eb059a..0000000000 --- a/src/lib/libcrypto/man/openssl.cnf.5 +++ /dev/null | |||
@@ -1,361 +0,0 @@ | |||
1 | .\" $OpenBSD: openssl.cnf.5,v 1.11 2024/07/08 15:02:28 jmc Exp $ | ||
2 | .\" full merge up to: OpenSSL man5/config b53338cb Feb 28 12:30:28 2017 +0100 | ||
3 | .\" selective merge up to: OpenSSL a8c5ed81 Jul 18 13:57:25 2017 -0400 | ||
4 | .\" | ||
5 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
6 | .\" Copyright (c) 1999, 2000, 2004, 2013, 2015, 2016, 2017 The OpenSSL Project. | ||
7 | .\" All rights reserved. | ||
8 | .\" | ||
9 | .\" Redistribution and use in source and binary forms, with or without | ||
10 | .\" modification, are permitted provided that the following conditions | ||
11 | .\" are met: | ||
12 | .\" | ||
13 | .\" 1. Redistributions of source code must retain the above copyright | ||
14 | .\" notice, this list of conditions and the following disclaimer. | ||
15 | .\" | ||
16 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
17 | .\" notice, this list of conditions and the following disclaimer in | ||
18 | .\" the documentation and/or other materials provided with the | ||
19 | .\" distribution. | ||
20 | .\" | ||
21 | .\" 3. All advertising materials mentioning features or use of this | ||
22 | .\" software must display the following acknowledgment: | ||
23 | .\" "This product includes software developed by the OpenSSL Project | ||
24 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
25 | .\" | ||
26 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
27 | .\" endorse or promote products derived from this software without | ||
28 | .\" prior written permission. For written permission, please contact | ||
29 | .\" openssl-core@openssl.org. | ||
30 | .\" | ||
31 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
32 | .\" nor may "OpenSSL" appear in their names without prior written | ||
33 | .\" permission of the OpenSSL Project. | ||
34 | .\" | ||
35 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
36 | .\" acknowledgment: | ||
37 | .\" "This product includes software developed by the OpenSSL Project | ||
38 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
39 | .\" | ||
40 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
41 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
42 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
43 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
44 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
45 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
46 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
47 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
49 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
52 | .\" | ||
53 | .Dd $Mdocdate: July 8 2024 $ | ||
54 | .Dt OPENSSL.CNF 5 | ||
55 | .Os | ||
56 | .Sh NAME | ||
57 | .Nm openssl.cnf | ||
58 | .Nd OpenSSL configuration files | ||
59 | .Sh DESCRIPTION | ||
60 | The OpenSSL CONF library can be used to read configuration files; see | ||
61 | .Xr CONF_modules_load_file 3 . | ||
62 | It is used for the OpenSSL master configuration file | ||
63 | .Pa /etc/ssl/openssl.cnf | ||
64 | and in a few other places such as certificate extension files for the | ||
65 | .Xr openssl 1 | ||
66 | .Cm x509 | ||
67 | utility. | ||
68 | OpenSSL applications can also use the CONF library for their own | ||
69 | purposes. | ||
70 | .Pp | ||
71 | A configuration file is divided into a number of sections. | ||
72 | Each section starts with a line | ||
73 | .Bq Ar section_name | ||
74 | and ends when a new section is started or the end of the file is reached. | ||
75 | A section name can consist of alphanumeric characters and underscores. | ||
76 | .Pp | ||
77 | The first section of a configuration file is special and is referred to | ||
78 | as the | ||
79 | .Dq default section . | ||
80 | It is usually unnamed and extends from the start of file to the | ||
81 | first named section. | ||
82 | When a name is being looked up, it is first looked up in a named | ||
83 | section (if any) and then in the default section. | ||
84 | .Pp | ||
85 | The environment is mapped onto a section called | ||
86 | .Ic ENV . | ||
87 | .Pp | ||
88 | Comments can be included by preceding them with the | ||
89 | .Ql # | ||
90 | character. | ||
91 | .Pp | ||
92 | Each section in a configuration file consists of a number of name and | ||
93 | value pairs of the form | ||
94 | .Ar name Ns = Ns Ar value . | ||
95 | .Pp | ||
96 | The | ||
97 | .Ar name | ||
98 | string can contain any alphanumeric characters as well as a few | ||
99 | punctuation symbols such as | ||
100 | .Ql \&. | ||
101 | .Ql \&, | ||
102 | .Ql \&; | ||
103 | and | ||
104 | .Ql _ . | ||
105 | .Pp | ||
106 | The | ||
107 | .Ar value | ||
108 | string consists of the string following the | ||
109 | .Ql = | ||
110 | character until the end of the line with any leading and trailing | ||
111 | whitespace removed. | ||
112 | .Pp | ||
113 | The value string undergoes variable expansion. | ||
114 | This can be done by including substrings of the form | ||
115 | .Pf $ Ar name | ||
116 | or | ||
117 | .Pf $ Brq Ar name : | ||
118 | this will substitute the value of the named variable in the current | ||
119 | section. | ||
120 | It is also possible to substitute a value from another section using the | ||
121 | syntax | ||
122 | .Pf $ Ar section Ns :: Ns Ar name | ||
123 | or | ||
124 | .Pf $ Brq Ar section Ns :: Ns Ar name . | ||
125 | By using the form | ||
126 | .Pf $ Ic ENV Ns :: Ns Ar name , | ||
127 | environment variables can be substituted. | ||
128 | It is also possible to assign values to environment variables by using | ||
129 | the name | ||
130 | .Ic ENV Ns :: Ns Ar name . | ||
131 | This will work if the program looks up environment variables using | ||
132 | the CONF library instead of calling | ||
133 | .Xr getenv 3 | ||
134 | directly. | ||
135 | The value string must not exceed 64k in length after variable expansion or an | ||
136 | error will occur. | ||
137 | .Pp | ||
138 | It is possible to escape certain characters by using any kind of quote | ||
139 | or the | ||
140 | .Ql \e | ||
141 | character. | ||
142 | By making the last character of a line a | ||
143 | .Ql \e , | ||
144 | a | ||
145 | .Ar value | ||
146 | string can be spread across multiple lines. | ||
147 | In addition the sequences | ||
148 | .Ql \en , | ||
149 | .Ql \er , | ||
150 | .Ql \eb , | ||
151 | and | ||
152 | .Ql \et | ||
153 | are recognized. | ||
154 | .Sh OPENSSL LIBRARY CONFIGURATION | ||
155 | Applications can automatically configure certain aspects of OpenSSL | ||
156 | using the master OpenSSL configuration file, or optionally an | ||
157 | alternative configuration file. | ||
158 | The | ||
159 | .Xr openssl 1 | ||
160 | utility includes this functionality: any sub command uses the master | ||
161 | OpenSSL configuration file unless an option is used in the sub command | ||
162 | to use an alternative configuration file. | ||
163 | .Pp | ||
164 | To enable library configuration, the default section needs to contain | ||
165 | an appropriate line which points to the main configuration section. | ||
166 | The default name is | ||
167 | .Ic openssl_conf , | ||
168 | which is used by the | ||
169 | .Xr openssl 1 | ||
170 | utility. | ||
171 | Other applications may use an alternative name such as | ||
172 | .Sy myapplication_conf . | ||
173 | All library configuration lines appear in the default section | ||
174 | at the start of the configuration file. | ||
175 | .Pp | ||
176 | The configuration section should consist of a set of name value pairs | ||
177 | which contain specific module configuration information. | ||
178 | The | ||
179 | .Ar name | ||
180 | represents the name of the configuration module. | ||
181 | The meaning of the | ||
182 | .Ar value | ||
183 | is module specific: it may, for example, represent a further | ||
184 | configuration section containing configuration module specific | ||
185 | information. | ||
186 | For example: | ||
187 | .Bd -literal -offset indent | ||
188 | # The following line must be in the default section. | ||
189 | openssl_conf = openssl_init | ||
190 | |||
191 | [openssl_init] | ||
192 | oid_section = new_oids | ||
193 | |||
194 | [new_oids] | ||
195 | \&... new oids here ... | ||
196 | .Ed | ||
197 | .Pp | ||
198 | The features of each configuration module are described below. | ||
199 | .Ss ASN1 Object Configuration Module | ||
200 | This module has the name | ||
201 | .Ic oid_section . | ||
202 | The value of this variable points to a section containing name value | ||
203 | pairs of OIDs: the name is the OID short and long name, and the value is the | ||
204 | numerical form of the OID. | ||
205 | Although some of the | ||
206 | .Xr openssl 1 | ||
207 | utility subcommands already have their own ASN1 OBJECT section | ||
208 | functionality, not all do. | ||
209 | By using the ASN1 OBJECT configuration module, all the | ||
210 | .Xr openssl 1 | ||
211 | utility subcommands can see the new objects as well as any compliant | ||
212 | applications. | ||
213 | For example: | ||
214 | .Bd -literal -offset indent | ||
215 | [new_oids] | ||
216 | some_new_oid = 1.2.3.4 | ||
217 | some_other_oid = 1.2.3.5 | ||
218 | .Ed | ||
219 | .Pp | ||
220 | It is also possible to set the value to the long name followed by a | ||
221 | comma and the numerical OID form. | ||
222 | For example: | ||
223 | .Pp | ||
224 | .Dl shortName = some object long name, 1.2.3.4 | ||
225 | .Sh FILES | ||
226 | .Bl -tag -width /etc/ssl/openssl.cnf -compact | ||
227 | .It Pa /etc/ssl/openssl.cnf | ||
228 | standard configuration file | ||
229 | .El | ||
230 | .Sh EXAMPLES | ||
231 | Here is a sample configuration file using some of the features | ||
232 | mentioned above: | ||
233 | .Bd -literal -offset indent | ||
234 | # This is the default section. | ||
235 | HOME=/temp | ||
236 | RANDFILE= ${ENV::HOME}/.rnd | ||
237 | configdir=$ENV::HOME/config | ||
238 | |||
239 | [ section_one ] | ||
240 | # We are now in section one. | ||
241 | |||
242 | # Quotes permit leading and trailing whitespace | ||
243 | any = " any variable name " | ||
244 | |||
245 | other = A string that can \e | ||
246 | cover several lines \e | ||
247 | by including \e\e characters | ||
248 | |||
249 | message = Hello World\en | ||
250 | |||
251 | [ section_two ] | ||
252 | greeting = $section_one::message | ||
253 | .Ed | ||
254 | .Pp | ||
255 | This next example shows how to expand environment variables safely. | ||
256 | .Pp | ||
257 | Suppose you want a variable called | ||
258 | .Sy tmpfile | ||
259 | to refer to a temporary filename. | ||
260 | The directory it is placed in can determined by the | ||
261 | .Ev TEMP | ||
262 | or | ||
263 | .Ev TMP | ||
264 | environment variables but they may not be set to any value at all. | ||
265 | If you just include the environment variable names and the variable | ||
266 | doesn't exist then this will cause an error when an attempt is made to | ||
267 | load the configuration file. | ||
268 | By making use of the default section both values can be looked up with | ||
269 | .Ev TEMP | ||
270 | taking priority and | ||
271 | .Pa /tmp | ||
272 | used if neither is defined: | ||
273 | .Bd -literal -offset indent | ||
274 | TMP=/tmp | ||
275 | # The above value is used if TMP isn't in the environment | ||
276 | TEMP=$ENV::TMP | ||
277 | # The above value is used if TEMP isn't in the environment | ||
278 | tmpfile=${ENV::TEMP}/tmp.filename | ||
279 | .Ed | ||
280 | .Pp | ||
281 | More complex OpenSSL library configuration. | ||
282 | Add OID: | ||
283 | .Bd -literal -offset indent | ||
284 | # Default appname: should match "appname" parameter (if any) | ||
285 | # supplied to CONF_modules_load_file et al. | ||
286 | openssl_conf = openssl_conf_section | ||
287 | |||
288 | [openssl_conf_section] | ||
289 | # Configuration module list | ||
290 | oid_section = new_oids | ||
291 | |||
292 | [new_oids] | ||
293 | # New OID, just short name | ||
294 | newoid1 = 1.2.3.4.1 | ||
295 | # New OID shortname and long name | ||
296 | newoid2 = New OID 2 long name, 1.2.3.4.2 | ||
297 | .Ed | ||
298 | .Pp | ||
299 | The above examples can be used with any application supporting library | ||
300 | configuration if "openssl_conf" is modified to match the appropriate | ||
301 | "appname". | ||
302 | .Pp | ||
303 | For example if the second sample file above is saved to "example.cnf" | ||
304 | then the command line: | ||
305 | .Pp | ||
306 | .Dl OPENSSL_CONF=example.cnf openssl asn1parse -genstr OID:1.2.3.4.1 | ||
307 | .Pp | ||
308 | will output: | ||
309 | .Dl 0:d=0 hl=2 l= 4 prim: OBJECT :newoid1 | ||
310 | .Pp | ||
311 | showing that the OID "newoid1" has been added as "1.2.3.4.1". | ||
312 | .Sh SEE ALSO | ||
313 | .Xr openssl 1 , | ||
314 | .Xr CONF_modules_load_file 3 , | ||
315 | .Xr OPENSSL_config 3 , | ||
316 | .Xr x509v3.cnf 5 | ||
317 | .Sh CAVEATS | ||
318 | If a configuration file attempts to expand a variable that doesn't | ||
319 | exist, then an error is flagged and the file will not load. | ||
320 | This can also happen if an attempt is made to expand an environment | ||
321 | variable that doesn't exist. | ||
322 | For example, in a previous version of OpenSSL the default OpenSSL | ||
323 | master configuration file used the value of | ||
324 | .Ev HOME | ||
325 | which may not be defined on non Unix systems and would cause an error. | ||
326 | .Pp | ||
327 | This can be worked around by including a default section to provide | ||
328 | a default value: then if the environment lookup fails, the default | ||
329 | value will be used instead. | ||
330 | For this to work properly, the default value must be defined earlier | ||
331 | in the configuration file than the expansion. | ||
332 | See the | ||
333 | .Sx EXAMPLES | ||
334 | section for an example of how to do this. | ||
335 | .Pp | ||
336 | If the same variable is defined more than once in the same section, | ||
337 | then all but the last value will be silently ignored. | ||
338 | In certain circumstances such as with DNs, the same field may occur | ||
339 | multiple times. | ||
340 | This is usually worked around by ignoring any characters before an | ||
341 | initial | ||
342 | .Ql \&. , | ||
343 | for example: | ||
344 | .Bd -literal -offset indent | ||
345 | 1.OU="My first OU" | ||
346 | 2.OU="My Second OU" | ||
347 | .Ed | ||
348 | .Sh BUGS | ||
349 | Currently there is no way to include characters using the octal | ||
350 | .Pf \e Ar nnn | ||
351 | form. | ||
352 | Strings are all NUL terminated, so NUL bytes cannot form part of | ||
353 | the value. | ||
354 | .Pp | ||
355 | The escaping isn't quite right: if you want to use sequences like | ||
356 | .Ql \en , | ||
357 | you can't use any quote escaping on the same line. | ||
358 | .Pp | ||
359 | Files are loaded in a single pass. | ||
360 | This means that a variable expansion will only work if the variables | ||
361 | referenced are defined earlier in the file. | ||