Remove crypto/comp and SSL_COMP support code.

Now that the consuming code in ssl/ is removed, there is no need for this.
Leave SSL_COMP and STACK_OF(SSL_COMP) for now so as not to break any code which
manipulates the output of SSL_COMP_get_compression_methods to disable
compression.

Change-Id: Idf0a5debd96589ef6e7e56acf5d9259412b7d7a1
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index d25581e..86fb477 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -62,7 +62,6 @@
 add_subdirectory(lhash)
 add_subdirectory(err)
 add_subdirectory(buf)
-add_subdirectory(comp)
 add_subdirectory(base64)
 add_subdirectory(bytestring)
 
@@ -124,7 +123,6 @@
 	$<TARGET_OBJECTS:stack>
 	$<TARGET_OBJECTS:lhash>
 	$<TARGET_OBJECTS:err>
-	$<TARGET_OBJECTS:comp>
 	$<TARGET_OBJECTS:base64>
 	$<TARGET_OBJECTS:bytestring>
 	$<TARGET_OBJECTS:sha>
diff --git a/crypto/base.h b/crypto/base.h
index f9adbb3..8a05899 100644
--- a/crypto/base.h
+++ b/crypto/base.h
@@ -124,8 +124,6 @@
 typedef struct buf_mem_st BUF_MEM;
 typedef struct cbb_st CBB;
 typedef struct cbs_st CBS;
-typedef struct comp_ctx_st COMP_CTX;
-typedef struct comp_method_st COMP_METHOD;
 typedef struct conf_st CONF;
 typedef struct dh_method DH_METHOD;
 typedef struct dh_st DH;
