diff options
| author | cvs2svn <admin@example.com> | 2015-08-02 21:54:23 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 2015-08-02 21:54:23 +0000 |
| commit | 67fcb4ef3942fb3a0f1e18f8ebbe7464120d485a (patch) | |
| tree | 5609c82060f75c53af0a7641d9b33a88574876cd /src/lib/libssl/doc/SSL_CTX_set_options.3 | |
| parent | ed40f444ba01bcae1d8540f9c26d79537ab5baf2 (diff) | |
| download | openbsd-libressl-v2.2.2.tar.gz openbsd-libressl-v2.2.2.tar.bz2 openbsd-libressl-v2.2.2.zip | |
This commit was manufactured by cvs2git to create branch 'OPENBSD_5_8'.libressl-v2.2.2
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_options.3')
| -rw-r--r-- | src/lib/libssl/doc/SSL_CTX_set_options.3 | 395 |
1 files changed, 0 insertions, 395 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_options.3 b/src/lib/libssl/doc/SSL_CTX_set_options.3 deleted file mode 100644 index 852553e97f..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_options.3 +++ /dev/null | |||
| @@ -1,395 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_options.3,v 1.10 2015/07/18 19:41:54 doug Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: July 18 2015 $ | ||
| 5 | .Dt SSL_CTX_SET_OPTIONS 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_options , | ||
| 9 | .Nm SSL_set_options , | ||
| 10 | .Nm SSL_CTX_clear_options , | ||
| 11 | .Nm SSL_clear_options , | ||
| 12 | .Nm SSL_CTX_get_options , | ||
| 13 | .Nm SSL_get_options , | ||
| 14 | .Nm SSL_get_secure_renegotiation_support | ||
| 15 | .Nd manipulate SSL options | ||
| 16 | .Sh SYNOPSIS | ||
| 17 | .In openssl/ssl.h | ||
| 18 | .Ft long | ||
| 19 | .Fn SSL_CTX_set_options "SSL_CTX *ctx" "long options" | ||
| 20 | .Ft long | ||
| 21 | .Fn SSL_set_options "SSL *ssl" "long options" | ||
| 22 | .Ft long | ||
| 23 | .Fn SSL_CTX_clear_options "SSL_CTX *ctx" "long options" | ||
| 24 | .Ft long | ||
| 25 | .Fn SSL_clear_options "SSL *ssl" "long options" | ||
| 26 | .Ft long | ||
| 27 | .Fn SSL_CTX_get_options "SSL_CTX *ctx" | ||
| 28 | .Ft long | ||
| 29 | .Fn SSL_get_options "SSL *ssl" | ||
| 30 | .Ft long | ||
| 31 | .Fn SSL_get_secure_renegotiation_support "SSL *ssl" | ||
| 32 | .Sh DESCRIPTION | ||
| 33 | Note: all these functions are implemented using macros. | ||
| 34 | .Pp | ||
| 35 | .Fn SSL_CTX_set_options | ||
| 36 | adds the options set via bitmask in | ||
| 37 | .Fa options | ||
| 38 | to | ||
| 39 | .Fa ctx . | ||
| 40 | Options already set before are not cleared! | ||
| 41 | .Pp | ||
| 42 | .Fn SSL_set_options | ||
| 43 | adds the options set via bitmask in | ||
| 44 | .Fa options | ||
| 45 | to | ||
| 46 | .Fa ssl . | ||
| 47 | Options already set before are not cleared! | ||
| 48 | .Pp | ||
| 49 | .Fn SSL_CTX_clear_options | ||
| 50 | clears the options set via bitmask in | ||
| 51 | .Fa options | ||
| 52 | to | ||
| 53 | .Fa ctx . | ||
| 54 | .Pp | ||
| 55 | .Fn SSL_clear_options | ||
| 56 | clears the options set via bitmask in | ||
| 57 | .Fa options | ||
| 58 | to | ||
| 59 | .Fa ssl . | ||
| 60 | .Pp | ||
| 61 | .Fn SSL_CTX_get_options | ||
| 62 | returns the options set for | ||
| 63 | .Fa ctx . | ||
| 64 | .Pp | ||
| 65 | .Fn SSL_get_options | ||
| 66 | returns the options set for | ||
| 67 | .Fa ssl . | ||
| 68 | .Pp | ||
| 69 | .Fn SSL_get_secure_renegotiation_support | ||
| 70 | indicates whether the peer supports secure renegotiation. | ||
| 71 | .Sh NOTES | ||
| 72 | The behaviour of the SSL library can be changed by setting several options. | ||
| 73 | The options are coded as bitmasks and can be combined by a bitwise OR | ||
| 74 | operation (|). | ||
| 75 | .Pp | ||
| 76 | .Fn SSL_CTX_set_options | ||
| 77 | and | ||
| 78 | .Fn SSL_set_options | ||
| 79 | affect the (external) protocol behaviour of the SSL library. | ||
| 80 | The (internal) behaviour of the API can be changed by using the similar | ||
| 81 | .Xr SSL_CTX_set_mode 3 | ||
| 82 | and | ||
| 83 | .Xr SSL_set_mode 3 | ||
| 84 | functions. | ||
| 85 | .Pp | ||
| 86 | During a handshake, the option settings of the SSL object are used. | ||
| 87 | When a new SSL object is created from a context using | ||
| 88 | .Xr SSL_new 3 , | ||
| 89 | the current option setting is copied. | ||
| 90 | Changes to | ||
| 91 | .Fa ctx | ||
| 92 | do not affect already created | ||
| 93 | .Vt SSL | ||
| 94 | objects. | ||
| 95 | .Fn SSL_clear | ||
| 96 | does not affect the settings. | ||
| 97 | .Pp | ||
| 98 | The following | ||
| 99 | .Em bug workaround | ||
| 100 | options are available: | ||
| 101 | .Bl -tag -width Ds | ||
| 102 | .It Dv SSL_OP_MICROSOFT_SESS_ID_BUG | ||
| 103 | As of | ||
| 104 | .Ox 5.8 , | ||
| 105 | this option has no effect. | ||
| 106 | .It Dv SSL_OP_NETSCAPE_CHALLENGE_BUG | ||
| 107 | As of | ||
| 108 | .Ox 5.8 , | ||
| 109 | this option has no effect. | ||
| 110 | .It Dv SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG | ||
| 111 | As of OpenSSL 0.9.8q and 1.0.0c, this option has no effect. | ||
| 112 | .It Dv SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG | ||
| 113 | As of | ||
| 114 | .Ox 5.8 , | ||
| 115 | this option has no effect. | ||
| 116 | .It Dv SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER | ||
| 117 | As of | ||
| 118 | .Ox 5.8 , | ||
| 119 | this option has no effect. | ||
| 120 | .It Dv SSL_OP_SAFARI_ECDHE_ECDSA_BUG | ||
| 121 | As of | ||
| 122 | .Ox 5.8 , | ||
| 123 | this option has no effect. | ||
| 124 | .It Dv SSL_OP_SSLEAY_080_CLIENT_DH_BUG | ||
| 125 | As of | ||
| 126 | .Ox 5.8 , | ||
| 127 | this option has no effect. | ||
| 128 | .It Dv SSL_OP_TLS_D5_BUG | ||
| 129 | As of | ||
| 130 | .Ox 5.8 , | ||
| 131 | this option has no effect. | ||
| 132 | .It Dv SSL_OP_TLS_BLOCK_PADDING_BUG | ||
| 133 | As of | ||
| 134 | .Ox 5.8 , | ||
| 135 | this option has no effect. | ||
| 136 | .It Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | ||
| 137 | Disables a countermeasure against a SSL 3.0/TLS 1.0 protocol vulnerability | ||
| 138 | affecting CBC ciphers, which cannot be handled by some broken SSL | ||
| 139 | implementations. | ||
| 140 | This option has no effect for connections using other ciphers. | ||
| 141 | .It Dv SSL_OP_TLSEXT_PADDING | ||
| 142 | Adds a padding extension to ensure the ClientHello size is never between 256 | ||
| 143 | and 511 bytes in length. | ||
| 144 | This is needed as a workaround for some implementations. | ||
| 145 | .It Dv SSL_OP_ALL | ||
| 146 | All of the above bug workarounds. | ||
| 147 | .El | ||
| 148 | .Pp | ||
| 149 | It is usually safe to use | ||
| 150 | .Dv SSL_OP_ALL | ||
| 151 | to enable the bug workaround options if compatibility with somewhat broken | ||
| 152 | implementations is desired. | ||
| 153 | .Pp | ||
| 154 | The following | ||
| 155 | .Em modifying | ||
| 156 | options are available: | ||
| 157 | .Bl -tag -width Ds | ||
| 158 | .It Dv SSL_OP_TLS_ROLLBACK_BUG | ||
| 159 | Disable version rollback attack detection. | ||
| 160 | .Pp | ||
| 161 | During the client key exchange, the client must send the same information | ||
| 162 | about acceptable SSL/TLS protocol levels as during the first hello. | ||
| 163 | Some clients violate this rule by adapting to the server's answer. | ||
| 164 | (Example: the client sends a SSLv2 hello and accepts up to SSLv3.1=TLSv1, | ||
| 165 | the server only understands up to SSLv3. | ||
| 166 | In this case the client must still use the same SSLv3.1=TLSv1 announcement. | ||
| 167 | Some clients step down to SSLv3 with respect to the server's answer and violate | ||
| 168 | the version rollback protection.) | ||
| 169 | .It Dv SSL_OP_SINGLE_DH_USE | ||
| 170 | Always create a new key when using temporary/ephemeral DH parameters | ||
| 171 | (see | ||
| 172 | .Xr SSL_CTX_set_tmp_dh_callback 3 ) . | ||
| 173 | This option must be used to prevent small subgroup attacks, when the DH | ||
| 174 | parameters were not generated using | ||
| 175 | .Dq strong | ||
| 176 | primes (e.g., when using DSA-parameters, see | ||
| 177 | .Xr openssl 1 ) . | ||
| 178 | If | ||
| 179 | .Dq strong | ||
| 180 | primes were used, it is not strictly necessary to generate a new DH key during | ||
| 181 | each handshake but it is also recommended. | ||
| 182 | .Dv SSL_OP_SINGLE_DH_USE | ||
| 183 | should therefore be enabled whenever temporary/ephemeral DH parameters are used. | ||
| 184 | .It SSL_OP_EPHEMERAL_RSA | ||
| 185 | Always use ephemeral (temporary) RSA key when doing RSA operations (see | ||
| 186 | .Xr SSL_CTX_set_tmp_rsa_callback 3 ) . | ||
| 187 | According to the specifications, this is only done when a RSA key can only be | ||
| 188 | used for signature operations (namely under export ciphers with restricted RSA | ||
| 189 | keylength). | ||
| 190 | By setting this option, ephemeral RSA keys are always used. | ||
| 191 | This option breaks compatibility with the SSL/TLS specifications and may lead | ||
| 192 | to interoperability problems with clients and should therefore never be used. | ||
| 193 | Ciphers with EDH (ephemeral Diffie-Hellman) key exchange should be used instead. | ||
| 194 | .It Dv SSL_OP_CIPHER_SERVER_PREFERENCE | ||
| 195 | When choosing a cipher, use the server's preferences instead of the client | ||
| 196 | preferences. | ||
| 197 | When not set, the SSL server will always follow the client's preferences. | ||
| 198 | When set, the SSLv3/TLSv1 server will choose following its own preferences. | ||
| 199 | Because of the different protocol, for SSLv2 the server will send its list of | ||
| 200 | preferences to the client and the client chooses. | ||
| 201 | .It Dv SSL_OP_NETSCAPE_CA_DN_BUG | ||
| 202 | As of | ||
| 203 | .Ox 5.8 , | ||
| 204 | this option has no effect. | ||
| 205 | .It Dv SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG | ||
| 206 | As of | ||
| 207 | .Ox 5.8 , | ||
| 208 | this option has no effect. | ||
| 209 | .It Dv SSL_OP_NO_SSLv2 | ||
| 210 | As of | ||
| 211 | .Ox 5.6 , | ||
| 212 | this option has no effect as SSLv2 support has been removed. | ||
| 213 | In previous versions it disabled use of the SSLv2 protocol. | ||
| 214 | .It Dv SSL_OP_NO_SSLv3 | ||
| 215 | Do not use the SSLv3 protocol. | ||
| 216 | .It Dv SSL_OP_NO_TLSv1 | ||
| 217 | Do not use the TLSv1.0 protocol. | ||
| 218 | .It Dv SSL_OP_NO_TLSv1_1 | ||
| 219 | Do not use the TLSv1.1 protocol. | ||
| 220 | .It Dv SSL_OP_NO_TLSv1_2 | ||
| 221 | Do not use the TLSv1.2 protocol. | ||
| 222 | .It Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | ||
| 223 | When performing renegotiation as a server, always start a new session (i.e., | ||
| 224 | session resumption requests are only accepted in the initial handshake). | ||
| 225 | This option is not needed for clients. | ||
| 226 | .It Dv SSL_OP_NO_TICKET | ||
| 227 | Normally clients and servers will, where possible, transparently make use of | ||
| 228 | RFC4507bis tickets for stateless session resumption. | ||
| 229 | .Pp | ||
| 230 | If this option is set this functionality is disabled and tickets will not be | ||
| 231 | used by clients or servers. | ||
| 232 | .It Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | ||
| 233 | As of | ||
| 234 | .Ox 5.6 , | ||
| 235 | this option has no effect. | ||
| 236 | In previous versions it allowed legacy insecure renegotiation between OpenSSL | ||
| 237 | and unpatched clients or servers. | ||
| 238 | See the | ||
| 239 | .Sx SECURE RENEGOTIATION | ||
| 240 | section for more details. | ||
| 241 | .It Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 242 | Allow legacy insecure renegotiation between OpenSSL and unpatched servers | ||
| 243 | .Em only : | ||
| 244 | this option is currently set by default. | ||
| 245 | See the | ||
| 246 | .Sx SECURE RENEGOTIATION | ||
| 247 | section for more details. | ||
| 248 | .El | ||
| 249 | .Sh SECURE RENEGOTIATION | ||
| 250 | OpenSSL 0.9.8m and later always attempts to use secure renegotiation as | ||
| 251 | described in RFC5746. | ||
| 252 | This counters the prefix attack described in CVE-2009-3555 and elsewhere. | ||
| 253 | .Pp | ||
| 254 | The deprecated and highly broken SSLv2 protocol does not support renegotiation | ||
| 255 | at all; its use is | ||
| 256 | .Em strongly | ||
| 257 | discouraged. | ||
| 258 | .Pp | ||
| 259 | This attack has far-reaching consequences which application writers should be | ||
| 260 | aware of. | ||
| 261 | In the description below an implementation supporting secure renegotiation is | ||
| 262 | referred to as | ||
| 263 | .Dq patched . | ||
| 264 | A server not supporting secure | ||
| 265 | renegotiation is referred to as | ||
| 266 | .Dq unpatched . | ||
| 267 | .Pp | ||
| 268 | The following sections describe the operations permitted by OpenSSL's secure | ||
| 269 | renegotiation implementation. | ||
| 270 | .Ss Patched client and server | ||
| 271 | Connections and renegotiation are always permitted by OpenSSL implementations. | ||
| 272 | .Ss Unpatched client and patched OpenSSL server | ||
| 273 | The initial connection succeeds but client renegotiation is denied by the | ||
| 274 | server with a | ||
| 275 | .Em no_renegotiation | ||
| 276 | warning alert if TLS v1.0 is used or a fatal | ||
| 277 | .Em handshake_failure | ||
| 278 | alert in SSL v3.0. | ||
| 279 | .Pp | ||
| 280 | If the patched OpenSSL server attempts to renegotiate a fatal | ||
| 281 | .Em handshake_failure | ||
| 282 | alert is sent. | ||
| 283 | This is because the server code may be unaware of the unpatched nature of the | ||
| 284 | client. | ||
| 285 | .Pp | ||
| 286 | .Em N.B.: | ||
| 287 | a bug in OpenSSL clients earlier than 0.9.8m (all of which are unpatched) will | ||
| 288 | result in the connection hanging if it receives a | ||
| 289 | .Em no_renegotiation | ||
| 290 | alert. | ||
| 291 | OpenSSL versions 0.9.8m and later will regard a | ||
| 292 | .Em no_renegotiation | ||
| 293 | alert as fatal and respond with a fatal | ||
| 294 | .Em handshake_failure | ||
| 295 | alert. | ||
| 296 | This is because the OpenSSL API currently has no provision to indicate to an | ||
| 297 | application that a renegotiation attempt was refused. | ||
| 298 | .Ss Patched OpenSSL client and unpatched server | ||
| 299 | If the option | ||
| 300 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 301 | is set then initial connections and renegotiation between patched OpenSSL | ||
| 302 | clients and unpatched servers succeeds. | ||
| 303 | If neither option is set then initial connections to unpatched servers will | ||
| 304 | fail. | ||
| 305 | .Pp | ||
| 306 | The option | ||
| 307 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 308 | is currently set by default even though it has security implications: | ||
| 309 | otherwise it would be impossible to connect to unpatched servers (i.e., all of | ||
| 310 | them initially) and this is clearly not acceptable. | ||
| 311 | Renegotiation is permitted because this does not add any additional security | ||
| 312 | issues: during an attack clients do not see any renegotiations anyway. | ||
| 313 | .Pp | ||
| 314 | As more servers become patched the option | ||
| 315 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 316 | will | ||
| 317 | .Em not | ||
| 318 | be set by default in a future version of OpenSSL. | ||
| 319 | .Pp | ||
| 320 | OpenSSL client applications wishing to ensure they can connect to unpatched | ||
| 321 | servers should always | ||
| 322 | .Em set | ||
| 323 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 324 | .Pp | ||
| 325 | OpenSSL client applications that want to ensure they can | ||
| 326 | .Em not | ||
| 327 | connect to unpatched servers (and thus avoid any security issues) should always | ||
| 328 | .Em clear | ||
| 329 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 330 | using | ||
| 331 | .Fn SSL_CTX_clear_options | ||
| 332 | or | ||
| 333 | .Fn SSL_clear_options . | ||
| 334 | .Sh RETURN VALUES | ||
| 335 | .Fn SSL_CTX_set_options | ||
| 336 | and | ||
| 337 | .Fn SSL_set_options | ||
| 338 | return the new options bitmask after adding | ||
| 339 | .Fa options . | ||
| 340 | .Pp | ||
| 341 | .Fn SSL_CTX_clear_options | ||
| 342 | and | ||
| 343 | .Fn SSL_clear_options | ||
| 344 | return the new options bitmask after clearing | ||
| 345 | .Fa options . | ||
| 346 | .Pp | ||
| 347 | .Fn SSL_CTX_get_options | ||
| 348 | and | ||
| 349 | .Fn SSL_get_options | ||
| 350 | return the current bitmask. | ||
| 351 | .Pp | ||
| 352 | .Fn SSL_get_secure_renegotiation_support | ||
| 353 | returns 1 is the peer supports secure renegotiation and 0 if it does not. | ||
| 354 | .Sh SEE ALSO | ||
| 355 | .Xr openssl 1 , | ||
| 356 | .Xr ssl 3 , | ||
| 357 | .Xr SSL_clear 3 , | ||
| 358 | .Xr SSL_CTX_set_tmp_dh_callback 3 , | ||
| 359 | .Xr SSL_CTX_set_tmp_rsa_callback 3 , | ||
| 360 | .Xr SSL_new 3 | ||
| 361 | .Sh HISTORY | ||
| 362 | .Dv SSL_OP_CIPHER_SERVER_PREFERENCE | ||
| 363 | and | ||
| 364 | .Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | ||
| 365 | have been added in | ||
| 366 | OpenSSL 0.9.7. | ||
| 367 | .Pp | ||
| 368 | .Dv SSL_OP_TLS_ROLLBACK_BUG | ||
| 369 | has been added in OpenSSL 0.9.6 and was automatically enabled with | ||
| 370 | .Dv SSL_OP_ALL . | ||
| 371 | As of 0.9.7, it is no longer included in | ||
| 372 | .Dv SSL_OP_ALL | ||
| 373 | and must be explicitly set. | ||
| 374 | .Pp | ||
| 375 | .Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | ||
| 376 | has been added in OpenSSL 0.9.6e. | ||
| 377 | Versions up to OpenSSL 0.9.6c do not include the countermeasure that can be | ||
| 378 | disabled with this option (in OpenSSL 0.9.6d, it was always enabled). | ||
| 379 | .Pp | ||
| 380 | .Fn SSL_CTX_clear_options | ||
| 381 | and | ||
| 382 | .Fn SSL_clear_options | ||
| 383 | were first added in OpenSSL 0.9.8m. | ||
| 384 | .Pp | ||
| 385 | .Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION , | ||
| 386 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 387 | and the function | ||
| 388 | .Fn SSL_get_secure_renegotiation_support | ||
| 389 | were first added in OpenSSL 0.9.8m. | ||
| 390 | .Pp | ||
| 391 | .Dv SSL_OP_NO_SSLv2 | ||
| 392 | and | ||
| 393 | .Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | ||
| 394 | were changed to have no effect in | ||
| 395 | .Ox 5.6 . | ||
