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