Only use SSL_OP_NO_COMPRESSION if it is defined
authorJouni Malinen <j@w1.fi>
Wed, 21 May 2008 07:10:10 +0000 (10:10 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 21 May 2008 07:10:10 +0000 (10:10 +0300)
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.

src/crypto/tls_openssl.c

index cd410a4..0bbe88e 100644 (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) {