Commit be4fc264 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

mod_ssl: when compiled against OpenSSL 1.0.1 or later, allow explicit

control of TLSv1.1 and TLSv1.2 through the SSLProtocol directive,
adding TLSv1.1 and TLSv1.2 support by default given 'SSLProtocol All'.

Picked up comment edit, trusting openssl compilation state and current
method which openssl uses to include opensslconf.h - if this should be
refined, it needs to be refined for other openssl operations as well.
Any #define OPENSSL_* for httpd alone would be invalid, these are all
namespace protected by openssl.org project.

Submitted by: kbrand, wrowe
Backports: 1222921, 1222930, 1225476, 1225792
Reviewed by: sf, kbrand, rjung



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1375076 13f79535-47bb-0310-9956-ffa450edef68
parent 2964e219
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -10,6 +10,11 @@ Changes with Apache 2.2.23
     possible XSS for a site where untrusted users can upload files to
     a location with MultiViews enabled. [Niels Heinen <heinenn google.com>]

  *) mod_ssl: when compiled against OpenSSL 1.0.1 or later, allow explicit
     control of TLSv1.1 and TLSv1.2 through the SSLProtocol directive,
     adding TLSv1.1 and TLSv1.2 support by default given 'SSLProtocol All'.
     [Kaspar Brand, William Rowe]

  *) mod_log_config: Fix %{abc}C truncating cookie values at first "=".
     PR 53104. [Greg Ames]

+0 −25
Original line number Diff line number Diff line
@@ -93,31 +93,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  * mod_ssl: when compiled against OpenSSL 1.0.1 or later, allow explicit
    control of TLSv1.1 and TLSv1.2 through the SSLProtocol directive,
    adding TLSv1.1 and TLSv1.2 support by default given 'SSLProtocol All'.
    [Kaspar Brand, William Rowe]
      http://svn.apache.org/viewvc?view=revision&revision=1222921
      http://svn.apache.org/viewvc?view=revision&revision=1222930
      http://svn.apache.org/viewvc?view=revision&revision=1225476
      http://svn.apache.org/viewvc?view=revision&revision=1225792
    Backport version for 2.2.x of the patches above:
      http://people.apache.org/~wrowe/tls11-12-patch-2.2-kbrand-wrowe.2.patch
    +1: wrowe, sf, kbrand, rjung
    kbrand: explicitly including <openssl/opensslconf.h> in ssl_toolkit_compat.h
            would make sense, since we're relying on OPENSSL_NO_SSL2 being
            properly reported by OpenSSL (currently opensslconf.h is only
            indirectly included, which seems somewhat brittle)
    sf: I would also have taken the approach suggested by kbrand,
        but I am OK with the approach from patch .2, too.
        Minor (CTR) issues:
        - The "/* only SSLv2 is left */" comment is now obsolete.
        - Needs CHANGES entry.
    rjung: Voted on the basis, that OPENSSL_NO_SSL2 is not meant
           to be set for the web server compile only but instead
           would only be retrieved from OpenSSL. Otherwise
           setting OPENSSL_NO_SSL2 only for the web server compile
           does *not* disable SSLv2 (see r1374734).

PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+19 −10
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ compatibility variables.</p>
 <th>Description:</th>
</tr>
<tr><td><code>HTTPS</code></td>                         <td>flag</td>      <td>HTTPS is being used.</td></tr>
<tr><td><code>SSL_PROTOCOL</code></td>                  <td>string</td>    <td>The SSL protocol version (SSLv2, SSLv3, TLSv1)</td></tr>
<tr><td><code>SSL_PROTOCOL</code></td>                  <td>string</td>    <td>The SSL protocol version (SSLv2, SSLv3, TLSv1, TLSv1.1, TLSv1.2)</td></tr>
<tr><td><code>SSL_SESSION_ID</code></td>                <td>string</td>    <td>The hex-encoded SSL session id</td></tr>
<tr><td><code>SSL_CIPHER</code></td>                    <td>string</td>    <td>The cipher specification name</td></tr>
<tr><td><code>SSL_CIPHER_EXPORT</code></td>             <td>string</td>    <td><code>true</code> if cipher is an export cipher</td></tr>
@@ -1012,20 +1012,29 @@ The available (case-insensitive) <em>protocol</em>s are:</p>

<li><code>TLSv1</code>
    <p>
    This is the Transport Layer Security (TLS) protocol, version 1.0. It is the
    successor to SSLv3 and is defined in <a href="http://www.ietf.org/rfc/rfc2246.txt">RFC2246</a>. 
    Which has been obsoleted by <a href="http://www.ietf.org/rfc/rfc4346.txt">RFC4346</a>.</p></li>
    This is the Transport Layer Security (TLS) protocol, version 1.0.
    It is the successor to SSLv3 and is defined in
    <a href="http://www.ietf.org/rfc/rfc2246.txt">RFC 2246</a>.</p></li>

<li><code>TLSv1.1</code> (when using OpenSSL 1.0.1 and later)
    <p>
    A revision of the TLS 1.0 protocol, as defined in
    <a href="http://www.ietf.org/rfc/rfc4346.txt">RFC 4346</a>.</p></li>

<li><code>TLSv1.2</code> (when using OpenSSL 1.0.1 and later)
    <p>
    A revision of the TLS 1.1 protocol, as defined in
    <a href="http://www.ietf.org/rfc/rfc5246.txt">RFC 5246</a>.</p></li>

<li><code>All</code>
    <p>
    This is a shortcut for ``<code>+SSLv2 +SSLv3 +TLSv1</code>'' and a
    convenient way for enabling all protocols except one when used in
    combination with the minus sign on a protocol as the example above 
    shows.</p></li>
    This is a shortcut for ``<code>+SSLv2 +SSLv3 +TLSv1</code>'' or
    - when using OpenSSL 1.0.1 and later -
    ``<code>+SSLv2 +SSLv3 +TLSv1 +TLSv1.1 +TLSv1.2</code>'', respectively.</p></li>
