]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add SSL_SHARED_CIPHER environment variable
authorDirk-Willem van Gulik <dirkx@apache.org>
Mon, 6 Mar 2023 17:46:04 +0000 (17:46 +0000)
committerDirk-Willem van Gulik <dirkx@apache.org>
Mon, 6 Mar 2023 17:46:04 +0000 (17:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908132 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/mod_ssl.xml
modules/ssl/ssl_engine_kernel.c
modules/ssl/ssl_engine_vars.c

diff --git a/CHANGES b/CHANGES
index 45af2a73d339be8791f51983c07467f538f03eb8..e09c05ea5f0df2853ca7d3f068b62adc9354d334 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) Add a SSL_SHARED_CIPHER environment variable with the list of
+     client/server permitted ciphers. [Dirk-Willem van Gulik]
+
   *) mod_http2: field values (headers and trailers) are stripped of
      leading/trailing whitespace (space +htab) before being processed
      or send in a response. This is compatible behaviour to HTTP/1.1
index dbe3345da796d72b867026755e6cc7c40eac4b52..248fe7524772cfe78a182b26f505094782d6d977 100644 (file)
@@ -66,7 +66,8 @@ compatibility variables.</p>
 <tr><td><code>SSL_SESSION_ID</code></td>                <td>string</td>    <td>The hex-encoded SSL session id</td></tr>
 <tr><td><code>SSL_SESSION_RESUMED</code></td>           <td>string</td>    <td>Initial or Resumed SSL Session.  Note: multiple requests may be served over the same (Initial or Resumed) SSL session if HTTP KeepAlive is in use</td></tr>
 <tr><td><code>SSL_SECURE_RENEG</code></td>              <td>string</td>    <td><code>true</code> if secure renegotiation is supported, else <code>false</code></td></tr>
-<tr><td><code>SSL_CIPHER</code></td>                    <td>string</td>    <td>The cipher specification name</td></tr>
+<tr><td><code>SSL_SHARED_CIPHERS</code></td>            <td>string</td>    <td>Colon separated list of shared ciphers (i.e. the subset of ciphers that are configured on both server and on the client)</td></tr>
+<tr><td><code>SSL_CIPHER</code></td>                    <td>string</td>    <td>The name of the cipher agreed between client and server</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>
 <tr><td><code>SSL_CIPHER_USEKEYSIZE</code></td>         <td>number</td>    <td>Number of cipher bits (actually used)</td></tr>
 <tr><td><code>SSL_CIPHER_ALGKEYSIZE</code></td>         <td>number</td>    <td>Number of cipher bits (possible)</td></tr>
index b5f5379a89e0002e3b2564467354a6c65bf53519..885d3f3d67477e447f824214db2faf13b2b725fa 100644 (file)
@@ -1532,6 +1532,7 @@ static const char *const ssl_hook_Fixup_vars[] = {
     "SSL_SERVER_A_SIG",
     "SSL_SESSION_ID",
     "SSL_SESSION_RESUMED",
+    "SSL_SHARED_CIPHERS",
 #ifdef HAVE_SRP
     "SSL_SRP_USER",
     "SSL_SRP_USERINFO",
index af6c4de1b7cb217be2e02b5186dc7ad92e1dd47f..6ba70fcecbb27d9e12ca1787b09adb020d339896 100644 (file)
@@ -506,6 +506,11 @@ static const char *ssl_var_lookup_ssl(apr_pool_t *p, const SSLConnRec *sslconn,
     else if (ssl != NULL && strcEQ(var, "COMPRESS_METHOD")) {
         result = ssl_var_lookup_ssl_compress_meth(ssl);
     }
+    else if (ssl != NULL && strcEQ(var, "SHARED_CIPHERS")) {
+        char buf[ 1024 * 16 ];
+        if (SSL_get_shared_ciphers(ssl,buf,sizeof(buf)))
+               result = apr_pstrdup(p,buf);
+    }
 #ifdef HAVE_TLSEXT
     else if (ssl != NULL && strcEQ(var, "TLS_SNI")) {
         result = apr_pstrdup(p, SSL_get_servername(ssl,