提交 45ddce21 编写于 作者: R Rich Salz 提交者: Rich Salz

Remove the fake RLE compression method.

RLE is a no-op only for testing.  Remove it.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 0fd75c7e
......@@ -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
......
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/objects.h>
#include <openssl/comp.h>
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);
}
......@@ -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"
......
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册