Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
Standard preamble:
========================================================================
..
.... Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.
If the F register is turned on, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.
Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================
Title "CONFIG 5"
way too many mistakes in technical documents.
A configuration file is divided into a number of sections. Each section starts with a line [ section_name ] and ends when a new section is started or end of file is reached. A section name can consist of alphanumeric characters and underscores.
The first section of a configuration file is special and is referred to as the default section this is usually unnamed and is from the start of file until the first named section. When a name is being looked up it is first looked up in a named section (if any) and then the default section.
The environment is mapped onto a section called \s-1ENV\s0.
Comments can be included by preceding them with the # character
Each section in a configuration file consists of a number of name and value pairs of the form name=value
The name string can contain any alphanumeric characters as well as a few punctuation symbols such as . , ; and _.
The value string consists of the string following the = character until end of line with any leading and trailing white space removed.
The value string undergoes variable expansion. This can be done by including the form \f(CB$var or ${var}: this will substitute the value of the named variable in the current section. It is also possible to substitute a value from another section using the syntax \f(CB$section::name or ${section::name}. By using the form \f(CB$ENV::name environment variables can be substituted. It is also possible to assign values to environment variables by using the name ENV::name, this will work if the program looks up environment variables using the \s-1CONF\s0 library instead of calling \f(BIgetenv() directly.
It is possible to escape certain characters by using any kind of quote or the \e character. By making the last character of a line a \e a value string can be spread across multiple lines. In addition the sequences \en, \er, \eb and \et are recognized.
To enable library configuration the default section needs to contain an appropriate line which points to the main configuration section. The default name is openssl_conf which is used by the openssl utility. Other applications may use an alternative name such as myapplicaton_conf.
The configuration section should consist of a set of name value pairs which contain specific module configuration information. The name represents the name of the configuration module the meaning of the value is module specific: it may, for example, represent a further configuration section containing configuration module specific information. E.g.
.Vb 1 openssl_conf = openssl_init \& [openssl_init] \& oid_section = new_oids engines = engine_section \& [new_oids] \& ... new oids here ... \& [engine_section] \& ... engine stuff here ... .Ve
The features of each configuration module are described below.
.Vb 1 [new_oids] \& some_new_oid = 1.2.3.4 some_other_oid = 1.2.3.5 .Ve
In OpenSSL 0.9.8 it is also possible to set the value to the long name followed by a comma and the numerical \s-1OID\s0 form. For example:
.Vb 1 shortName = some object long name, 1.2.3.4 .Ve
The section pointed to by engines is a table of engine names (though see \fBengine_id below) and further sections containing configuration information specific to each \s-1ENGINE.\s0
Each \s-1ENGINE\s0 specific section is used to set default algorithms, load dynamic, perform initialization and send ctrls. The actual operation performed depends on the command name which is the name of the name value pair. The currently supported commands are listed below.
For example:
.Vb 1 [engine_section] \& # Configure ENGINE named "foo" foo = foo_section # Configure ENGINE named "bar" bar = bar_section \& [foo_section] ... foo ENGINE specific commands ... \& [bar_section] ... "bar" ENGINE specific commands ... .Ve
The command engine_id is used to give the \s-1ENGINE\s0 name. If used this command must be first. For example:
.Vb 3 [engine_section] # This would normally handle an ENGINE named "foo" foo = foo_section \& [foo_section] # Override default name and use "myfoo" instead. engine_id = myfoo .Ve
The command dynamic_path loads and adds an \s-1ENGINE\s0 from the given path. It is equivalent to sending the ctrls \s-1SO_PATH\s0 with the path argument followed by \s-1LIST_ADD\s0 with value 2 and \s-1LOAD\s0 to the dynamic \s-1ENGINE.\s0 If this is not the required behaviour then alternative ctrls can be sent directly to the dynamic \s-1ENGINE\s0 using ctrl commands.
The command init determines whether to initialize the \s-1ENGINE.\s0 If the value is 0 the \s-1ENGINE\s0 will not be initialized, if 1 and attempt it made to initialized the \s-1ENGINE\s0 immediately. If the init command is not present then an attempt will be made to initialize the \s-1ENGINE\s0 after all commands in its section have been processed.
The command default_algorithms sets the default algorithms an \s-1ENGINE\s0 will supply using the functions \f(BIENGINE_set_default_string()
If the name matches none of the above command names it is assumed to be a ctrl command which is sent to the \s-1ENGINE.\s0 The value of the command is the argument to the ctrl command. If the value is the string \s-1EMPTY\s0 then no value is sent to the command.
For example:
.Vb 1 [engine_section] \& # Configure ENGINE named "foo" foo = foo_section \& [foo_section] # Load engine from DSO dynamic_path = /some/path/fooengine.so # A foo specific ctrl. some_ctrl = some_value # Another ctrl that doesn\*(Aqt take a value. other_ctrl = EMPTY # Supply all default algorithms default_algorithms = ALL .Ve
Currently the only algorithm command supported is fips_mode whose value should be a boolean string such as on or off. If the value is \fBon this attempt to enter \s-1FIPS\s0 mode. If the call fails or the library is not \s-1FIPS\s0 capable then an error occurs.
For example:
.Vb 1 alg_section = evp_settings \& [evp_settings] \& fips_mode = on .Ve
This can be worked around by including a default section to provide a default value: then if the environment lookup fails the default value will be used instead. For this to work properly the default value must be defined earlier in the configuration file than the expansion. See the \s-1EXAMPLES\s0 section for an example of how to do this.
If the same variable exists in the same section then all but the last value will be silently ignored. In certain circumstances such as with DNs the same field may occur multiple times. This is usually worked around by ignoring any characters before an initial . e.g.
.Vb 2 1.OU="My first OU" 2.OU="My Second OU" .Ve
.Vb 1 # This is the default section. \& HOME=/temp RANDFILE= ${ENV::HOME}/.rnd configdir=$ENV::HOME/config \& [ section_one ] \& # We are now in section one. \& # Quotes permit leading and trailing whitespace any = " any variable name " \& other = A string that can \e cover several lines \e by including \e\e characters \& message = Hello World\en \& [ section_two ] \& greeting = $section_one::message .Ve
This next example shows how to expand environment variables safely.
Suppose you want a variable called tmpfile to refer to a temporary filename. The directory it is placed in can determined by the the \s-1TEMP\s0 or \s-1TMP\s0 environment variables but they may not be set to any value at all. If you just include the environment variable names and the variable doesn't exist then this will cause an error when an attempt is made to load the configuration file. By making use of the default section both values can be looked up with \s-1TEMP\s0 taking priority and /tmp used if neither is defined:
.Vb 5 TMP=/tmp # The above value is used if TMP isn\*(Aqt in the environment TEMP=$ENV::TMP # The above value is used if TEMP isn\*(Aqt in the environment tmpfile=${ENV::TEMP}/tmp.filename .Ve
Simple OpenSSL library configuration example to enter \s-1FIPS\s0 mode:
.Vb 3 # Default appname: should match "appname" parameter (if any) # supplied to CONF_modules_load_file et al. openssl_conf = openssl_conf_section \& [openssl_conf_section] # Configuration module list alg_section = evp_sect \& [evp_sect] # Set to "yes" to enter FIPS mode if supported fips_mode = yes .Ve
Note: in the above example you will get an error in non \s-1FIPS\s0 capable versions of OpenSSL.
More complex OpenSSL library configuration. Add \s-1OID\s0 and don't enter \s-1FIPS\s0 mode:
.Vb 3 # Default appname: should match "appname" parameter (if any) # supplied to CONF_modules_load_file et al. openssl_conf = openssl_conf_section \& [openssl_conf_section] # Configuration module list alg_section = evp_sect oid_section = new_oids \& [evp_sect] # This will have no effect as FIPS mode is off by default. # Set to "yes" to enter FIPS mode, if supported fips_mode = no \& [new_oids] # New OID, just short name newoid1 = 1.2.3.4.1 # New OID shortname and long name newoid2 = New OID 2 long name, 1.2.3.4.2 .Ve
The above examples can be used with with any application supporting library configuration if \*(L"openssl_conf\*(R" is modified to match the appropriate \*(L"appname\*(R".
For example if the second sample file above is saved to \*(L"example.cnf\*(R" then the command line:
.Vb 1 OPENSSL_CONF=example.cnf openssl asn1parse -genstr OID:1.2.3.4.1 .Ve
will output:
.Vb 1 0:d=0 hl=2 l= 4 prim: OBJECT :newoid1 .Ve
showing that the \s-1OID \s0\*(L"newoid1\*(R" has been added as \*(L"1.2.3.4.1\*(R".
The escaping isn't quite right: if you want to use sequences like \en you can't use any quote escaping on the same line.
Files are loaded in a single pass. This means that an variable expansion will only work if the variables referenced are defined earlier in the file.