diff --git a/crypto/comp/CMakeLists.txt b/crypto/comp/CMakeLists.txt
deleted file mode 100644
index 0d543ad..0000000
--- a/crypto/comp/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-include_directories(. .. ../../include)
-
-add_library(
-	comp
-
-	OBJECT
-
-	comp.c
-	zlib.c
-)
diff --git a/crypto/comp/comp.c b/crypto/comp/comp.c
deleted file mode 100644
index e4c9a80..0000000
--- a/crypto/comp/comp.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to.  The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *    "This product includes cryptographic software written by
- *     Eric Young (eay@cryptsoft.com)"
- *    The word 'cryptographic' can be left out if the rouines from the library
- *    being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- *    the apps directory (application code) you must include an acknowledgement:
- *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed.  i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.] */
-
-#include <openssl/comp.h>
-
-#include <openssl/mem.h>
-
-
-COMP_CTX *COMP_CTX_new(COMP_METHOD *meth) {
-  COMP_CTX *ret;
-
-  ret = OPENSSL_malloc(sizeof(COMP_CTX));
-  if (ret == NULL) {
-    return NULL;
-  }
-
-  memset(ret, 0, sizeof(COMP_CTX));
-  ret->meth = meth;
-  if (ret->meth->init != NULL && !ret->meth->init(ret)) {
-    OPENSSL_free(ret);
-    ret = NULL;
-  }
-
-  return ret;
-}
-
-void COMP_CTX_free(COMP_CTX *ctx) {
-  if (ctx == NULL) {
-    return;
-  }
-
-  if (ctx->meth->finish != NULL) {
-    ctx->meth->finish(ctx);
-  }
-
-  OPENSSL_free(ctx);
-}
-
-int COMP_compress_block(COMP_CTX *ctx, uint8_t *out, size_t out_len,
-                        uint8_t *in, size_t in_len) {
-  int ret;
-  if (ctx->meth->compress == NULL) {
-    return -1;
-  }
-  ret = ctx->meth->compress(ctx, out, out_len, in, in_len);
-  if (ret > 0) {
-    ctx->compress_in += in_len;
-    ctx->compress_out += ret;
-  }
-  return ret;
-}
-
-int COMP_expand_block(COMP_CTX *ctx, uint8_t *out, size_t out_len, uint8_t *in,
-                      size_t in_len) {
-  int ret;
-
-  if (ctx->meth->expand == NULL) {
-    return -1;
-  }
-  ret = ctx->meth->expand(ctx, out, out_len, in, in_len);
-  if (ret > 0) {
-    ctx->expand_in += in_len;
-    ctx->expand_out += ret;
-  }
-  return ret;
-}
diff --git a/crypto/comp/comp.h b/crypto/comp/comp.h
deleted file mode 100644
index 12a967a..0000000
--- a/crypto/comp/comp.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to.  The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *    "This product includes cryptographic software written by
- *     Eric Young (eay@cryptsoft.com)"
- *    The word 'cryptographic' can be left out if the rouines from the library
- *    being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- *    the apps directory (application code) you must include an acknowledgement:
- *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed.  i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.] */
-
-#ifndef OPENSSL_HEADER_COMP_H
-#define OPENSSL_HEADER_COMP_H
-
-#include <openssl/base.h>
-
-#include <openssl/ex_data.h>
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-
-/* Compression methods */
-
-/* COMP_zlib returns a method that implements standard, zlib compression. */
-COMP_METHOD *COMP_zlib(void);
-
-
-/* Compression contexts */
-
-/* COMP_CTX_new allocates a fresh |COMP_CTX| which will compress with the given
- * compression method. It returns the new |COMP_CTX| or NULL on error. */
-COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
-
-/* COMP_CTX_free frees all data owned by |ctx| and |ctx| itself. */
-void COMP_CTX_free(COMP_CTX *ctx);
-
-
-int COMP_compress_block(COMP_CTX *ctx, uint8_t *out, size_t out_len,
-                        uint8_t *in, size_t in_len);
-
-int COMP_expand_block(COMP_CTX *ctx, uint8_t *out, size_t out_len,
-                      uint8_t *in, size_t in_len);
-
-
-/* Private functions */
-
-struct comp_ctx_st {
-  COMP_METHOD *meth;
-  unsigned long compress_in;
-  unsigned long compress_out;
-  unsigned long expand_in;
-  unsigned long expand_out;
-
-  CRYPTO_EX_DATA ex_data;
-};
-
-struct comp_method_st {
-  int type;         /* NID for compression library */
-  const char *name; /* A text string to identify the library */
-  int (*init)(COMP_CTX *ctx);
-  void (*finish)(COMP_CTX *ctx);
-  int (*compress)(COMP_CTX *ctx, uint8_t *out, unsigned int olen, uint8_t *in,
-                  unsigned int ilen);
-  int (*expand)(COMP_CTX *ctx, uint8_t *out, unsigned int olen, uint8_t *in,
-                unsigned int ilen);
-  /* The following two do NOTHING, but are kept for backward compatibility */
-  long (*ctrl)(void);
-  long (*callback_ctrl)(void);
-} /* COMP_METHOD */;
-
-
-#if defined(__cplusplus)
-}  /* extern C */
-#endif
-
-#endif  /* OPENSSL_HEADER_HMAC_H */
diff --git a/crypto/comp/zlib.c b/crypto/comp/zlib.c
deleted file mode 100644
index 627fdc3..0000000
--- a/crypto/comp/zlib.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to.  The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *    "This product includes cryptographic software written by
- *     Eric Young (eay@cryptsoft.com)"
- *    The word 'cryptographic' can be left out if the rouines from the library
- *    being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- *    the apps directory (application code) you must include an acknowledgement:
- *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed.  i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.] */
-
-#include <openssl/comp.h>
-
-
-COMP_METHOD *COMP_zlib(void) {
-  return NULL;
-}
diff --git a/include/openssl/comp.h b/include/openssl/comp.h
deleted file mode 120000
index 712c9d4..0000000
--- a/include/openssl/comp.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/comp/comp.h
\ No newline at end of file
diff --git a/ssl/d1_enc.c b/ssl/d1_enc.c
index 8e2cdc8..70b74b8 100644
--- a/ssl/d1_enc.c
+++ b/ssl/d1_enc.c
@@ -114,7 +114,6 @@
 #include <stdio.h>
 #include <assert.h>
 
-#include <openssl/comp.h>
 #include <openssl/evp.h>
 #include <openssl/hmac.h>
 #include <openssl/md5.h>
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index 4a557f6..baac2aa 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -366,17 +366,10 @@
 	const EVP_MD *hash;
 	size_t num;
 	int ret = 0;
-	SSL_COMP *comp;
 
 	if (s->s3->tmp.key_block_length != 0)
 		return(1);
 
