From 45ddce21fa4c2fdcfe48fb3f7e0ca78531a7b922 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Sat, 2 May 2015 11:19:06 -0400 Subject: [PATCH] Remove the fake RLE compression method. RLE is a no-op only for testing. Remove it. Reviewed-by: Richard Levitte --- crypto/comp/Makefile | 11 ++------ crypto/comp/c_rle.c | 62 ------------------------------------------- crypto/crypto-lib.com | 2 +- test/ssltest.c | 13 +++------ 4 files changed, 6 insertions(+), 82 deletions(-) delete mode 100644 crypto/comp/c_rle.c diff --git a/crypto/comp/Makefile b/crypto/comp/Makefile index 4d1ef529f5..1a180f49df 100644 --- a/crypto/comp/Makefile +++ b/crypto/comp/Makefile @@ -16,10 +16,10 @@ GENERAL=Makefile LIB=$(TOP)/libcrypto.a LIBSRC= comp_lib.c comp_err.c \ - c_rle.c c_zlib.c + c_zlib.c LIBOBJ= comp_lib.o comp_err.o \ - c_rle.o c_zlib.o + c_zlib.o SRC= $(LIBSRC) @@ -61,13 +61,6 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. -c_rle.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -c_rle.o: ../../include/openssl/comp.h ../../include/openssl/crypto.h -c_rle.o: ../../include/openssl/e_os2.h ../../include/openssl/obj_mac.h -c_rle.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -c_rle.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -c_rle.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -c_rle.o: ../../include/openssl/symhacks.h c_rle.c c_zlib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h c_zlib.o: ../../include/openssl/comp.h ../../include/openssl/crypto.h c_zlib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h diff --git a/crypto/comp/c_rle.c b/crypto/comp/c_rle.c deleted file mode 100644 index adf1663181..0000000000 --- a/crypto/comp/c_rle.c +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include -#include -#include -#include - -static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, - unsigned int olen, unsigned char *in, - unsigned int ilen); -static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, - unsigned int olen, unsigned char *in, - unsigned int ilen); - -static COMP_METHOD rle_method = { - NID_rle_compression, - LN_rle_compression, - NULL, - NULL, - rle_compress_block, - rle_expand_block, - NULL, - NULL, -}; - -COMP_METHOD *COMP_rle(void) -{ - return (&rle_method); -} - -static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, - unsigned int olen, unsigned char *in, - unsigned int ilen) -{ - /* int i; */ - - if (olen < (ilen + 1)) { - /* ZZZZZZZZZZZZZZZZZZZZZZ */ - return (-1); - } - - *(out++) = 0; - memcpy(out, in, ilen); - return (ilen + 1); -} - -static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, - unsigned int olen, unsigned char *in, - unsigned int ilen) -{ - int i; - - if (ilen == 0 || olen < (ilen - 1)) { - /* ZZZZZZZZZZZZZZZZZZZZZZ */ - return (-1); - } - - i = *(in++); - if (i == 0) { - memcpy(out, in, ilen - 1); - } - return (ilen - 1); -} diff --git a/crypto/crypto-lib.com b/crypto/crypto-lib.com index 94955995c4..02f874190c 100644 --- a/crypto/crypto-lib.com +++ b/crypto/crypto-lib.com @@ -339,7 +339,7 @@ $ LIB_PKCS12 = "p12_add,p12_asn,p12_attr,p12_crpt,p12_crt,p12_decr,"+ - "p12_init,p12_key,p12_kiss,p12_mutl,"+ - "p12_utl,p12_npas,pk12err,p12_p8d,p12_p8e" $ LIB_COMP = "comp_lib,comp_err,"+ - - "c_rle,c_zlib" + "c_zlib" $ LIB_OCSP = "ocsp_asn,ocsp_ext,ocsp_ht,ocsp_lib,ocsp_cl,"+ - "ocsp_srv,ocsp_prn,ocsp_vfy,ocsp_err,v3_ocsp" $ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util" diff --git a/test/ssltest.c b/test/ssltest.c index 8b5ff3e426..35df0f7881 100644 --- a/test/ssltest.c +++ b/test/ssltest.c @@ -219,10 +219,9 @@ #endif /* - * There is really no standard for this, so let's assign some tentative - * numbers. In any case, these numbers are only for this test + * There is really no standard for this, so let's assign something + * only for this test */ -#define COMP_RLE 255 #define COMP_ZLIB 1 static int verify_callback(int ok, X509_STORE_CTX *ctx); @@ -804,7 +803,6 @@ static void sv_usage(void) fprintf(stderr, " -time - measure processor time used by client and server\n"); fprintf(stderr, " -zlib - use zlib compression\n"); - fprintf(stderr, " -rle - use rle compression\n"); #ifndef OPENSSL_NO_EC fprintf(stderr, " -named_curve arg - Elliptic curve name to use for ephemeral ECDH keys.\n" @@ -1212,8 +1210,6 @@ int main(int argc, char *argv[]) #ifndef OPENSSL_NO_COMP else if (strcmp(*argv, "-zlib") == 0) { comp = COMP_ZLIB; - } else if (strcmp(*argv, "-rle") == 0) { - comp = COMP_RLE; } #endif else if (strcmp(*argv, "-named_curve") == 0) { @@ -1376,8 +1372,6 @@ int main(int argc, char *argv[]) #ifndef OPENSSL_NO_COMP if (comp == COMP_ZLIB) cm = COMP_zlib(); - if (comp == COMP_RLE) - cm = COMP_rle(); if (cm != NULL) { if (cm->type != NID_undef) { if (SSL_COMP_add_compression_method(comp, cm) != 0) { @@ -1387,8 +1381,7 @@ int main(int argc, char *argv[]) } else { fprintf(stderr, "Warning: %s compression not supported\n", - (comp == COMP_RLE ? "rle" : - (comp == COMP_ZLIB ? "zlib" : "unknown"))); + comp == COMP_ZLIB ? "zlib" : "unknown"); ERR_print_errors_fp(stderr); } } -- 2.25.1