1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

If OPENSSL_NO_COMP is defined, omit merging the compression flag.

Also make some code more compact, as suggested by kbrand.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1348656 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Fritsch
2012-06-10 20:21:38 +00:00
parent 6dd8ce1c33
commit 88d5d9dbb2
3 changed files with 18 additions and 9 deletions

View File

@@ -213,7 +213,9 @@ static SSLSrvConfigRec *ssl_config_server_new(apr_pool_t *p)
#ifdef HAVE_FIPS
sc->fips = UNSET;
#endif
#ifndef OPENSSL_NO_COMP
sc->compression = UNSET;
#endif
modssl_ctx_init_proxy(sc, p);
@@ -340,7 +342,9 @@ void *ssl_config_server_merge(apr_pool_t *p, void *basev, void *addv)
#ifdef HAVE_FIPS
cfgMergeBool(fips);
#endif
#ifndef OPENSSL_NO_COMP
cfgMergeBool(compression);
#endif
modssl_ctx_cfg_merge_proxy(base->proxy, add->proxy, mrg->proxy);
@@ -678,7 +682,7 @@ static const char *ssl_cmd_check_file(cmd_parms *parms,
const char *ssl_cmd_SSLCompression(cmd_parms *cmd, void *dcfg, int flag)
{
#if defined(SSL_OP_NO_COMPRESSION) || OPENSSL_VERSION_NUMBER >= 0x00908000L
#if !defined(OPENSSL_NO_COMP)
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
#ifndef SSL_OP_NO_COMPRESSION
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);

View File

@@ -654,17 +654,15 @@ static void ssl_init_ctx_protocol(server_rec *s,
}
#endif
#ifndef OPENSSL_NO_COMP
if (sc->compression == FALSE) {
#ifdef SSL_OP_NO_COMPRESSION
/* OpenSSL >= 1.0 only */
if (sc->compression == FALSE) {
/* OpenSSL >= 1.0 only */
SSL_CTX_set_options(ctx, SSL_OP_NO_COMPRESSION);
}
#elif OPENSSL_VERSION_NUMBER >= 0x00908000L
/* workaround for OpenSSL 0.9.8 */
if (sc->compression == FALSE) {
STACK_OF(SSL_COMP)* comp_methods;
comp_methods = SSL_COMP_get_compression_methods();
sk_SSL_COMP_zero(comp_methods);
sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
#endif
}
#endif

View File

@@ -185,6 +185,11 @@
#define HAVE_TLSV1_X
#endif
#if !defined(OPENSSL_NO_COMP) && !defined(SSL_OP_NO_COMPRESSION) \
&& OPENSSL_VERSION_NUMBER < 0x00908000L
#define OPENSSL_NO_COMP
#endif
/* SRP support came in OpenSSL 1.0.1 */
#ifndef OPENSSL_NO_SRP
#ifdef SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB
@@ -693,7 +698,9 @@ struct SSLSrvConfigRec {
#ifdef HAVE_FIPS
BOOL fips;
#endif
#ifndef OPENSSL_NO_COMP
BOOL compression;
#endif
};
/**