-	if (!ssl_cipher_get_comp(s->session, &comp))
-		{
-		OPENSSL_PUT_ERROR(SSL, ssl3_setup_key_block, SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
-		return(0);
-		}
-
 	if (!ssl_cipher_get_evp(s->session,&c,&hash,NULL,NULL))
 		{
 		OPENSSL_PUT_ERROR(SSL, ssl3_setup_key_block, SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
diff --git a/ssl/ssl.h b/ssl/ssl.h
index bff4f6a..aee417f 100644
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -1042,7 +1042,6 @@
 	const EVP_MD *sha1;   /* For SSLv3/TLSv1 'ssl3->sha1' */
 
 	STACK_OF(X509) *extra_certs;
-	STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
 
 
 	/* Default values used when no per-SSL value is defined follow */
@@ -2261,7 +2260,6 @@
 SSL_SESSION *SSL_SESSION_new(void);
 const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
 					unsigned int *len);
-unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s);
 #ifndef OPENSSL_NO_FP_API
 int	SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses);
 #endif
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 6bfbdee..2ccc9e5 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -141,7 +141,6 @@
 #include <stdio.h>
 #include <assert.h>
 
-#include <openssl/comp.h>
 #include <openssl/engine.h>
 #include <openssl/mem.h>
 #include <openssl/obj.h>
@@ -173,8 +172,6 @@
 #define SSL_COMP_ZLIB_IDX	1
 #define SSL_COMP_NUM_IDX	2
 
-static STACK_OF(SSL_COMP) *ssl_comp_methods=NULL;
-
 #define SSL_MD_MD5_IDX	0
 #define SSL_MD_SHA1_IDX	1
 #define SSL_MD_GOST94_IDX 2
@@ -352,27 +349,6 @@
 	ssl_mac_secret_size[SSL_MD_SHA384_IDX]= EVP_MD_size(EVP_sha384());
 	}
 
-/* ssl_cipher_get_comp sets |comp| to the correct SSL_COMP for the given
- * session and returns 1. On error it returns 0. */
-int ssl_cipher_get_comp(const SSL_SESSION *s, SSL_COMP **comp)
-	{
-	size_t index;
-
-	SSL_COMP ctmp;
-
-	*comp=NULL;
-	ctmp.id=s->compress_meth;
-	if (ssl_comp_methods != NULL)
-		{
-		if (sk_SSL_COMP_find(ssl_comp_methods, &index, &ctmp))
-			*comp=sk_SSL_COMP_value(ssl_comp_methods,index);
-		else
-			*comp=NULL;
-		}
-
-	return 1;
-	}
-
 /* ssl_cipher_get_evp_aead sets |*aead| to point to the correct EVP_AEAD object
  * for |s->cipher|. It returns 1 on success and 0 on error. */
 int ssl_cipher_get_evp_aead(const SSL_SESSION *s, const EVP_AEAD **aead)
@@ -1835,22 +1811,6 @@
 	return c->id;
 	}
 
-SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n)
-	{
-	SSL_COMP *ctmp;
-	int i,nn;
-
-	if ((n == 0) || (sk == NULL)) return(NULL);
-	nn=sk_SSL_COMP_num(sk);
-	for (i=0; i<nn; i++)
-		{
-		ctmp=sk_SSL_COMP_value(sk,i);
-		if (ctmp->id == n)
-			return(ctmp);
-		}
-	return(NULL);
-	}
-
 void *SSL_COMP_get_compression_methods(void)
 	{
 	return NULL;
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 50a36dc..d9fb695 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -2113,9 +2113,6 @@
 	CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_CTX, ret, &ret->ex_data);
 
 	ret->extra_certs=NULL;
-	/* No compression for DTLS */
-	if (meth->version != DTLS1_VERSION)
-		ret->comp_methods=SSL_COMP_get_compression_methods();
 
 	ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;
 
@@ -2196,11 +2193,6 @@
 	return(NULL);
 	}
 
-#if 0
-static void SSL_COMP_free(SSL_COMP *comp)
-    { OPENSSL_free(comp); }
-#endif
-
 #ifndef OPENSSL_NO_BUF_FREELISTS
 static void
 ssl_buf_freelist_free(SSL3_BUF_FREELIST *list)
@@ -2268,12 +2260,6 @@
 		sk_X509_NAME_pop_free(a->client_CA,X509_NAME_free);
 	if (a->extra_certs != NULL)
 		sk_X509_pop_free(a->extra_certs,X509_free);
-#if 0 /* This should never be done, since it removes a global database */
-	if (a->comp_methods != NULL)
-		sk_SSL_COMP_pop_free(a->comp_methods,SSL_COMP_free);
-#else
-	a->comp_methods = NULL;
-#endif
 
         if (a->srtp_profiles)
                 sk_SRTP_PROTECTION_PROFILE_free(a->srtp_profiles);
diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h
index e33e07f..7390025 100644
--- a/ssl/ssl_locl.h
+++ b/ssl/ssl_locl.h
@@ -760,16 +760,6 @@
 	char variable_nonce_included_in_record;
 	};
 
-#ifndef OPENSSL_NO_COMP
-/* Used for holding the relevant compression methods loaded into SSL_CTX */
-typedef struct ssl3_comp_st
-	{
-	int comp_id;	/* The identifier byte for this compression type */
-	char *name;	/* Text name used for the compression type */
-	COMP_METHOD *method; /* The method :-) */
-	} SSL3_COMP;
-#endif
-
 #ifndef OPENSSL_NO_BUF_FREELISTS
 typedef struct ssl3_buf_freelist_st
 	{
@@ -1016,7 +1006,6 @@
 struct ssl_cipher_preference_list_st* ssl_cipher_preference_list_from_ciphers(
 	STACK_OF(SSL_CIPHER) *ciphers);
 struct ssl_cipher_preference_list_st* ssl_get_cipher_preferences(SSL *s);
-int ssl_cipher_get_comp(const SSL_SESSION *s, SSL_COMP **comp);
 int ssl_cipher_get_evp_aead(const SSL_SESSION *s, const EVP_AEAD **aead);
 int ssl_cipher_get_evp(const SSL_SESSION *s,const EVP_CIPHER **enc,
 		       const EVP_MD **md,int *mac_pkey_type,int *mac_secret_size);
@@ -1280,8 +1269,6 @@
 int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s);
 #endif
 
-SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n);
-
 char ssl_early_callback_init(struct ssl_early_callback_ctx *ctx);
 #ifndef OPENSSL_NO_EC
 int tls1_ec_curve_id2nid(int curve_id);
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 0e7d4ae..2fd57dc 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -213,7 +213,6 @@
 	ss->time=(unsigned long)time(NULL);
 	ss->prev=NULL;
 	ss->next=NULL;
-	ss->compress_meth=0;
 #ifndef OPENSSL_NO_TLSEXT
 	ss->tlsext_hostname = NULL; 
 #ifndef OPENSSL_NO_EC
@@ -238,11 +237,6 @@
 	return s->session_id;
 	}
 
-unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s)
-	{
-	return s->compress_meth;
-	}
-
 /* Even with SSLv2, we have 16 bytes (128 bits) of session ID space. SSLv3/TLSv1
  * has 32 bytes (256 bits). As such, filling the ID with random gunk repeatedly
  * until we have no conflict is going to complete in one iteration pretty much
diff --git a/ssl/ssl_txt.c b/ssl/ssl_txt.c
index 6d3009a..08c0752 100644
--- a/ssl/ssl_txt.c
+++ b/ssl/ssl_txt.c
@@ -133,19 +133,8 @@
 
 	if (x->cipher == NULL)
 		{
-		SSL_COMP *comp = NULL;
-
-		ssl_cipher_get_comp(x, &comp);
-		if (comp == NULL)
-			{
-			if (BIO_printf(bp,"    Cipher    : %06lX\n",x->cipher_id&0xffffff) <= 0)
-				goto err;
-			}
-		else
-			{
-			if (BIO_printf(bp,"    Cipher    : %04lX\n",x->cipher_id&0xffff) <= 0)
-				goto err;
-			}
+		if (BIO_printf(bp,"    Cipher    : %06lX\n",x->cipher_id&0xffffff) <= 0)
+			goto err;
 		}
 	else
 		{
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c
index 58640f8..9c16835 100644
--- a/ssl/t1_enc.c
+++ b/ssl/t1_enc.c
@@ -136,7 +136,6 @@
 #include <stdio.h>
 #include <assert.h>
 
-#include <openssl/comp.h>
 #include <openssl/err.h>
 #include <openssl/evp.h>
 #include <openssl/hmac.h>
@@ -645,7 +644,6 @@
 	const EVP_MD *hash = NULL;
 	const EVP_AEAD *aead = NULL;
 	int num;
-	SSL_COMP *comp;
 	int mac_type= NID_undef,mac_secret_size=0;
 	int ret=0;
 	unsigned key_len, iv_len;
@@ -657,9 +655,6 @@
 	if (s->s3->tmp.key_block_length != 0)
 		return(1);
 
-	if (!ssl_cipher_get_comp(s->session, &comp))
-		goto cipher_unavailable_err;
-
 	if (s->session->cipher &&
 	    (s->session->cipher->algorithm2 & SSL_CIPHER_ALGORITHM2_AEAD))
 		{