1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk Kimconfig - OpenSSL CONF library configuration files 6e71b7053SJung-uk Kim 7e71b7053SJung-uk Kim=head1 DESCRIPTION 8e71b7053SJung-uk Kim 9b077aed3SPierre ProncheryThis page documents the syntax of OpenSSL configuration files, 10b077aed3SPierre Proncheryas parsed by L<NCONF_load(3)> and related functions. 11b077aed3SPierre ProncheryThis format is used by many of the OpenSSL commands, and to 12b077aed3SPierre Proncheryinitialize the libraries when used by any application. 13e71b7053SJung-uk Kim 14b077aed3SPierre ProncheryThe first part describes the general syntax of the configuration 15b077aed3SPierre Proncheryfiles, and subsequent sections describe the semantics of individual 16b077aed3SPierre Proncherymodules. Other modules are described in L<fips_config(5)> and 17b077aed3SPierre ProncheryL<x509v3_config(5)>. 18b077aed3SPierre ProncheryThe syntax for defining ASN.1 values is described in 19b077aed3SPierre ProncheryL<ASN1_generate_nconf(3)>. 20e71b7053SJung-uk Kim 21b077aed3SPierre Pronchery=head1 SYNTAX 22b077aed3SPierre Pronchery 23b077aed3SPierre ProncheryA configuration file is a series of lines. Blank lines, and whitespace 24b077aed3SPierre Proncherybetween the elements of a line, have no significance. A comment starts 25b077aed3SPierre Proncherywith a B<#> character; the rest of the line is ignored. If the B<#> 26b077aed3SPierre Proncheryis the first non-space character in a line, the entire line is ignored. 27b077aed3SPierre Pronchery 28b077aed3SPierre Pronchery=head2 Directives 29b077aed3SPierre Pronchery 30b077aed3SPierre ProncheryTwo directives can be used to control the parsing of configuration files: 31b077aed3SPierre ProncheryB<.include> and B<.pragma>. 32b077aed3SPierre Pronchery 33b077aed3SPierre ProncheryFor compatibility with older versions of OpenSSL, an equal sign after the 34b077aed3SPierre Proncherydirective will be ignored. Older versions will treat it as an assignment, 35b077aed3SPierre Proncheryso care should be taken if the difference in semantics is important. 36b077aed3SPierre Pronchery 37b077aed3SPierre ProncheryA file can include other files using the include syntax: 38b077aed3SPierre Pronchery 39b077aed3SPierre Pronchery .include [=] pathname 40b077aed3SPierre Pronchery 41b077aed3SPierre ProncheryIf B<pathname> is a simple filename, that file is included directly at 42b077aed3SPierre Proncherythat point. Included files can have B<.include> statements that specify 43b077aed3SPierre Proncheryother files. If B<pathname> is a directory, all files within that directory 44b077aed3SPierre Proncherythat have a C<.cnf> or C<.conf> extension will be included. (This is only 45b077aed3SPierre Proncheryavailable on systems with POSIX IO support.) Any sub-directories found 46b077aed3SPierre Proncheryinside the B<pathname> are B<ignored>. Similarly, if a file is opened 47b077aed3SPierre Proncherywhile scanning a directory, and that file has an B<.include> directive 48b077aed3SPierre Proncherythat specifies a directory, that is also ignored. 49b077aed3SPierre Pronchery 50b077aed3SPierre ProncheryAs a general rule, the B<pathname> should be an absolute path; this can 51b077aed3SPierre Proncherybe enforced with the B<abspath> and B<includedir> pragmas, described below. 52b077aed3SPierre ProncheryThe environment variable B<OPENSSL_CONF_INCLUDE>, if it exists, 53b077aed3SPierre Proncheryis prepended to all relative pathnames. 54b077aed3SPierre ProncheryIf the pathname is still relative, it is interpreted based on the 55b077aed3SPierre Proncherycurrent working directory. 56b077aed3SPierre Pronchery 57b077aed3SPierre ProncheryTo require all file inclusions to name absolute paths, use the following 58b077aed3SPierre Proncherydirective: 59b077aed3SPierre Pronchery 60b077aed3SPierre Pronchery .pragma [=] abspath:value 61b077aed3SPierre Pronchery 62b077aed3SPierre ProncheryThe default behavior, where the B<value> is B<false> or B<off>, is to allow 63b077aed3SPierre Proncheryrelative paths. To require all B<.include> pathnames to be absolute paths, 64b077aed3SPierre Proncheryuse a B<value> of B<true> or B<on>. 65b077aed3SPierre Pronchery 66b077aed3SPierre ProncheryIn these files, the dollar sign, B<$>, is used to reference a variable, as 67b077aed3SPierre Proncherydescribed below. On some platforms, however, it is common to treat B<$> 68b077aed3SPierre Proncheryas a regular character in symbol names. Supporting this behavior can be 69b077aed3SPierre Proncherydone with the following directive: 70b077aed3SPierre Pronchery 71b077aed3SPierre Pronchery .pragma [=] dollarid:value 72b077aed3SPierre Pronchery 73b077aed3SPierre ProncheryThe default behavior, where the B<value> is B<false> or B<off>, is to treat 74b077aed3SPierre Proncherythe dollarsign as indicating a variable name; C<foo$bar> is interpreted as 75b077aed3SPierre ProncheryC<foo> followed by the expansion of the variable C<bar>. If B<value> is 76b077aed3SPierre ProncheryB<true> or B<on>, then C<foo$bar> is a single seven-character name and 77b077aed3SPierre Proncheryvariable expansions must be specified using braces or parentheses. 78b077aed3SPierre Pronchery 79b077aed3SPierre Pronchery .pragma [=] includedir:value 80b077aed3SPierre Pronchery 81b077aed3SPierre ProncheryIf a relative pathname is specified in the B<.include> directive, and 82b077aed3SPierre Proncherythe B<OPENSSL_CONF_INCLUDE> environment variable doesn't exist, then 83b077aed3SPierre Proncherythe value of the B<includedir> pragma, if it exists, is prepended to the 84b077aed3SPierre Proncherypathname. 85b077aed3SPierre Pronchery 86b077aed3SPierre Pronchery=head2 Settings 87b077aed3SPierre Pronchery 88b077aed3SPierre ProncheryA configuration file is divided into a number of I<sections>. A section 89b077aed3SPierre Proncherybegins with the section name in square brackets, and ends when a new 90b077aed3SPierre Proncherysection starts, or at the end of the file. The section name can consist 91b077aed3SPierre Proncheryof alphanumeric characters and underscores. 92b077aed3SPierre ProncheryWhitespace between the name and the brackets is removed. 93b077aed3SPierre Pronchery 94b077aed3SPierre ProncheryThe first section of a configuration file is special and is referred to 95b077aed3SPierre Proncheryas the B<default> section. This section is usually unnamed and spans from 96b077aed3SPierre Proncherythe start of file until the first named section. When a name is being 97b077aed3SPierre Proncherylooked up, it is first looked up in the current or named section, 98b077aed3SPierre Proncheryand then the default section if necessary. 99e71b7053SJung-uk Kim 100e71b7053SJung-uk KimThe environment is mapped onto a section called B<ENV>. 101e71b7053SJung-uk Kim 102b077aed3SPierre ProncheryWithin a section are a series of name/value assignments, described in more 103b077aed3SPierre Proncherydetail below. As a reminder, the square brackets shown in this example 104b077aed3SPierre Proncheryare required, not optional: 105e71b7053SJung-uk Kim 106b077aed3SPierre Pronchery [ section ] 107b077aed3SPierre Pronchery name1 = This is value1 108b077aed3SPierre Pronchery name2 = Another value 109b077aed3SPierre Pronchery ... 110b077aed3SPierre Pronchery [ newsection ] 111b077aed3SPierre Pronchery name1 = New value1 112b077aed3SPierre Pronchery name3 = Value 3 113e71b7053SJung-uk Kim 114b077aed3SPierre ProncheryThe B<name> can contain any alphanumeric characters as well as a few 115b077aed3SPierre Proncherypunctuation symbols such as B<.> B<,> B<;> and B<_>. 116b077aed3SPierre ProncheryWhitespace after the name and before the equal sign is ignored. 117e71b7053SJung-uk Kim 118b077aed3SPierre ProncheryIf a name is repeated in the same section, then all but the last 119b077aed3SPierre Proncheryvalue are ignored. In certain circumstances, such as with 120b077aed3SPierre ProncheryCertificate DNs, the same field may occur multiple times. 121b077aed3SPierre ProncheryIn order to support this, commands like L<openssl-req(1)> ignore any 122b077aed3SPierre Proncheryleading text that is preceded with a period. For example: 1236935a639SJung-uk Kim 124b077aed3SPierre Pronchery 1.OU = First OU 125b077aed3SPierre Pronchery 2.OU = Second OU 126e71b7053SJung-uk Kim 127b077aed3SPierre ProncheryThe B<value> consists of the string following the B<=> character until end 128b077aed3SPierre Proncheryof line with any leading and trailing whitespace removed. 129e71b7053SJung-uk Kim 130b077aed3SPierre ProncheryThe value string undergoes variable expansion. The text C<$var> or C<${var}> 131b077aed3SPierre Proncheryinserts the value of the named variable from the current section. 132b077aed3SPierre ProncheryTo use a value from another section use C<$section::name> 133b077aed3SPierre Proncheryor C<${section::name}>. 134b077aed3SPierre ProncheryBy using C<$ENV::name>, the value of the specified environment 135b077aed3SPierre Proncheryvariable will be substituted. 136e71b7053SJung-uk Kim 137b077aed3SPierre ProncheryVariables must be defined before their value is referenced, otherwise 138b077aed3SPierre Proncheryan error is flagged and the file will not load. 139b077aed3SPierre ProncheryThis can be worked around by specifying a default value in the B<default> 140b077aed3SPierre Proncherysection before the variable is used. 141e71b7053SJung-uk Kim 142b077aed3SPierre ProncheryAny name/value settings in an B<ENV> section are available 143b077aed3SPierre Proncheryto the configuration file, but are not propagated to the environment. 144b077aed3SPierre Pronchery 145b077aed3SPierre ProncheryIt is an error if the value ends up longer than 64k. 146b077aed3SPierre Pronchery 147b077aed3SPierre ProncheryIt is possible to escape certain characters by using a single B<'> or 148b077aed3SPierre Proncherydouble B<"> quote around the value, or using a backslash B<\> before the 149b077aed3SPierre Proncherycharacter, 150b077aed3SPierre ProncheryBy making the last character of a line a B<\> 151e71b7053SJung-uk Kima B<value> string can be spread across multiple lines. In addition 152e71b7053SJung-uk Kimthe sequences B<\n>, B<\r>, B<\b> and B<\t> are recognized. 153e71b7053SJung-uk Kim 154b077aed3SPierre ProncheryThe expansion and escape rules as described above that apply to B<value> 155b077aed3SPierre Proncheryalso apply to the pathname of the B<.include> directive. 156e71b7053SJung-uk Kim 157e71b7053SJung-uk Kim=head1 OPENSSL LIBRARY CONFIGURATION 158e71b7053SJung-uk Kim 159b077aed3SPierre ProncheryThe sections below use the informal term I<module> to refer to a part 160b077aed3SPierre Proncheryof the OpenSSL functionality. This is not the same as the formal term 161b077aed3SPierre ProncheryI<FIPS module>, for example. 162e71b7053SJung-uk Kim 163b077aed3SPierre ProncheryThe OpenSSL configuration looks up the value of B<openssl_conf> 164b077aed3SPierre Proncheryin the default section and takes that as the name of a section that specifies 165b077aed3SPierre Proncheryhow to configure any modules in the library. It is not an error to leave 166b077aed3SPierre Proncheryany module in its default configuration. An application can specify a 167b077aed3SPierre Proncherydifferent name by calling CONF_modules_load_file(), for example, directly. 168e71b7053SJung-uk Kim 169b077aed3SPierre ProncheryOpenSSL also looks up the value of B<config_diagnostics>. 170b077aed3SPierre ProncheryIf this exists and has a nonzero numeric value, any error suppressing flags 171b077aed3SPierre Proncherypassed to CONF_modules_load() will be ignored. 172b077aed3SPierre ProncheryThis is useful for diagnosing misconfigurations but its use in 173b077aed3SPierre Proncheryproduction requires additional consideration. With this option enabled, 174b077aed3SPierre Proncherya configuration error will completely prevent access to a service. 175b077aed3SPierre ProncheryWithout this option and in the presence of a configuration error, access 176b077aed3SPierre Proncherywill be allowed but the desired configuration will B<not> be used. 177e71b7053SJung-uk Kim 178b077aed3SPierre Pronchery # These must be in the default section 179b077aed3SPierre Pronchery config_diagnostics = 1 180e71b7053SJung-uk Kim openssl_conf = openssl_init 181e71b7053SJung-uk Kim 182e71b7053SJung-uk Kim [openssl_init] 183b077aed3SPierre Pronchery oid_section = oids 184b077aed3SPierre Pronchery providers = providers 185b077aed3SPierre Pronchery alg_section = evp_properties 186b077aed3SPierre Pronchery ssl_conf = ssl_configuration 187b077aed3SPierre Pronchery engines = engines 188b077aed3SPierre Pronchery random = random 189e71b7053SJung-uk Kim 190b077aed3SPierre Pronchery [oids] 191e71b7053SJung-uk Kim ... new oids here ... 192e71b7053SJung-uk Kim 193b077aed3SPierre Pronchery [providers] 194b077aed3SPierre Pronchery ... provider stuff here ... 195e71b7053SJung-uk Kim 196b077aed3SPierre Pronchery [evp_properties] 197b077aed3SPierre Pronchery ... EVP properties here ... 198e71b7053SJung-uk Kim 199b077aed3SPierre Pronchery [ssl_configuration] 200b077aed3SPierre Pronchery ... SSL/TLS configuration properties here ... 201e71b7053SJung-uk Kim 202b077aed3SPierre Pronchery [engines] 203b077aed3SPierre Pronchery ... engine properties here ... 204e71b7053SJung-uk Kim 205b077aed3SPierre Pronchery [random] 206b077aed3SPierre Pronchery ... random properties here ... 207e71b7053SJung-uk Kim 208b077aed3SPierre ProncheryThe semantics of each module are described below. The phrase "in the 209b077aed3SPierre Proncheryinitialization section" refers to the section identified by the 210b077aed3SPierre ProncheryB<openssl_conf> or other name (given as B<openssl_init> in the 211b077aed3SPierre Proncheryexample above). The examples below assume the configuration above 212b077aed3SPierre Proncheryis used to specify the individual sections. 213e71b7053SJung-uk Kim 214b077aed3SPierre Pronchery=head2 ASN.1 Object Identifier Configuration 215b077aed3SPierre Pronchery 216b077aed3SPierre ProncheryThe name B<oid_section> in the initialization section names the section 217b077aed3SPierre Proncherycontaining name/value pairs of OID's. 218b077aed3SPierre ProncheryThe name is the short name; the value is an optional long name followed 219b077aed3SPierre Proncheryby a comma, and the numeric value. 220b077aed3SPierre ProncheryWhile some OpenSSL commands have their own section for specifying OID's, 221b077aed3SPierre Proncherythis section makes them available to all commands and applications. 222b077aed3SPierre Pronchery 223b077aed3SPierre Pronchery [oids] 224b077aed3SPierre Pronchery shortName = a very long OID name, 1.2.3.4 225b077aed3SPierre Pronchery newoid1 = 1.2.3.4.1 226e71b7053SJung-uk Kim some_other_oid = 1.2.3.5 227e71b7053SJung-uk Kim 228b077aed3SPierre ProncheryIf a full configuration with the above fragment is in the file 229b077aed3SPierre ProncheryF<example.cnf>, then the following command line: 230e71b7053SJung-uk Kim 231e71b7053SJung-uk Kim OPENSSL_CONF=example.cnf openssl asn1parse -genstr OID:1.2.3.4.1 232e71b7053SJung-uk Kim 233e71b7053SJung-uk Kimwill output: 234e71b7053SJung-uk Kim 235e71b7053SJung-uk Kim 0:d=0 hl=2 l= 4 prim: OBJECT :newoid1 236e71b7053SJung-uk Kim 237e71b7053SJung-uk Kimshowing that the OID "newoid1" has been added as "1.2.3.4.1". 238e71b7053SJung-uk Kim 239b077aed3SPierre Pronchery=head2 Provider Configuration 240b077aed3SPierre Pronchery 241b077aed3SPierre ProncheryThe name B<providers> in the initialization section names the section 242b077aed3SPierre Proncherycontaining cryptographic provider configuration. The name/value assignments 243b077aed3SPierre Proncheryin this section each name a provider, and point to the configuration section 244b077aed3SPierre Proncheryfor that provider. The provider-specific section is used to specify how 245b077aed3SPierre Proncheryto load the module, activate it, and set other parameters. 246b077aed3SPierre Pronchery 247b077aed3SPierre ProncheryWithin a provider section, the following names have meaning: 248b077aed3SPierre Pronchery 249b077aed3SPierre Pronchery=over 4 250b077aed3SPierre Pronchery 251b077aed3SPierre Pronchery=item B<identity> 252b077aed3SPierre Pronchery 253b077aed3SPierre ProncheryThis is used to specify an alternate name, overriding the default name 254b077aed3SPierre Proncheryspecified in the list of providers. For example: 255b077aed3SPierre Pronchery 256b077aed3SPierre Pronchery [providers] 257b077aed3SPierre Pronchery foo = foo_provider 258b077aed3SPierre Pronchery 259b077aed3SPierre Pronchery [foo_provider] 260b077aed3SPierre Pronchery identity = my_fips_module 261b077aed3SPierre Pronchery 262b077aed3SPierre Pronchery=item B<module> 263b077aed3SPierre Pronchery 264b077aed3SPierre ProncherySpecifies the pathname of the module (typically a shared library) to load. 265b077aed3SPierre Pronchery 266b077aed3SPierre Pronchery=item B<activate> 267b077aed3SPierre Pronchery 268b077aed3SPierre ProncheryIf present, the module is activated. The value assigned to this name is not 269b077aed3SPierre Proncherysignificant. 270b077aed3SPierre Pronchery 271b077aed3SPierre Pronchery=back 272b077aed3SPierre Pronchery 273b077aed3SPierre ProncheryAll parameters in the section as well as sub-sections are made 274b077aed3SPierre Proncheryavailable to the provider. 275b077aed3SPierre Pronchery 276b077aed3SPierre Pronchery=head3 Default provider and its activation 277b077aed3SPierre Pronchery 278b077aed3SPierre ProncheryIf no providers are activated explicitly, the default one is activated implicitly. 279b077aed3SPierre ProncherySee L<OSSL_PROVIDER-default(7)> for more details. 280b077aed3SPierre Pronchery 281b077aed3SPierre ProncheryIf you add a section explicitly activating any other provider(s), 282b077aed3SPierre Proncheryyou most probably need to explicitly activate the default provider, 283b077aed3SPierre Proncheryotherwise it becomes unavailable in openssl. It may make the system remotely unavailable. 284b077aed3SPierre Pronchery 285b077aed3SPierre Pronchery=head2 EVP Configuration 286b077aed3SPierre Pronchery 287b077aed3SPierre ProncheryThe name B<alg_section> in the initialization section names the section 288b077aed3SPierre Proncherycontaining algorithmic properties when using the B<EVP> API. 289b077aed3SPierre Pronchery 290b077aed3SPierre ProncheryWithin the algorithm properties section, the following names have meaning: 291b077aed3SPierre Pronchery 292b077aed3SPierre Pronchery=over 4 293b077aed3SPierre Pronchery 294b077aed3SPierre Pronchery=item B<default_properties> 295b077aed3SPierre Pronchery 296b077aed3SPierre ProncheryThe value may be anything that is acceptable as a property query 297b077aed3SPierre Proncherystring for EVP_set_default_properties(). 298b077aed3SPierre Pronchery 299b077aed3SPierre Pronchery=item B<fips_mode> (deprecated) 300b077aed3SPierre Pronchery 301b077aed3SPierre ProncheryThe value is a boolean that can be B<yes> or B<no>. If the value is 302b077aed3SPierre ProncheryB<yes>, this is exactly equivalent to: 303b077aed3SPierre Pronchery 304b077aed3SPierre Pronchery default_properties = fips=yes 305b077aed3SPierre Pronchery 306b077aed3SPierre ProncheryIf the value is B<no>, nothing happens. Using this name is deprecated, and 307b077aed3SPierre Proncheryif used, it must be the only name in the section. 308b077aed3SPierre Pronchery 309b077aed3SPierre Pronchery=back 310b077aed3SPierre Pronchery 311b077aed3SPierre Pronchery=head2 SSL Configuration 312b077aed3SPierre Pronchery 313b077aed3SPierre ProncheryThe name B<ssl_conf> in the initialization section names the section 314b077aed3SPierre Proncherycontaining the list of SSL/TLS configurations. 315b077aed3SPierre ProncheryAs with the providers, each name in this section identifies a 316b077aed3SPierre Proncherysection with the configuration for that name. For example: 317b077aed3SPierre Pronchery 318b077aed3SPierre Pronchery [ssl_configuration] 319b077aed3SPierre Pronchery server = server_tls_config 320b077aed3SPierre Pronchery client = client_tls_config 321b077aed3SPierre Pronchery system_default = tls_system_default 322b077aed3SPierre Pronchery 323b077aed3SPierre Pronchery [server_tls_config] 324b077aed3SPierre Pronchery ... configuration for SSL/TLS servers ... 325b077aed3SPierre Pronchery 326b077aed3SPierre Pronchery [client_tls_config] 327b077aed3SPierre Pronchery ... configuration for SSL/TLS clients ... 328b077aed3SPierre Pronchery 329b077aed3SPierre ProncheryThe configuration name B<system_default> has a special meaning. If it 330b077aed3SPierre Proncheryexists, it is applied whenever an B<SSL_CTX> object is created. For example, 331b077aed3SPierre Proncheryto impose system-wide minimum TLS and DTLS protocol versions: 332b077aed3SPierre Pronchery 333b077aed3SPierre Pronchery [tls_system_default] 334b077aed3SPierre Pronchery MinProtocol = TLSv1.2 335b077aed3SPierre Pronchery MinProtocol = DTLSv1.2 336b077aed3SPierre Pronchery 337b077aed3SPierre ProncheryThe minimum TLS protocol is applied to B<SSL_CTX> objects that are TLS-based, 338b077aed3SPierre Proncheryand the minimum DTLS protocol to those are DTLS-based. 339b077aed3SPierre ProncheryThe same applies also to maximum versions set with B<MaxProtocol>. 340b077aed3SPierre Pronchery 341b077aed3SPierre ProncheryEach configuration section consists of name/value pairs that are parsed 342b077aed3SPierre Proncheryby B<SSL_CONF_cmd(3)>, which will be called by SSL_CTX_config() or 343b077aed3SPierre ProncherySSL_config(), appropriately. Note that any characters before an initial 344b077aed3SPierre Proncherydot in the configuration section are ignored, so that the same command can 345b077aed3SPierre Proncherybe used multiple times. This probably is most useful for loading different 346b077aed3SPierre Proncherykey types, as shown here: 347b077aed3SPierre Pronchery 348b077aed3SPierre Pronchery [server_tls_config] 349b077aed3SPierre Pronchery RSA.Certificate = server-rsa.pem 350b077aed3SPierre Pronchery ECDSA.Certificate = server-ecdsa.pem 351b077aed3SPierre Pronchery 352b077aed3SPierre Pronchery=head2 Engine Configuration 353b077aed3SPierre Pronchery 354b077aed3SPierre ProncheryThe name B<engines> in the initialization section names the section 355b077aed3SPierre Proncherycontaining the list of ENGINE configurations. 356b077aed3SPierre ProncheryAs with the providers, each name in this section identifies an engine 357b077aed3SPierre Proncherywith the configuration for that engine. 358b077aed3SPierre ProncheryThe engine-specific section is used to specify how to load the engine, 359b077aed3SPierre Proncheryactivate it, and set other parameters. 360b077aed3SPierre Pronchery 361b077aed3SPierre ProncheryWithin an engine section, the following names have meaning: 362b077aed3SPierre Pronchery 363b077aed3SPierre Pronchery=over 4 364b077aed3SPierre Pronchery 365b077aed3SPierre Pronchery=item B<engine_id> 366b077aed3SPierre Pronchery 367b077aed3SPierre ProncheryThis is used to specify an alternate name, overriding the default name 368b077aed3SPierre Proncheryspecified in the list of engines. If present, it must be first. 369b077aed3SPierre ProncheryFor example: 370b077aed3SPierre Pronchery 371b077aed3SPierre Pronchery [engines] 372b077aed3SPierre Pronchery foo = foo_engine 373b077aed3SPierre Pronchery 374b077aed3SPierre Pronchery [foo_engine] 375b077aed3SPierre Pronchery engine_id = myfoo 376b077aed3SPierre Pronchery 377b077aed3SPierre Pronchery=item B<dynamic_path> 378b077aed3SPierre Pronchery 379b077aed3SPierre ProncheryThis loads and adds an ENGINE from the given path. It is equivalent to 380b077aed3SPierre Proncherysending the ctrls B<SO_PATH> with the path argument followed by B<LIST_ADD> 381b077aed3SPierre Proncherywith value B<2> and B<LOAD> to the dynamic ENGINE. If this is not the 382b077aed3SPierre Proncheryrequired behaviour then alternative ctrls can be sent directly to the 383b077aed3SPierre Proncherydynamic ENGINE using ctrl commands. 384b077aed3SPierre Pronchery 385b077aed3SPierre Pronchery=item B<init> 386b077aed3SPierre Pronchery 387b077aed3SPierre ProncheryThis specifies whether to initialize the ENGINE. If the value is B<0> the 388b077aed3SPierre ProncheryENGINE will not be initialized, if the value is B<1> an attempt is made 389b077aed3SPierre Proncheryto initialize 390b077aed3SPierre Proncherythe ENGINE immediately. If the B<init> command is not present then an 391b077aed3SPierre Proncheryattempt will be made to initialize the ENGINE after all commands in its 392b077aed3SPierre Proncherysection have been processed. 393b077aed3SPierre Pronchery 394b077aed3SPierre Pronchery=item B<default_algorithms> 395b077aed3SPierre Pronchery 396b077aed3SPierre ProncheryThis sets the default algorithms an ENGINE will supply using the function 397b077aed3SPierre ProncheryENGINE_set_default_string(). 398b077aed3SPierre Pronchery 399b077aed3SPierre Pronchery=back 400b077aed3SPierre Pronchery 401b077aed3SPierre ProncheryAll other names are taken to be the name of a ctrl command that is 402b077aed3SPierre Proncherysent to the ENGINE, and the value is the argument passed with the command. 403b077aed3SPierre ProncheryThe special value B<EMPTY> means no value is sent with the command. 404b077aed3SPierre ProncheryFor example: 405b077aed3SPierre Pronchery 406b077aed3SPierre Pronchery [engines] 407b077aed3SPierre Pronchery foo = foo_engine 408b077aed3SPierre Pronchery 409b077aed3SPierre Pronchery [foo_engine] 410b077aed3SPierre Pronchery dynamic_path = /some/path/fooengine.so 411b077aed3SPierre Pronchery some_ctrl = some_value 412b077aed3SPierre Pronchery default_algorithms = ALL 413b077aed3SPierre Pronchery other_ctrl = EMPTY 414b077aed3SPierre Pronchery 415b077aed3SPierre Pronchery=head2 Random Configuration 416b077aed3SPierre Pronchery 417b077aed3SPierre ProncheryThe name B<random> in the initialization section names the section 418*aa795734SPierre Proncherycontaining the random number generator settings. 419b077aed3SPierre Pronchery 420b077aed3SPierre ProncheryWithin the random section, the following names have meaning: 421b077aed3SPierre Pronchery 422b077aed3SPierre Pronchery=over 4 423b077aed3SPierre Pronchery 424b077aed3SPierre Pronchery=item B<random> 425b077aed3SPierre Pronchery 426b077aed3SPierre ProncheryThis is used to specify the random bit generator. 427b077aed3SPierre ProncheryFor example: 428b077aed3SPierre Pronchery 429b077aed3SPierre Pronchery [random] 430b077aed3SPierre Pronchery random = CTR-DRBG 431b077aed3SPierre Pronchery 432b077aed3SPierre ProncheryThe available random bit generators are: 433b077aed3SPierre Pronchery 434b077aed3SPierre Pronchery=over 4 435b077aed3SPierre Pronchery 436b077aed3SPierre Pronchery=item B<CTR-DRBG> 437b077aed3SPierre Pronchery 438b077aed3SPierre Pronchery=item B<HASH-DRBG> 439b077aed3SPierre Pronchery 440b077aed3SPierre Pronchery=item B<HMAC-DRBG> 441b077aed3SPierre Pronchery 442b077aed3SPierre Pronchery=back 443b077aed3SPierre Pronchery 444b077aed3SPierre Pronchery=item B<cipher> 445b077aed3SPierre Pronchery 446b077aed3SPierre ProncheryThis specifies what cipher a B<CTR-DRBG> random bit generator will use. 447b077aed3SPierre ProncheryOther random bit generators ignore this name. 448b077aed3SPierre ProncheryThe default value is B<AES-256-CTR>. 449b077aed3SPierre Pronchery 450b077aed3SPierre Pronchery=item B<digest> 451b077aed3SPierre Pronchery 452b077aed3SPierre ProncheryThis specifies what digest the B<HASH-DRBG> or B<HMAC-DRBG> random bit 453b077aed3SPierre Proncherygenerators will use. Other random bit generators ignore this name. 454b077aed3SPierre Pronchery 455b077aed3SPierre Pronchery=item B<properties> 456b077aed3SPierre Pronchery 457b077aed3SPierre ProncheryThis sets the property query used when fetching the random bit generator and 458b077aed3SPierre Proncheryany underlying algorithms. 459b077aed3SPierre Pronchery 460b077aed3SPierre Pronchery=item B<seed> 461b077aed3SPierre Pronchery 462b077aed3SPierre ProncheryThis sets the randomness source that should be used. By default B<SEED-SRC> 463b077aed3SPierre Proncherywill be used outside of the FIPS provider. The FIPS provider uses call backs 464b077aed3SPierre Proncheryto access the same randomness sources from outside the validated boundary. 465b077aed3SPierre Pronchery 466b077aed3SPierre Pronchery=item B<seed_properties> 467b077aed3SPierre Pronchery 468b077aed3SPierre ProncheryThis sets the property query used when fetching the randomness source. 469b077aed3SPierre Pronchery 470b077aed3SPierre Pronchery=back 471b077aed3SPierre Pronchery 472b077aed3SPierre Pronchery=head1 EXAMPLES 473b077aed3SPierre Pronchery 474b077aed3SPierre ProncheryThis example shows how to use quoting and escaping. 475b077aed3SPierre Pronchery 476b077aed3SPierre Pronchery # This is the default section. 477b077aed3SPierre Pronchery HOME = /temp 478b077aed3SPierre Pronchery configdir = $ENV::HOME/config 479b077aed3SPierre Pronchery 480b077aed3SPierre Pronchery [ section_one ] 481b077aed3SPierre Pronchery # Quotes permit leading and trailing whitespace 482b077aed3SPierre Pronchery any = " any variable name " 483b077aed3SPierre Pronchery other = A string that can \ 484b077aed3SPierre Pronchery cover several lines \ 485b077aed3SPierre Pronchery by including \\ characters 486b077aed3SPierre Pronchery message = Hello World\n 487b077aed3SPierre Pronchery 488b077aed3SPierre Pronchery [ section_two ] 489b077aed3SPierre Pronchery greeting = $section_one::message 490b077aed3SPierre Pronchery 491b077aed3SPierre ProncheryThis example shows how to expand environment variables safely. 492b077aed3SPierre ProncheryIn this example, the variable B<tempfile> is intended to refer 493b077aed3SPierre Proncheryto a temporary file, and the environment variable B<TEMP> or 494b077aed3SPierre ProncheryB<TMP>, if present, specify the directory where the file 495b077aed3SPierre Proncheryshould be put. 496b077aed3SPierre ProncherySince the default section is checked if a variable does not 497b077aed3SPierre Proncheryexist, it is possible to set B<TMP> to default to F</tmp>, and 498b077aed3SPierre ProncheryB<TEMP> to default to B<TMP>. 499b077aed3SPierre Pronchery 500b077aed3SPierre Pronchery # These two lines must be in the default section. 501b077aed3SPierre Pronchery TMP = /tmp 502b077aed3SPierre Pronchery TEMP = $ENV::TMP 503b077aed3SPierre Pronchery 504b077aed3SPierre Pronchery # This can be used anywhere 505b077aed3SPierre Pronchery tmpfile = ${ENV::TEMP}/tmp.filename 506b077aed3SPierre Pronchery 507b077aed3SPierre ProncheryThis example shows how to enforce FIPS mode for the application 508b077aed3SPierre ProncheryF<sample>. 509b077aed3SPierre Pronchery 510b077aed3SPierre Pronchery sample = fips_config 511b077aed3SPierre Pronchery 512b077aed3SPierre Pronchery [fips_config] 513b077aed3SPierre Pronchery alg_section = evp_properties 514b077aed3SPierre Pronchery 515b077aed3SPierre Pronchery [evp_properties] 516b077aed3SPierre Pronchery default_properties = "fips=yes" 517b077aed3SPierre Pronchery 518e71b7053SJung-uk Kim=head1 ENVIRONMENT 519e71b7053SJung-uk Kim 520e71b7053SJung-uk Kim=over 4 521e71b7053SJung-uk Kim 522e71b7053SJung-uk Kim=item B<OPENSSL_CONF> 523e71b7053SJung-uk Kim 524b077aed3SPierre ProncheryThe path to the config file, or the empty string for none. 525e71b7053SJung-uk KimIgnored in set-user-ID and set-group-ID programs. 526e71b7053SJung-uk Kim 527e71b7053SJung-uk Kim=item B<OPENSSL_ENGINES> 528e71b7053SJung-uk Kim 529e71b7053SJung-uk KimThe path to the engines directory. 530e71b7053SJung-uk KimIgnored in set-user-ID and set-group-ID programs. 531e71b7053SJung-uk Kim 532b077aed3SPierre Pronchery=item B<OPENSSL_MODULES> 533b077aed3SPierre Pronchery 534b077aed3SPierre ProncheryThe path to the directory with OpenSSL modules, such as providers. 535b077aed3SPierre ProncheryIgnored in set-user-ID and set-group-ID programs. 536b077aed3SPierre Pronchery 537b077aed3SPierre Pronchery=item B<OPENSSL_CONF_INCLUDE> 538b077aed3SPierre Pronchery 539b077aed3SPierre ProncheryThe optional path to prepend to all B<.include> paths. 540b077aed3SPierre Pronchery 541e71b7053SJung-uk Kim=back 542e71b7053SJung-uk Kim 543e71b7053SJung-uk Kim=head1 BUGS 544e71b7053SJung-uk Kim 545b077aed3SPierre ProncheryThere is no way to include characters using the octal B<\nnn> form. Strings 546b077aed3SPierre Proncheryare all null terminated so nulls cannot form part of the value. 547e71b7053SJung-uk Kim 548e71b7053SJung-uk KimThe escaping isn't quite right: if you want to use sequences like B<\n> 549e71b7053SJung-uk Kimyou can't use any quote escaping on the same line. 550e71b7053SJung-uk Kim 551b077aed3SPierre ProncheryThe limit that only one directory can be opened and read at a time 552b077aed3SPierre Proncherycan be considered a bug and should be fixed. 553b077aed3SPierre Pronchery 554b077aed3SPierre Pronchery=head1 HISTORY 555b077aed3SPierre Pronchery 556b077aed3SPierre ProncheryAn undocumented API, NCONF_WIN32(), used a slightly different set 557b077aed3SPierre Proncheryof parsing rules there were intended to be tailored to 558b077aed3SPierre Proncherythe Microsoft Windows platform. 559b077aed3SPierre ProncherySpecifically, the backslash character was not an escape character and 560b077aed3SPierre Proncherycould be used in pathnames, only the double-quote character was recognized, 561b077aed3SPierre Proncheryand comments began with a semi-colon. 562b077aed3SPierre ProncheryThis function was deprecated in OpenSSL 3.0; applications with 563b077aed3SPierre Proncheryconfiguration files using that syntax will have to be modified. 564e71b7053SJung-uk Kim 565e71b7053SJung-uk Kim=head1 SEE ALSO 566e71b7053SJung-uk Kim 567b077aed3SPierre ProncheryL<openssl-x509(1)>, L<openssl-req(1)>, L<openssl-ca(1)>, 568b077aed3SPierre ProncheryL<openssl-fipsinstall(1)>, 569b077aed3SPierre ProncheryL<ASN1_generate_nconf(3)>, 570b077aed3SPierre ProncheryL<EVP_set_default_properties(3)>, 571b077aed3SPierre ProncheryL<CONF_modules_load(3)>, 572b077aed3SPierre ProncheryL<CONF_modules_load_file(3)>, 573b077aed3SPierre ProncheryL<fips_config(5)>, and 574b077aed3SPierre ProncheryL<x509v3_config(5)>. 575e71b7053SJung-uk Kim 576e71b7053SJung-uk Kim=head1 COPYRIGHT 577e71b7053SJung-uk Kim 578b077aed3SPierre ProncheryCopyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved. 579e71b7053SJung-uk Kim 580b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 581e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 582e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 583e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 584e71b7053SJung-uk Kim 585e71b7053SJung-uk Kim=cut 586