Only use SSL_OP_NO_COMPRESSION if it is defined

It looks like this SSL_set_options() value was added in 0.9.9 and it does
not exist in stable releases of OpenSSL. Fix build by using #ifdef on this
variable before use.
This commit is contained in:
Jouni Malinen 2008-05-21 10:10:10 +03:00
parent 1f358437d3
commit fca25ef4b4

View file

@ -877,6 +877,7 @@ struct tls_connection * tls_connection_init(void *ssl_ctx)
{
SSL_CTX *ssl = ssl_ctx;
struct tls_connection *conn;
long options;
conn = os_zalloc(sizeof(*conn));
if (conn == NULL)
@ -890,9 +891,12 @@ struct tls_connection * tls_connection_init(void *ssl_ctx)
}
SSL_set_app_data(conn->ssl, conn);
SSL_set_options(conn->ssl,
SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 |
SSL_OP_SINGLE_DH_USE | SSL_OP_NO_COMPRESSION);
options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 |
SSL_OP_SINGLE_DH_USE;
#ifdef SSL_OP_NO_COMPRESSION
options |= SSL_OP_NO_COMPRESSION;
#endif /* SSL_OP_NO_COMPRESSION */
SSL_set_options(conn->ssl, options);
conn->ssl_in = BIO_new(BIO_s_mem());
if (!conn->ssl_in) {