Merge branch 'vendor/OPENSSL'
[dragonfly.git] / secure / usr.bin / openssl / man / config.5
CommitLineData
e257b235 1.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
984263bc
MD
2.\"
3.\" Standard preamble:
a561f9ff 4.\" ========================================================================
984263bc
MD
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
984263bc
MD
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
984263bc
MD
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
e257b235
PA
28.\" double quote, and \*(R" will give a right double quote. \*(C+ will
29.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
30.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
31.\" nothing in troff, for use with C<>.
32.tr \(*W-
984263bc
MD
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
e257b235
PA
51.\" Escape single quotes in literal strings from groff's Unicode transform.
52.ie \n(.g .ds Aq \(aq
53.el .ds Aq '
54.\"
a561f9ff
SS
55.\" If the F register is turned on, we'll generate index entries on stderr for
56.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
57.\" entries marked with X<> in POD. Of course, you'll have to process the
58.\" output yourself in some meaningful fashion.
e257b235 59.ie \nF \{\
984263bc
MD
60. de IX
61. tm Index:\\$1\t\\n%\t"\\$2"
62..
63. nr % 0
64. rr F
65.\}
e257b235
PA
66.el \{\
67. de IX
68..
69.\}
aac4ff6f 70.\"
984263bc
MD
71.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
72.\" Fear. Run. Save yourself. No user-serviceable parts.
984263bc
MD
73. \" fudge factors for nroff and troff
74.if n \{\
75. ds #H 0
76. ds #V .8m
77. ds #F .3m
78. ds #[ \f1
79. ds #] \fP
80.\}
81.if t \{\
82. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
83. ds #V .6m
84. ds #F 0
85. ds #[ \&
86. ds #] \&
87.\}
88. \" simple accents for nroff and troff
89.if n \{\
90. ds ' \&
91. ds ` \&
92. ds ^ \&
93. ds , \&
94. ds ~ ~
95. ds /
96.\}
97.if t \{\
98. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
99. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
100. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
101. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
102. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
103. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
104.\}
105. \" troff and (daisy-wheel) nroff accents
106.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
107.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
108.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
109.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
110.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
111.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
112.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
113.ds ae a\h'-(\w'a'u*4/10)'e
114.ds Ae A\h'-(\w'A'u*4/10)'E
115. \" corrections for vroff
116.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
117.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
118. \" for low resolution devices (crt and lpr)
119.if \n(.H>23 .if \n(.V>19 \
120\{\
121. ds : e
122. ds 8 ss
123. ds o a
124. ds d- d\h'-1'\(ga
125. ds D- D\h'-1'\(hy
126. ds th \o'bp'
127. ds Th \o'LP'
128. ds ae ae
129. ds Ae AE
130.\}
131.rm #[ #] #H #V #F C
a561f9ff 132.\" ========================================================================
984263bc 133.\"
a561f9ff 134.IX Title "CONFIG 5"
fc468453 135.TH CONFIG 5 "2010-02-27" "0.9.8m" "OpenSSL"
e257b235
PA
136.\" For nroff, turn off justification. Always turn off hyphenation; it makes
137.\" way too many mistakes in technical documents.
138.if n .ad l
139.nh
984263bc 140.SH "NAME"
a561f9ff 141config \- OpenSSL CONF library configuration files
984263bc
MD
142.SH "DESCRIPTION"
143.IX Header "DESCRIPTION"
144The OpenSSL \s-1CONF\s0 library can be used to read configuration files.
145It is used for the OpenSSL master configuration file \fBopenssl.cnf\fR
146and in a few other places like \fB\s-1SPKAC\s0\fR files and certificate extension
a561f9ff
SS
147files for the \fBx509\fR utility. OpenSSL applications can also use the
148\&\s-1CONF\s0 library for their own purposes.
984263bc
MD
149.PP
150A configuration file is divided into a number of sections. Each section
151starts with a line \fB[ section_name ]\fR and ends when a new section is
152started or end of file is reached. A section name can consist of
153alphanumeric characters and underscores.
154.PP
155The first section of a configuration file is special and is referred
156to as the \fBdefault\fR section this is usually unnamed and is from the
157start of file until the first named section. When a name is being looked up
158it is first looked up in a named section (if any) and then the
159default section.
160.PP
161The environment is mapped onto a section called \fB\s-1ENV\s0\fR.
162.PP
163Comments can be included by preceding them with the \fB#\fR character
164.PP
165Each section in a configuration file consists of a number of name and
166value pairs of the form \fBname=value\fR
167.PP
168The \fBname\fR string can contain any alphanumeric characters as well as
169a few punctuation symbols such as \fB.\fR \fB,\fR \fB;\fR and \fB_\fR.
170.PP
171The \fBvalue\fR string consists of the string following the \fB=\fR character
172until end of line with any leading and trailing white space removed.
173.PP
174The value string undergoes variable expansion. This can be done by
e257b235 175including the form \fB\f(CB$var\fB\fR or \fB${var}\fR: this will substitute the value
984263bc 176of the named variable in the current section. It is also possible to
e257b235
PA
177substitute a value from another section using the syntax \fB\f(CB$section::name\fB\fR
178or \fB${section::name}\fR. By using the form \fB\f(CB$ENV::name\fB\fR environment
984263bc 179variables can be substituted. It is also possible to assign values to
a561f9ff 180environment variables by using the name \fBENV::name\fR, this will work
984263bc
MD
181if the program looks up environment variables using the \fB\s-1CONF\s0\fR library
182instead of calling \fB\f(BIgetenv()\fB\fR directly.
183.PP
184It is possible to escape certain characters by using any kind of quote
185or the \fB\e\fR character. By making the last character of a line a \fB\e\fR
186a \fBvalue\fR string can be spread across multiple lines. In addition
187the sequences \fB\en\fR, \fB\er\fR, \fB\eb\fR and \fB\et\fR are recognized.
a561f9ff
SS
188.SH "OPENSSL LIBRARY CONFIGURATION"
189.IX Header "OPENSSL LIBRARY CONFIGURATION"
190In OpenSSL 0.9.7 and later applications can automatically configure certain
191aspects of OpenSSL using the master OpenSSL configuration file, or optionally
192an alternative configuration file. The \fBopenssl\fR utility includes this
193functionality: any sub command uses the master OpenSSL configuration file
194unless an option is used in the sub command to use an alternative configuration
195file.
196.PP
197To enable library configuration the default section needs to contain an
198appropriate line which points to the main configuration section. The default
199name is \fBopenssl_conf\fR which is used by the \fBopenssl\fR utility. Other
200applications may use an alternative name such as \fBmyapplicaton_conf\fR.
201.PP
202The configuration section should consist of a set of name value pairs which
203contain specific module configuration information. The \fBname\fR represents
204the name of the \fIconfiguration module\fR the meaning of the \fBvalue\fR is
205module specific: it may, for example, represent a further configuration
206section containing configuration module specific information. E.g.
207.PP
208.Vb 1
209\& openssl_conf = openssl_init
e257b235 210\&
a561f9ff 211\& [openssl_init]
e257b235 212\&
a561f9ff
SS
213\& oid_section = new_oids
214\& engines = engine_section
e257b235 215\&
a561f9ff 216\& [new_oids]
e257b235 217\&
a561f9ff 218\& ... new oids here ...
e257b235 219\&
a561f9ff 220\& [engine_section]
e257b235 221\&
a561f9ff
SS
222\& ... engine stuff here ...
223.Ve
224.PP
225Currently there are two configuration modules. One for \s-1ASN1\s0 objects another
226for \s-1ENGINE\s0 configuration.
227.Sh "\s-1ASN1\s0 \s-1OBJECT\s0 \s-1CONFIGURATION\s0 \s-1MODULE\s0"
228.IX Subsection "ASN1 OBJECT CONFIGURATION MODULE"
229This module has the name \fBoid_section\fR. The value of this variable points
230to a section containing name value pairs of OIDs: the name is the \s-1OID\s0 short
231and long name, the value is the numerical form of the \s-1OID\s0. Although some of
232the \fBopenssl\fR utility sub commands already have their own \s-1ASN1\s0 \s-1OBJECT\s0 section
233functionality not all do. By using the \s-1ASN1\s0 \s-1OBJECT\s0 configuration module
234\&\fBall\fR the \fBopenssl\fR utility sub commands can see the new objects as well
235as any compliant applications. For example:
236.PP
237.Vb 1
238\& [new_oids]
e257b235 239\&
a561f9ff
SS
240\& some_new_oid = 1.2.3.4
241\& some_other_oid = 1.2.3.5
242.Ve
243.PP
244In OpenSSL 0.9.8 it is also possible to set the value to the long name followed
245by a comma and the numerical \s-1OID\s0 form. For example:
246.PP
247.Vb 1
248\& shortName = some object long name, 1.2.3.4
249.Ve
250.Sh "\s-1ENGINE\s0 \s-1CONFIGURATION\s0 \s-1MODULE\s0"
251.IX Subsection "ENGINE CONFIGURATION MODULE"
252This \s-1ENGINE\s0 configuration module has the name \fBengines\fR. The value of this
253variable points to a section containing further \s-1ENGINE\s0 configuration
254information.
255.PP
256The section pointed to by \fBengines\fR is a table of engine names (though see
257\&\fBengine_id\fR below) and further sections containing configuration informations
258specific to each \s-1ENGINE\s0.
259.PP
260Each \s-1ENGINE\s0 specific section is used to set default algorithms, load
261dynamic, perform initialization and send ctrls. The actual operation performed
262depends on the \fIcommand\fR name which is the name of the name value pair. The
263currently supported commands are listed below.
264.PP
265For example:
266.PP
267.Vb 1
268\& [engine_section]
e257b235 269\&
a561f9ff
SS
270\& # Configure ENGINE named "foo"
271\& foo = foo_section
272\& # Configure ENGINE named "bar"
273\& bar = bar_section
e257b235 274\&
a561f9ff
SS
275\& [foo_section]
276\& ... foo ENGINE specific commands ...
e257b235 277\&
a561f9ff
SS
278\& [bar_section]
279\& ... "bar" ENGINE specific commands ...
280.Ve
281.PP
282The command \fBengine_id\fR is used to give the \s-1ENGINE\s0 name. If used this
283command must be first. For example:
284.PP
285.Vb 3
286\& [engine_section]
287\& # This would normally handle an ENGINE named "foo"
288\& foo = foo_section
e257b235 289\&
a561f9ff
SS
290\& [foo_section]
291\& # Override default name and use "myfoo" instead.
292\& engine_id = myfoo
293.Ve
294.PP
295The command \fBdynamic_path\fR loads and adds an \s-1ENGINE\s0 from the given path. It
296is equivalent to sending the ctrls \fB\s-1SO_PATH\s0\fR with the path argument followed
297by \fB\s-1LIST_ADD\s0\fR with value 2 and \fB\s-1LOAD\s0\fR to the dynamic \s-1ENGINE\s0. If this is
298not the required behaviour then alternative ctrls can be sent directly
299to the dynamic \s-1ENGINE\s0 using ctrl commands.
300.PP
301The command \fBinit\fR determines whether to initialize the \s-1ENGINE\s0. If the value
302is \fB0\fR the \s-1ENGINE\s0 will not be initialized, if \fB1\fR and attempt it made to
303initialized the \s-1ENGINE\s0 immediately. If the \fBinit\fR command is not present
304then an attempt will be made to initialize the \s-1ENGINE\s0 after all commands in
305its section have been processed.
306.PP
307The command \fBdefault_algorithms\fR sets the default algorithms an \s-1ENGINE\s0 will
308supply using the functions \fB\f(BIENGINE_set_default_string()\fB\fR
309.PP
310If the name matches none of the above command names it is assumed to be a
311ctrl command which is sent to the \s-1ENGINE\s0. The value of the command is the
312argument to the ctrl command. If the value is the string \fB\s-1EMPTY\s0\fR then no
313value is sent to the command.
314.PP
315For example:
316.PP
317.Vb 1
318\& [engine_section]
e257b235 319\&
a561f9ff
SS
320\& # Configure ENGINE named "foo"
321\& foo = foo_section
e257b235 322\&
a561f9ff
SS
323\& [foo_section]
324\& # Load engine from DSO
325\& dynamic_path = /some/path/fooengine.so
326\& # A foo specific ctrl.
327\& some_ctrl = some_value
e257b235 328\& # Another ctrl that doesn\*(Aqt take a value.
a561f9ff
SS
329\& other_ctrl = EMPTY
330\& # Supply all default algorithms
331\& default_algorithms = ALL
332.Ve
984263bc
MD
333.SH "NOTES"
334.IX Header "NOTES"
335If a configuration file attempts to expand a variable that doesn't exist
336then an error is flagged and the file will not load. This can happen
337if an attempt is made to expand an environment variable that doesn't
a561f9ff
SS
338exist. For example in a previous version of OpenSSL the default OpenSSL
339master configuration file used the value of \fB\s-1HOME\s0\fR which may not be
340defined on non Unix systems and would cause an error.
984263bc
MD
341.PP
342This can be worked around by including a \fBdefault\fR section to provide
343a default value: then if the environment lookup fails the default value
344will be used instead. For this to work properly the default value must
345be defined earlier in the configuration file than the expansion. See
346the \fB\s-1EXAMPLES\s0\fR section for an example of how to do this.
347.PP
348If the same variable exists in the same section then all but the last
349value will be silently ignored. In certain circumstances such as with
350DNs the same field may occur multiple times. This is usually worked
351around by ignoring any characters before an initial \fB.\fR e.g.
352.PP
353.Vb 2
354\& 1.OU="My first OU"
355\& 2.OU="My Second OU"
356.Ve
357.SH "EXAMPLES"
358.IX Header "EXAMPLES"
359Here is a sample configuration file using some of the features
360mentioned above.
361.PP
362.Vb 1
363\& # This is the default section.
e257b235 364\&
984263bc
MD
365\& HOME=/temp
366\& RANDFILE= ${ENV::HOME}/.rnd
367\& configdir=$ENV::HOME/config
e257b235 368\&
984263bc 369\& [ section_one ]
e257b235 370\&
984263bc 371\& # We are now in section one.
e257b235 372\&
984263bc
MD
373\& # Quotes permit leading and trailing whitespace
374\& any = " any variable name "
e257b235 375\&
984263bc
MD
376\& other = A string that can \e
377\& cover several lines \e
378\& by including \e\e characters
e257b235 379\&
984263bc 380\& message = Hello World\en
e257b235 381\&
984263bc 382\& [ section_two ]
e257b235 383\&
984263bc
MD
384\& greeting = $section_one::message
385.Ve
a561f9ff 386.PP
984263bc
MD
387This next example shows how to expand environment variables safely.
388.PP
389Suppose you want a variable called \fBtmpfile\fR to refer to a
390temporary filename. The directory it is placed in can determined by
391the the \fB\s-1TEMP\s0\fR or \fB\s-1TMP\s0\fR environment variables but they may not be
392set to any value at all. If you just include the environment variable
393names and the variable doesn't exist then this will cause an error when
394an attempt is made to load the configuration file. By making use of the
395default section both values can be looked up with \fB\s-1TEMP\s0\fR taking
396priority and \fB/tmp\fR used if neither is defined:
397.PP
398.Vb 5
399\& TMP=/tmp
e257b235 400\& # The above value is used if TMP isn\*(Aqt in the environment
984263bc 401\& TEMP=$ENV::TMP
e257b235 402\& # The above value is used if TEMP isn\*(Aqt in the environment
984263bc
MD
403\& tmpfile=${ENV::TEMP}/tmp.filename
404.Ve
405.SH "BUGS"
406.IX Header "BUGS"
407Currently there is no way to include characters using the octal \fB\ennn\fR
408form. Strings are all null terminated so nulls cannot form part of
409the value.
410.PP
411The escaping isn't quite right: if you want to use sequences like \fB\en\fR
412you can't use any quote escaping on the same line.
413.PP
414Files are loaded in a single pass. This means that an variable expansion
415will only work if the variables referenced are defined earlier in the
416file.
417.SH "SEE ALSO"
418.IX Header "SEE ALSO"
a561f9ff 419\&\fIx509\fR\|(1), \fIreq\fR\|(1), \fIca\fR\|(1)