</ul>
<div class="example"><h3>Example</h3><p><code>
#   enable SSLv3 and TLSv1, but not SSLv2<br />
SSLProtocol all -SSLv2
# enable SSLv3 and all available TLSv1 flavors, but not SSLv2<br />
SSLProtocol All -SSLv2
</code></p></div>

</div>
+19 −10
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ compatibility variables.</p>
 <th>Description:</th>
</tr>
<tr><td><code>HTTPS</code></td>                         <td>flag</td>      <td>HTTPS is being used.</td></tr>
<tr><td><code>SSL_PROTOCOL</code></td>                  <td>string</td>    <td>The SSL protocol version (SSLv2, SSLv3, TLSv1)</td></tr>
<tr><td><code>SSL_PROTOCOL</code></td>                  <td>string</td>    <td>The SSL protocol version (SSLv2, SSLv3, TLSv1, TLSv1.1, TLSv1.2)</td></tr>
<tr><td><code>SSL_SESSION_ID</code></td>                <td>string</td>    <td>The hex-encoded SSL session id</td></tr>
<tr><td><code>SSL_CIPHER</code></td>                    <td>string</td>    <td>The cipher specification name</td></tr>
<tr><td><code>SSL_CIPHER_EXPORT</code></td>             <td>string</td>    <td><code>true</code> if cipher is an export cipher</td></tr>
@@ -562,20 +562,29 @@ The available (case-insensitive) <em>protocol</em>s are:</p>

<li><code>TLSv1</code>
    <p>
    This is the Transport Layer Security (TLS) protocol, version 1.0. It is the
    successor to SSLv3 and is defined in <a href="http://www.ietf.org/rfc/rfc2246.txt">RFC2246</a>. 
    Which has been obsoleted by <a href="http://www.ietf.org/rfc/rfc4346.txt">RFC4346</a>.</p></li>
    This is the Transport Layer Security (TLS) protocol, version 1.0.
    It is the successor to SSLv3 and is defined in
    <a href="http://www.ietf.org/rfc/rfc2246.txt">RFC 2246</a>.</p></li>

<li><code>TLSv1.1</code> (when using OpenSSL 1.0.1 and later)
    <p>
    A revision of the TLS 1.0 protocol, as defined in
    <a href="http://www.ietf.org/rfc/rfc4346.txt">RFC 4346</a>.</p></li>

<li><code>TLSv1.2</code> (when using OpenSSL 1.0.1 and later)
    <p>
    A revision of the TLS 1.1 protocol, as defined in
    <a href="http://www.ietf.org/rfc/rfc5246.txt">RFC 5246</a>.</p></li>

<li><code>All</code>
    <p>
    This is a shortcut for ``<code>+SSLv2 +SSLv3 +TLSv1</code>'' and a
    convenient way for enabling all protocols except one when used in
    combination with the minus sign on a protocol as the example above 
    shows.</p></li>
    This is a shortcut for ``<code>+SSLv2 +SSLv3 +TLSv1</code>'' or
    - when using OpenSSL 1.0.1 and later -
    ``<code>+SSLv2 +SSLv3 +TLSv1 +TLSv1.1 +TLSv1.2</code>'', respectively.</p></li>
</ul>
<example><title>Example</title>
#   enable SSLv3 and TLSv1, but not SSLv2<br />
SSLProtocol all -SSLv2
# enable SSLv3 and all available TLSv1 flavors, but not SSLv2<br />
SSLProtocol All -SSLv2
</example>
</usage>
</directivesynopsis>
+14 −4
Original line number Diff line number Diff line
@@ -141,9 +141,19 @@ static const command_rec ssl_config_cmds[] = {
    SSL_CMD_SRV(SessionCacheTimeout, TAKE1,
                "SSL Session Cache object lifetime "
                "(`N' - number of seconds)")
#ifdef OPENSSL_NO_SSL2
#define SSLv2_PROTO_PREFIX ""
#else
#define SSLv2_PROTO_PREFIX "SSLv2|"
#endif
#ifdef HAVE_TLSV1_X
#define SSL_PROTOCOLS SSLv2_PROTO_PREFIX "SSLv3|TLSv1|TLSv1.1|TLSv1.2"
#else
#define SSL_PROTOCOLS SSLv2_PROTO_PREFIX "SSLv3|TLSv1"
#endif
    SSL_CMD_SRV(Protocol, RAW_ARGS,
                "Enable or disable various SSL protocols "
                "(`[+-][SSLv2|SSLv3|TLSv1] ...' - see manual)")
                "('[+-][" SSL_PROTOCOLS "] ...' - see manual)")
    SSL_CMD_SRV(HonorCipherOrder, FLAG,
                "Use the server's cipher ordering preference")
    SSL_CMD_SRV(InsecureRenegotiation, FLAG,
@@ -161,7 +171,7 @@ static const command_rec ssl_config_cmds[] = {
                "(`on', `off')")
    SSL_CMD_SRV(ProxyProtocol, RAW_ARGS,
                "SSL Proxy: enable or disable SSL protocol flavors "
               "(`[+-][SSLv2|SSLv3|TLSv1] ...' - see manual)")
                "('[+-][" SSL_PROTOCOLS "] ...' - see manual)")
    SSL_CMD_SRV(ProxyCipherSuite, TAKE1,
               "SSL Proxy: colon-delimited list of permitted SSL ciphers "
               "(`XXX:...:XXX' - see manual)")
Loading