summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2016-12-11 18:06:09 +0000
committerschwarze <>2016-12-11 18:06:09 +0000
commitf38b80a25989f438feba1b384061f8cf8c444059 (patch)
treef74c28658a72fb7b0195134f68ba8e54d3d24f7a
parent24e78a11838b5b911fc4a003f68b779f8b42e6f6 (diff)
downloadopenbsd-f38b80a25989f438feba1b384061f8cf8c444059.tar.gz
openbsd-f38b80a25989f438feba1b384061f8cf8c444059.tar.bz2
openbsd-f38b80a25989f438feba1b384061f8cf8c444059.zip
import openssl.cnf(5) and x509v3.cnf(5) from OpenSSL;
below OpenBSD quality standards, but better than nothing...
-rw-r--r--src/lib/libcrypto/man/ASN1_generate_nconf.37
-rw-r--r--src/lib/libcrypto/man/CONF_modules_load_file.319
-rw-r--r--src/lib/libcrypto/man/Makefile6
-rw-r--r--src/lib/libcrypto/man/OPENSSL_config.314
-rw-r--r--src/lib/libcrypto/man/openssl.cnf.5496
-rw-r--r--src/lib/libcrypto/man/x509v3.cnf.5731
6 files changed, 1259 insertions, 14 deletions
diff --git a/src/lib/libcrypto/man/ASN1_generate_nconf.3 b/src/lib/libcrypto/man/ASN1_generate_nconf.3
index 2d5d8c7a73..bcf55d724b 100644
--- a/src/lib/libcrypto/man/ASN1_generate_nconf.3
+++ b/src/lib/libcrypto/man/ASN1_generate_nconf.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ASN1_generate_nconf.3,v 1.7 2016/11/10 13:06:24 schwarze Exp $ 1.\" $OpenBSD: ASN1_generate_nconf.3,v 1.8 2016/12/11 18:06:09 schwarze Exp $
2.\" OpenSSL 05ea606a Fri May 20 20:52:46 2016 -0400 2.\" OpenSSL 05ea606a Fri May 20 20:52:46 2016 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson. 4.\" This file was written by Dr. Stephen Henson.
@@ -49,7 +49,7 @@
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 51.\"
52.Dd $Mdocdate: November 10 2016 $ 52.Dd $Mdocdate: December 11 2016 $
53.Dt ASN1_GENERATE_NCONF 3 53.Dt ASN1_GENERATE_NCONF 3
54.Os 54.Os
55.Sh NAME 55.Sh NAME
@@ -374,7 +374,8 @@ D4D2C6D000430DEC66ABF47829E74B8C5108623A1C0EE8BE217B3AD8D36D5EB4FCA1D9
374e=INTEGER:0x010001 374e=INTEGER:0x010001
375.Ed 375.Ed
376.Sh SEE ALSO 376.Sh SEE ALSO
377.Xr ERR_get_error 3 377.Xr ERR_get_error 3 ,
378.Xr x509v3.cnf 5
378.Sh HISTORY 379.Sh HISTORY
379.Fn ASN1_generate_nconf 380.Fn ASN1_generate_nconf
380and 381and
diff --git a/src/lib/libcrypto/man/CONF_modules_load_file.3 b/src/lib/libcrypto/man/CONF_modules_load_file.3
index 0e594a1544..620787b4f1 100644
--- a/src/lib/libcrypto/man/CONF_modules_load_file.3
+++ b/src/lib/libcrypto/man/CONF_modules_load_file.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: CONF_modules_load_file.3,v 1.4 2016/11/20 19:47:59 schwarze Exp $ 1.\" $OpenBSD: CONF_modules_load_file.3,v 1.5 2016/12/11 18:06:09 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: November 20 2016 $ 51.Dd $Mdocdate: December 11 2016 $
52.Dt CONF_MODULES_LOAD_FILE 3 52.Dt CONF_MODULES_LOAD_FILE 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -72,15 +72,19 @@
72.Sh DESCRIPTION 72.Sh DESCRIPTION
73The function 73The function
74.Fn CONF_modules_load_file 74.Fn CONF_modules_load_file
75configures OpenSSL using file 75configures OpenSSL using the file
76.Fa filename 76.Fa filename
77and application name 77in
78.Xr openssl.cnf 5
79format and the application name
78.Fa appname . 80.Fa appname .
79If 81If
80.Fa filename 82.Fa filename
81is 83is
82.Dv NULL , 84.Dv NULL ,
83the standard OpenSSL configuration file is used. 85the standard OpenSSL configuration file
86.Pa /etc/ssl/openssl.cnf
87is used.
84If 88If
85.Fa appname 89.Fa appname
86is 90is
@@ -149,6 +153,11 @@ These functions return 1 for success and zero or a negative value for
149failure. 153failure.
150If module errors are not ignored, the return code will reflect the return 154If module errors are not ignored, the return code will reflect the return
151value of the failing module (this will always be zero or negative). 155value of the failing module (this will always be zero or negative).
156.Sh FILES
157.Bl -tag -width /etc/ssl/openssl.cnf -compact
158.It Pa /etc/ssl/openssl.cnf
159standard configuration file
160.El
152.Sh EXAMPLES 161.Sh EXAMPLES
153Load a configuration file and print out any errors and exit (missing 162Load a configuration file and print out any errors and exit (missing
154file considered fatal): 163file considered fatal):
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 4d23082d1f..89533851fb 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.73 2016/12/11 14:22:43 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.74 2016/12/11 18:06:09 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -218,7 +218,9 @@ MAN= \
218 i2d_PKCS7_bio_stream.3 \ 218 i2d_PKCS7_bio_stream.3 \
219 lh_new.3 \ 219 lh_new.3 \
220 lh_stats.3 \ 220 lh_stats.3 \
221 x509.3 221 x509.3 \
222 openssl.cnf.5 \
223 x509v3.cnf.5
222 224
223all clean cleandir depend includes obj tags: 225all clean cleandir depend includes obj tags:
224 226
diff --git a/src/lib/libcrypto/man/OPENSSL_config.3 b/src/lib/libcrypto/man/OPENSSL_config.3
index e6968171c4..bf42b72fd2 100644
--- a/src/lib/libcrypto/man/OPENSSL_config.3
+++ b/src/lib/libcrypto/man/OPENSSL_config.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OPENSSL_config.3,v 1.4 2016/11/28 14:52:20 schwarze Exp $ 1.\" $OpenBSD: OPENSSL_config.3,v 1.5 2016/12/11 18:06:09 schwarze Exp $
2.\" OpenSSL ab6577a4 May 14 21:07:51 2014 +0100 2.\" OpenSSL ab6577a4 May 14 21:07:51 2014 +0100
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: November 28 2016 $ 51.Dd $Mdocdate: December 11 2016 $
52.Dt OPENSSL_CONFIG 3 52.Dt OPENSSL_CONFIG 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -66,7 +66,7 @@
66.Sh DESCRIPTION 66.Sh DESCRIPTION
67.Fn OPENSSL_config 67.Fn OPENSSL_config
68configures OpenSSL using the standard 68configures OpenSSL using the standard
69.Pa openssl.cnf 69.Xr openssl.cnf 5
70configuration file name using 70configuration file name using
71.Fa config_name . 71.Fa config_name .
72If 72If
@@ -139,9 +139,15 @@ Neither
139nor 139nor
140.Fn OPENSSL_no_config 140.Fn OPENSSL_no_config
141return a value. 141return a value.
142.Sh FILES
143.Bl -tag -width /etc/ssl/openssl.cnf -compact
144.It Pa /etc/ssl/openssl.cnf
145standard configuration file
146.El
142.Sh SEE ALSO 147.Sh SEE ALSO
143.Xr CONF_modules_free 3 , 148.Xr CONF_modules_free 3 ,
144.Xr CONF_modules_load 3 149.Xr CONF_modules_load 3 ,
150.Xr openssl.cnf 5
145.Sh HISTORY 151.Sh HISTORY
146.Fn OPENSSL_config 152.Fn OPENSSL_config
147and 153and
diff --git a/src/lib/libcrypto/man/openssl.cnf.5 b/src/lib/libcrypto/man/openssl.cnf.5
new file mode 100644
index 0000000000..2826b779ba
--- /dev/null
+++ b/src/lib/libcrypto/man/openssl.cnf.5
@@ -0,0 +1,496 @@
1.\" $OpenBSD: openssl.cnf.5,v 1.1 2016/12/11 18:06:09 schwarze Exp $
2.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 1999, 2000, 2004, 2013, 2015, 2016 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: December 11 2016 $
53.Dt OPENSSL.CNF 5
54.Os
55.Sh NAME
56.Nm openssl.cnf
57.Nd OpenSSL configuration files
58.Sh DESCRIPTION
59The OpenSSL CONF library can be used to read configuration files, see
60.Xr CONF_modules_load_file 3 .
61It is used for the OpenSSL master configuration file
62.Pa /etc/ssl/openssl.cnf
63and in a few other places like
64.Sy SPKAC
65files and certificate extension files for the
66.Xr openssl 1
67.Cm x509
68utility.
69OpenSSL applications can also use the CONF library for their own
70purposes.
71.Pp
72A configuration file is divided into a number of sections.
73Each section starts with a line
74.Bq Ar section_name
75and ends when a new section is started or the end of the file is reached.
76A section name can consist of alphanumeric characters and underscores.
77.Pp
78The first section of a configuration file is special and is referred to
79as the
80.Dq default section .
81It is usually unnamed and extends from the start of file to the
82first named section.
83When a name is being looked up, it is first looked up in a named
84section (if any) and then in the default section.
85.Pp
86The environment is mapped onto a section called
87.Ic ENV .
88.Pp
89Comments can be included by preceding them with the
90.Ql #
91character.
92.Pp
93Each section in a configuration file consists of a number of name and
94value pairs of the form
95.Ar name Ns = Ns Ar value .
96.Pp
97The
98.Ar name
99string can contain any alphanumeric characters as well as a few
100punctuation symbols such as
101.Ql \&.
102.Ql \&,
103.Ql \&;
104and
105.Ql _ .
106.Pp
107The
108.Ar value
109string consists of the string following the
110.Ql =
111character until the end of the line with any leading and trailing
112whitespace removed.
113.Pp
114The value string undergoes variable expansion.
115This can be done by including substrings of the form
116.Pf $ Ar name
117or
118.Pf $ Brq Ar name :
119this will substitute the value of the named variable in the current
120section.
121It is also possible to substitute a value from another section using the
122syntax
123.Pf $ Ar section Ns :: Ns Ar name
124or
125.Pf $ Brq Ar section Ns :: Ns Ar name .
126By using the form
127.Pf $ Ic ENV Ns :: Ns Ar name ,
128environment variables can be substituted.
129It is also possible to assign values to environment variables by using
130the name
131.Ic ENV Ns :: Ns Ar name .
132This will work if the program looks up environment variables using
133the CONF library instead of calling
134.Xr getenv 3
135directly.
136.Pp
137It is possible to escape certain characters by using any kind of quote
138or the
139.Ql \e
140character.
141By making the last character of a line a
142.Ql \e ,
143a
144.Ar value
145string can be spread across multiple lines.
146In addition the sequences
147.Ql \en ,
148.Ql \er ,
149.Ql \eb ,
150and
151.Ql \et
152are recognized.
153.Sh OPENSSL LIBRARY CONFIGURATION
154Applications can automatically configure certain aspects of OpenSSL
155using the master OpenSSL configuration file, or optionally an
156alternative configuration file.
157The
158.Xr openssl 1
159utility includes this functionality: any sub command uses the master
160OpenSSL configuration file unless an option is used in the sub command
161to use an alternative configuration file.
162.Pp
163To enable library configuration, the default section needs to contain
164an appropriate line which points to the main configuration section.
165The default name is
166.Ic openssl_conf
167which is used by the
168.Xr openssl 1
169utility.
170Other applications may use an alternative name such as
171.Sy myapplicaton_conf .
172.Pp
173The configuration section should consist of a set of name value pairs
174which contain specific module configuration information.
175The
176.Ar name
177represents the name of the configuration module.
178The meaning of the
179.Ar value
180is module specific: it may, for example, represent a further
181configuration section containing configuration module specific
182information.
183For example:
184.Bd -literal -offset indent
185openssl_conf = openssl_init
186
187[openssl_init]
188oid_section = new_oids
189engines = engine_section
190
191[new_oids]
192\&... new oids here ...
193
194[engine_section]
195\&... engine stuff here ...
196.Ed
197.Pp
198The features of each configuration module are described below.
199.Ss ASN1 Object Configuration Module
200This module has the name
201.Ic oid_section .
202The value of this variable points to a section containing name value
203pairs of OIDs: the name is the OID short and long name, the value is the
204numerical form of the OID.
205Although some of the
206.Xr openssl 1
207utility subcommands already have their own ASN1 OBJECT section
208functionality, not all do.
209By using the ASN1 OBJECT configuration module, all the
210.Xr openssl 1
211utility subcommands can see the new objects as well as any compliant
212applications.
213For example:
214.Bd -literal -offset indent
215[new_oids]
216some_new_oid = 1.2.3.4
217some_other_oid = 1.2.3.5
218.Ed
219.Pp
220It is also possible to set the value to the long name followed by a
221comma and the numerical OID form.
222For example:
223.Pp
224.Dl shortName = some object long name, 1.2.3.4
225.Ss Engine Configuration Module
226This ENGINE configuration module has the name
227.Ic engines .
228The value of this variable points to a section containing further ENGINE
229configuration information.
230.Pp
231The section pointed to by
232.Ic engines
233is a table of engine names (though see
234.Ic engine_id
235below) and further sections containing configuration information
236specific to each ENGINE.
237.Pp
238Each ENGINE specific section is used to set default algorithms, load
239dynamic, perform initialization and send ctrls.
240The actual operation performed depends on the command
241name which is the name of the name value pair.
242The currently supported commands are listed below.
243.Pp
244For example:
245.Bd -literal -offset indent
246[engine_section]
247# Configure ENGINE named "foo"
248foo = foo_section
249# Configure ENGINE named "bar"
250bar = bar_section
251
252[foo_section]
253\&... foo ENGINE specific commands ...
254
255[bar_section]
256\&... "bar" ENGINE specific commands ...
257.Ed
258.Pp
259The command
260.Ic engine_id
261is used to give the ENGINE name.
262If used this command must be first.
263For example:
264.Bd -literal -offset indent
265[engine_section]
266# This would normally handle an ENGINE named "foo"
267foo = foo_section
268
269[foo_section]
270# Override default name and use "myfoo" instead.
271engine_id = myfoo
272.Ed
273.Pp
274The command
275.Ic dynamic_path
276loads and adds an ENGINE from the given path.
277It is equivalent to sending the ctrls
278.Sy SO_PATH
279with the path argument followed by
280.Sy LIST_ADD
281with value 2 and
282.Sy LOAD
283to the dynamic ENGINE. If this is not the required behaviour then
284alternative ctrls can be sent directly to the dynamic ENGINE using ctrl
285commands.
286.Pp
287The command
288.Ic init
289determines whether to initialize the ENGINE.
290If the value is 0, the ENGINE will not be initialized.
291If it is 1, an attempt is made to initialized the ENGINE immediately.
292If the
293.Ic init
294command is not present, then an attempt will be made to initialize
295the ENGINE after all commands in its section have been processed.
296.Pp
297The command
298.Ic default_algorithms
299sets the default algorithms an ENGINE will supply using the functions
300.Xr ENGINE_set_default_string 3 .
301.Pp
302If the name matches none of the above command names it is assumed
303to be a ctrl command which is sent to the ENGINE.
304The value of the command is the argument to the ctrl command.
305If the value is the string
306.Cm EMPTY ,
307then no value is sent to the command.
308.Pp
309For example:
310.Bd -literal -offset indent
311[engine_section]
312# Configure ENGINE named "foo"
313foo = foo_section
314
315[foo_section]
316# Load engine from DSO
317dynamic_path = /some/path/fooengine.so
318# A foo specific ctrl.
319some_ctrl = some_value
320# Another ctrl that doesn't take a value.
321other_ctrl = EMPTY
322# Supply all default algorithms
323default_algorithms = ALL
324.Ed
325.Ss SSL Configuration Module
326This module has the name
327.Ic ssl_conf
328which points to a section containing SSL configurations.
329.Pp
330Each line in the SSL configuration section contains the name of the
331configuration and the section containing it.
332.Pp
333Each configuration section consists of command value pairs for
334.Vt SSL_CONF .
335Each pair will be passed to a
336.Vt SSL_CTX
337or
338.Vt SSL
339structure if it calls
340.Xr SSL_CTX_config 3
341or
342.Xr SSL_config 3
343with the appropriate configuration name.
344.Pp
345Note: any characters before an initial dot in the configuration section
346are ignored so the same command can be used multiple times.
347.Pp
348For example:
349.Bd -literal -offset indent
350ssl_conf = ssl_sect
351
352[ssl_sect]
353server = server_section
354
355[server_section]
356RSA.Certificate = server-rsa.pem
357ECDSA.Certificate = server-ecdsa.pem
358Ciphers = ALL:!RC4
359.Ed
360.Sh FILES
361.Bl -tag -width /etc/ssl/openssl.cnf -compact
362.It Pa /etc/ssl/openssl.cnf
363standard configuration file
364.El
365.Sh EXAMPLES
366Here is a sample configuration file using some of the features
367mentioned above:
368.Bd -literal -offset indent
369# This is the default section.
370HOME=/temp
371RANDFILE= ${ENV::HOME}/.rnd
372configdir=$ENV::HOME/config
373
374[ section_one ]
375# We are now in section one.
376
377# Quotes permit leading and trailing whitespace
378any = " any variable name "
379
380other = A string that can \e
381cover several lines \e
382by including \e\e characters
383
384message = Hello World\en
385
386[ section_two ]
387greeting = $section_one::message
388.Ed
389.Pp
390This next example shows how to expand environment variables safely.
391.Pp
392Suppose you want a variable called
393.Sy tmpfile
394to refer to a temporary filename.
395The directory it is placed in can determined by the
396.Ev TEMP
397or
398.Ev TMP
399environment variables but they may not be set to any value at all.
400If you just include the environment variable names and the variable
401doesn't exist then this will cause an error when an attempt is made to
402load the configuration file.
403By making use of the default section both values can be looked up with
404.Ev TEMP
405taking priority and
406.Pa /tmp
407used if neither is defined:
408.Bd -literal -offset indent
409TMP=/tmp
410# The above value is used if TMP isn't in the environment
411TEMP=$ENV::TMP
412# The above value is used if TEMP isn't in the environment
413tmpfile=${ENV::TEMP}/tmp.filename
414.Ed
415.Pp
416More complex OpenSSL library configuration.
417Add OID:
418.Bd -literal -offset indent
419# Default appname: should match "appname" parameter (if any)
420# supplied to CONF_modules_load_file et al.
421openssl_conf = openssl_conf_section
422
423[openssl_conf_section]
424# Configuration module list
425alg_section = evp_sect
426oid_section = new_oids
427
428[new_oids]
429# New OID, just short name
430newoid1 = 1.2.3.4.1
431# New OID shortname and long name
432newoid2 = New OID 2 long name, 1.2.3.4.2
433.Ed
434.Pp
435The above examples can be used with any application supporting library
436configuration if "openssl_conf" is modified to match the appropriate
437"appname".
438.Pp
439For example if the second sample file above is saved to "example.cnf"
440then the command line:
441.Pp
442.Dl OPENSSL_CONF=example.cnf openssl asn1parse -genstr OID:1.2.3.4.1
443.Pp
444will output:
445.Dl 0:d=0 hl=2 l= 4 prim: OBJECT :newoid1
446.Pp
447showing that the OID "newoid1" has been added as "1.2.3.4.1".
448.Sh SEE ALSO
449.Xr openssl 1 ,
450.Xr CONF_modules_load_file 3 ,
451.Xr x509v3.cnf 5
452.Sh CAVEATS
453If a configuration file attempts to expand a variable that doesn't
454exist, then an error is flagged and the file will not load.
455This can also happen if an attempt is made to expand an environment
456variable that doesn't exist.
457For example, in a previous version of OpenSSL the default OpenSSL
458master configuration file used the value of
459.Ev HOME
460which may not be defined on non Unix systems and would cause an error.
461.Pp
462This can be worked around by including a default section to provide
463a default value: then if the environment lookup fails, the default
464value will be used instead.
465For this to work properly, the default value must be defined earlier
466in the configuration file than the expansion.
467See the
468.Sx EXAMPLES
469section for an example of how to do this.
470.Pp
471If the same variable is defined more than once in the same section,
472then all but the last value will be silently ignored.
473In certain circumstances such as with DNs, the same field may occur
474multiple times.
475This is usually worked around by ignoring any characters before an
476initial
477.Ql \&. ,
478for example:
479.Bd -literal -offset indent
4801.OU="My first OU"
4812.OU="My Second OU"
482.Ed
483.Sh BUGS
484Currently there is no way to include characters using the octal
485.Pf \e Ar nnn
486form.
487Strings are all NUL terminated, so NUL bytes cannot form part of
488the value.
489.Pp
490The escaping isn't quite right: if you want to use sequences like
491.Ql \en ,
492you can't use any quote escaping on the same line.
493.Pp
494Files are loaded in a single pass.
495This means that an variable expansion will only work if the variables
496referenced are defined earlier in the file.
diff --git a/src/lib/libcrypto/man/x509v3.cnf.5 b/src/lib/libcrypto/man/x509v3.cnf.5
new file mode 100644
index 0000000000..22e013a87e
--- /dev/null
+++ b/src/lib/libcrypto/man/x509v3.cnf.5
@@ -0,0 +1,731 @@
1.\" $OpenBSD: x509v3.cnf.5,v 1.1 2016/12/11 18:06:09 schwarze Exp $
2.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2004, 2006, 2013, 2014, 2015, 2016 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: December 11 2016 $
53.Dt X509V3.CNF 5
54.Os
55.Sh NAME
56.Nm x509v3.cnf
57.Nd X.509 V3 certificate extension configuration format
58.Sh DESCRIPTION
59Several of the OpenSSL utilities can add extensions to a certificate or
60certificate request based on the contents of a configuration file.
61The file format is based on the
62.Xr openssl.cnf 5
63format.
64.Pp
65Typically the application will contain an option to point to an
66extension section.
67Each line of the extension section takes the form:
68.Pp
69.D1 Ar extension_name Ns = Ns Oo Cm critical , Oc Ar extension_options
70.Pp
71If
72.Cm critical
73is present, then the extension will be critical.
74.Pp
75The format of
76.Ar extension_options
77depends on the value of
78.Ar extension_name .
79.Pp
80There are four main types of extension: string extensions, multi-valued
81extensions, raw extensions, and arbitrary extensions.
82.Pp
83String extensions simply have a string which contains either the value
84itself or how it is obtained.
85For example:
86.Pp
87.Dl nsComment="This is a Comment"
88.Pp
89Multi-valued extensions have a short form and a long form.
90The short form is a list of names and values:
91.Pp
92.Dl basicConstraints=critical,CA:true,pathlen:1
93.Pp
94The long form allows the values to be placed in a separate section:
95.Bd -literal -offset indent
96basicConstraints=critical,@bs_section
97
98[bs_section]
99CA=true
100pathlen=1
101.Ed
102.Pp
103Both forms are equivalent.
104.Pp
105The syntax of raw extensions is governed by the extension code:
106it can for example contain data in multiple sections.
107The correct syntax to use is defined by the extension code itself:
108check out the certificate policies extension for an example.
109.Pp
110If an extension type is unsupported, then the arbitrary extension
111syntax must be used, see the
112.Sx ARBITRARY EXTENSIONS
113section for more details.
114.Sh STANDARD EXTENSIONS
115The following sections describe each supported extension in detail.
116.Ss Basic constraints
117This is a multi-valued extension which indicates whether a certificate
118is a CA certificate.
119The first (mandatory) name is
120.Ic CA
121followed by
122.Cm TRUE
123or
124.Cm FALSE .
125If
126.Ic CA
127is
128.Cm TRUE ,
129then an optional
130.Ic pathlen
131name followed by an non-negative value can be included.
132For example:
133.Bd -literal -offset indent
134basicConstraints=CA:TRUE
135basicConstraints=CA:FALSE
136basicConstraints=critical,CA:TRUE, pathlen:0
137.Ed
138.Pp
139A CA certificate must include the
140.Ic basicConstraints
141value with the
142.Ic CA
143field set to
144.Cm TRUE .
145An end user certificate must either set
146.Ic CA
147to
148.Cm FALSE
149or exclude the extension entirely.
150Some software may require the inclusion of
151.Ic basicConstraints
152with
153.Ic CA
154set to
155.Cm FALSE
156for end entity certificates.
157.Pp
158The
159.Ic pathlen
160parameter indicates the maximum number of CAs that can appear below
161this one in a chain.
162So if you have a CA with a
163.Ic pathlen
164of zero it can only be used to sign end user certificates and not
165further CAs.
166.Ss Key usage
167Key usage is a multi-valued extension consisting of a list of names of
168the permitted key usages.
169.Pp
170The supported names are:
171.Ic digitalSignature ,
172.Ic nonRepudiation ,
173.Ic keyEncipherment ,
174.Ic dataEncipherment ,
175.Ic keyAgreement ,
176.Ic keyCertSign ,
177.Ic cRLSign ,
178.Ic encipherOnly ,
179and
180.Ic decipherOnly .
181Examples:
182.Bd -literal -offset indent
183keyUsage=digitalSignature, nonRepudiation
184keyUsage=critical, keyCertSign
185.Ed
186.Ss Extended key usage
187This extensions consists of a list of usages indicating purposes for
188which the certificate public key can be used for.
189.Pp
190These can either be object short names or the dotted numerical form of OIDs.
191While any OID can be used, only certain values make sense.
192In particular the following PKIX, NS and MS values are meaningful:
193.Bl -column emailProtection
194.It Em value Ta Em meaning
195.It Ic serverAuth Ta SSL/TLS web server authentication
196.It Ic clientAuth Ta SSL/TLS web client authentication
197.It Ic codeSigning Ta code signing
198.It Ic emailProtection Ta E-mail protection (S/MIME)
199.It Ic timeStamping Ta trusted timestamping
200.It Ic OCSPSigning Ta OCSP signing
201.It Ic ipsecIKE Ta IPsec internet key exchange
202.It Ic msCodeInd Ta Microsoft individual code signing (authenticode)
203.It Ic msCodeCom Ta Microsoft commercial code signing (authenticode)
204.It Ic msCTLSign Ta Microsoft trust list signing
205.It Ic msEFS Ta Microsoft encrypted file system
206.El
207.Pp
208Examples:
209.Bd -literal -offset indent
210extendedKeyUsage=critical,codeSigning,1.2.3.4
211extendedKeyUsage=serverAuth,clientAuth
212.Ed
213.Ss Subject key identifier
214This is really a string extension and can take two possible values.
215Either the word
216.Cm hash
217which will automatically follow the guidelines in RFC 3280
218or a hex string giving the extension value to include.
219The use of the hex string is strongly discouraged.
220Example:
221.Pp
222.Dl subjectKeyIdentifier=hash
223.Ss Authority key identifier
224The authority key identifier extension permits two options,
225.Cm keyid
226and
227.Cm issuer :
228both can take the optional value
229.Cm always .
230.Pp
231If the
232.Cm keyid
233option is present, an attempt is made to copy the subject
234key identifier from the parent certificate.
235If the value
236.Cm always
237is present, then an error is returned if the option fails.
238.Pp
239The
240.Cm issuer
241option copies the issuer and serial number from the issuer certificate.
242This will only be done if the
243.Cm keyid
244option fails or is not included unless the
245.Cm always
246flag will always include the value.
247Example:
248.Pp
249.Dl authorityKeyIdentifier=keyid,issuer
250.Ss Subject alternative name
251The subject alternative name extension allows various literal values to
252be included in the configuration file.
253These include
254.Ic email
255(an email address),
256.Ic URI
257(a uniform resource indicator),
258.Ic DNS
259(a DNS domain name),
260.Ic RID
261(a registered ID: OBJECT IDENTIFIER),
262.Ic IP
263(an IP address),
264.Ic dirName
265(a distinguished name), and
266.Ic otherName .
267.Pp
268The
269.Ic email
270option include a special
271.Cm copy
272value.
273This will automatically include any email addresses contained in the
274certificate subject name in the extension.
275.Pp
276The IP address used in the
277.Ic IP
278options can be in either IPv4 or IPv6 format.
279.Pp
280The value of
281.Ic dirName
282should point to a section containing the distinguished name to use as a
283set of name value pairs.
284Multi values AVAs can be formed by prefacing the name with a
285.Ql +
286character.
287.Pp
288.Ic otherName
289can include arbitrary data associated with an OID: the value should
290be the OID followed by a semicolon and the content in standard
291.Xr ASN1_generate_nconf 3
292format.
293Examples:
294.Bd -literal -offset 2n
295subjectAltName=email:copy,email:my@other.address,URI:http://my.url.here/
296subjectAltName=IP:192.168.7.1
297subjectAltName=IP:13::17
298subjectAltName=email:my@other.address,RID:1.2.3.4
299subjectAltName=otherName:1.2.3.4;UTF8:some other identifier
300
301subjectAltName=dirName:dir_sect
302
303[dir_sect]
304C=UK
305O=My Organization
306OU=My Unit
307CN=My Name
308.Ed
309.Ss Issuer alternative name
310The issuer alternative name option supports all the literal options of
311subject alternative name.
312It does not support the
313.Ic email : Ns Cm copy
314option because that would not make sense.
315It does support an additional
316.Ic issuer : Ns Cm copy
317option that will copy all the subject alternative name values from
318the issuer certificate (if possible).
319Example:
320.Pp
321.Dl issuserAltName = issuer:copy
322.Ss Authority info access
323The authority information access extension gives details about how to
324access certain information relating to the CA.
325Its syntax is
326.Ar accessOID ; location
327where
328.Ar location
329has the same syntax as subject alternative name (except that
330.Ic email : Ns Cm copy
331is not supported).
332.Ar accessOID
333can be any valid OID but only certain values are meaningful,
334for example
335.Cm OCSP
336and
337.Cm caIssuers .
338Example:
339.Bd -literal -offset indent
340authorityInfoAccess = OCSP;URI:http://ocsp.my.host/
341authorityInfoAccess = caIssuers;URI:http://my.ca/ca.html
342.Ed
343.Ss CRL distribution points
344This is a multi-valued extension whose options can be either in
345.Ar name : Ns Ar value
346pair form using the same form as subject alternative name or a
347single value representing a section name containing all the
348distribution point fields.
349.Pp
350For a
351.Ar name : Ns Ar value
352pair a new DistributionPoint with the fullName field set to the
353given value, both the cRLissuer and reasons fields are omitted in
354this case.
355.Pp
356In the single option case, the section indicated contains values
357for each field.
358In this section:
359.Pp
360If the name is
361.Ic fullname ,
362the value field should contain the full name of the distribution
363point in the same format as subject alternative name.
364.Pp
365If the name is
366.Ic relativename ,
367then the value field should contain a section name whose contents
368represent a DN fragment to be placed in this field.
369.Pp
370The name
371.Ic CRLIssuer ,
372if present, should contain a value for this field in subject
373alternative name format.
374.Pp
375If the name is
376.Ic reasons ,
377the value field should consist of a comma separated field containing
378the reasons.
379Valid reasons are:
380.Cm keyCompromise ,
381.Cm CACompromise ,
382.Cm affiliationChanged ,
383.Cm superseded ,
384.Cm cessationOfOperation ,
385.Cm certificateHold ,
386.Cm privilegeWithdrawn ,
387and
388.Cm AACompromise .
389.Pp
390Simple examples:
391.Bd -literal -offset indent
392crlDistributionPoints=URI:http://myhost.com/myca.crl
393crlDistributionPoints=URI:http://my.com/my.crl,URI:http://oth.com/my.crl
394.Ed
395.Pp
396Full distribution point example:
397.Bd -literal -offset indent
398crlDistributionPoints=crldp1_section
399
400[crldp1_section]
401fullname=URI:http://myhost.com/myca.crl
402CRLissuer=dirName:issuer_sect
403reasons=keyCompromise, CACompromise
404
405[issuer_sect]
406C=UK
407O=Organisation
408CN=Some Name
409.Ed
410.Ss Issuing distribution point
411This extension should only appear in CRLs.
412It is a multi-valued extension whose syntax is similar to the "section"
413pointed to by the CRL distribution points extension with a few
414differences.
415.Pp
416The names
417.Ic reasons
418and
419.Ic CRLissuer
420are not recognized.
421.Pp
422The name
423.Ic onlysomereasons
424is accepted which sets this field.
425The value is in the same format as the CRL distribution point
426.Ic reasons
427field.
428.Pp
429The names
430.Ic onlyuser ,
431.Ic onlyCA ,
432.Ic onlyAA ,
433and
434.Ic indirectCRL
435are also accepted.
436The values should be a boolean values
437.Cm ( TRUE
438or
439.Cm FALSE )
440to indicate the value of the corresponding field.
441Example:
442.Bd -literal -offset indent
443issuingDistributionPoint=critical, @idp_section
444
445[idp_section]
446fullname=URI:http://myhost.com/myca.crl
447indirectCRL=TRUE
448onlysomereasons=keyCompromise, CACompromise
449
450[issuer_sect]
451C=UK
452O=Organisation
453CN=Some Name
454.Ed
455.Ss Certificate policies
456This is a raw extension.
457All the fields of this extension can be set by using the appropriate
458syntax.
459.Pp
460If you follow the PKIX recommendations and just using one OID, then you
461just include the value of that OID.
462Multiple OIDs can be set separated by commas, for example:
463.Pp
464.Dl certificatePolicies= 1.2.4.5, 1.1.3.4
465.Pp
466If you wish to include qualifiers, then the policy OID and qualifiers
467need to be specified in a separate section: this is done by using the
468.Pf @ Ar section
469syntax instead of a literal OID value.
470.Pp
471The section referred to must include the policy OID using the name
472.Ic policyIdentifier .
473.Ic CPSuri
474qualifiers can be included using the syntax:
475.Pp
476.D1 Ic CPS . Ns Ar nnn Ns = Ns Ar value
477.Pp
478.Ic userNotice
479qualifiers can be set using the syntax:
480.Pp
481.D1 Ic userNotice . Ns Ar nnn Ns =@ Ns Ar notice
482.Pp
483The value of the
484.Ic userNotice
485qualifier is specified in the relevant section.
486This section can include
487.Ic explicitText ,
488.Ic organization ,
489and
490.Ic noticeNumbers
491options.
492.Ic explicitText
493and
494.Ic organization
495are text strings,
496.Ic noticeNumbers
497is a comma separated list of numbers.
498The
499.Ic organization
500and
501.Ic noticeNumbers
502options (if included) must
503.Em both
504be present.
505If you use the
506.Ic userNotice
507option with IE5 then you need the
508.Ic ia5org
509option at the top level to modify the encoding: otherwise it will
510not be interpreted properly.
511Example:
512.Bd -literal -offset indent
513certificatePolicies=ia5org,1.2.3.4,1.5.6.7.8,@polsect
514
515[polsect]
516policyIdentifier = 1.3.5.8
517CPS.1="http://my.host.name/"
518CPS.2="http://my.your.name/"
519userNotice.1=@notice
520
521[notice]
522explicitText="Explicit Text Here"
523organization="Organisation Name"
524noticeNumbers=1,2,3,4
525.Ed
526.Pp
527The
528.Ic ia5org
529option changes the type of the
530.Ic organization
531field.
532In RFC 2459, it can only be of type DisplayText.
533In RFC 3280, IA5Strring is also permissible.
534Some software (for example some versions of MSIE) may require
535.Ic ia5org .
536.Ss Policy constraints
537This is a multi-valued extension which consists of the names
538.Ic requireExplicitPolicy
539or
540.Ic inhibitPolicyMapping
541and a non-negative integer value.
542At least one component must be present.
543Example:
544.Pp
545.Dl policyConstraints = requireExplicitPolicy:3
546.Ss Inhibit any policy
547This is a string extension whose value must be a non-negative integer.
548Example:
549.Pp
550.Dl inhibitAnyPolicy = 2
551.Ss Name constraints
552The name constraints extension is a multi-valued extension.
553The name should begin with the word
554.Cm permitted
555or
556.Cm excluded
557followed by a semicolon.
558The rest of the name and the value follows the syntax of subjectAltName
559except
560.Ic email : Ns Cm copy
561is not supported and the
562.Ic IP
563form should consist of an IP addresses and subnet mask separated
564by a slash.
565Examples:
566.Bd -literal -offset indent
567nameConstraints=permitted;IP:192.168.0.0/255.255.0.0
568nameConstraints=permitted;email:.somedomain.com
569nameConstraints=excluded;email:.com
570.Ed
571.Ss OCSP no check
572The OCSP no check extension is a string extension,
573but its value is ignored.
574Example:
575.Pp
576.Dl noCheck = ignored
577.Ss TLS Feature (aka must staple)
578This is a multi-valued extension consisting of a list of TLS extension
579identifiers.
580Each identifier may be a number in the range from 0 to 65535 or a
581supported name.
582When a TLS client sends a listed extension, the TLS server is expected
583to include that extension in its reply.
584.Pp
585The supported names are:
586.Cm status_request
587and
588.Cm status_request_v2 .
589Example:
590.Pp
591.Dl tlsfeature = status_request
592.Sh DEPRECATED EXTENSIONS
593The following extensions are non standard, Netscape specific and largely
594obsolete.
595Their use in new applications is discouraged.
596.Ss Netscape string extensions
597Netscape comment
598.Ic ( nsComment )
599is a string extension containing a comment which will be displayed when
600the certificate is viewed in some browsers.
601Example:
602.Pp
603.Dl nsComment = "Some Random Comment"
604.Pp
605Other supported extensions in this category are:
606.Ic nsBaseUrl ,
607.Ic nsRevocationUrl ,
608.Ic nsCaRevocationUrl ,
609.Ic nsRenewalUrl ,
610.Ic nsCaPolicyUrl ,
611and
612.Ic nsSslServerName .
613.Ss Netscape certificate type
614This is a multi-valued extensions which consists of a list of flags to
615be included.
616It was used to indicate the purposes for which a certificate could be
617used.
618The
619.Ic basicConstraints ,
620.Ic keyUsage ,
621and extended key usage extensions are now used instead.
622.Pp
623Acceptable values for
624.Ic nsCertType
625are:
626.Cm client ,
627.Cm server ,
628.Cm email ,
629.Cm objsign ,
630.Cm reserved ,
631.Cm sslCA ,
632.Cm emailCA ,
633.Cm objCA .
634.Sh ARBITRARY EXTENSIONS
635If an extension is not supported by the OpenSSL code, then it must
636be encoded using the arbitrary extension format.
637It is also possible to use the arbitrary format for supported
638extensions.
639Extreme care should be taken to ensure that the data is formatted
640correctly for the given extension type.
641.Pp
642There are two ways to encode arbitrary extensions.
643.Pp
644The first way is to use the word
645.Cm ASN1
646followed by the extension content using the same syntax as
647.Xr ASN1_generate_nconf 3 .
648For example:
649.Bd -literal -offset indent
6501.2.3.4=critical,ASN1:UTF8String:Some random data
6511.2.3.4=ASN1:SEQUENCE:seq_sect
652
653[seq_sect]
654field1 = UTF8:field1
655field2 = UTF8:field2
656.Ed
657.Pp
658It is also possible to use the word
659.Cm DER
660to include the raw encoded data in any extension.
661.Bd -literal -offset indent
6621.2.3.4=critical,DER:01:02:03:04
6631.2.3.4=DER:01020304
664.Ed
665.Pp
666The value following
667.Cm DER
668is a hex dump of the DER encoding of the extension.
669Any extension can be placed in this form to override the default behaviour.
670For example:
671.Pp
672.Dl basicConstraints=critical,DER:00:01:02:03
673.Sh FILES
674.Bl -tag -width /etc/ssl/x509v3.cnf -compact
675.It Pa /etc/ssl/x509v3.cnf
676standard configuration file
677.El
678.Sh SEE ALSO
679.Xr openssl 1 ,
680.Xr ASN1_generate_nconf 3 ,
681.Xr openssl.cnf 5
682.Sh HISTORY
683X509v3 extension code was first added to OpenSSL 0.9.2.
684.Sh CAVEATS
685There is no guarantee that a specific implementation will process a
686given extension.
687It may therefore sometimes be possible to use certificates for purposes
688prohibited by their extensions because a specific application does not
689recognize or honour the values of the relevant extensions.
690.Pp
691The
692.Cm DER
693and
694.Cm ASN1
695options should be used with caution.
696It is possible to create totally invalid extensions if they are not used
697carefully.
698.Pp
699If an extension is multi-value and a field value must contain a comma,
700the long form must be used.
701Otherwise the comma would be misinterpreted as a field separator.
702For example,
703.Pp
704.Dl subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar
705.Pp
706will produce an error, but the following form is valid:
707.Bd -literal -offset indent
708subjectAltName=@subject_alt_section
709
710[subject_alt_section]
711subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar
712.Ed
713.Pp
714Due to the behaviour of the OpenSSL CONF library, the same field
715name can only occur once in a section.
716That means that
717.Bd -literal -offset indent
718subjectAltName=@alt_section
719
720[alt_section]
721email=steve@here
722email=steve@there
723.Ed
724.Pp
725will only use the last value.
726This can be worked around by using the form:
727.Bd -literal -offset indent
728[alt_section]
729email.1=steve@here
730email.2=steve@there
731.Ed