From: Nikos Mavrogiannopoulos Date: Sun, 10 Apr 2011 21:17:39 +0000 (+0200) Subject: Support for liblzo was dropped. X-Git-Tag: gnutls_2_99_1~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cea96577fa0ae1f2de4d679a591d1e4e9045dbe0;p=thirdparty%2Fgnutls.git Support for liblzo was dropped. --- diff --git a/NEWS b/NEWS index b55d2e9688..12b751b4c6 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ See the end for copying conditions. * Version 2.99.1 (unreleased) +** libgnutls-extra: Dropped support of LZO compression via liblzo. + ** API and ABI modifications: No changes since last version. diff --git a/configure.ac b/configure.ac index 829aec329e..6e327ff6f2 100644 --- a/configure.ac +++ b/configure.ac @@ -333,7 +333,7 @@ fi AM_CONDITIONAL(HAVE_GUILE, test "$opt_guile_bindings" = "yes") -LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LZO_LIBS $LIBGNUTLS_LIBS" +LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LIBGNUTLS_LIBS" LIBGNUTLS_EXTRA_CFLAGS="-I${includedir}" AC_SUBST(LIBGNUTLS_EXTRA_LIBS) AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS) diff --git a/doc/cha-intro-tls.texi b/doc/cha-intro-tls.texi index 3439ceba6f..ae71f039d1 100644 --- a/doc/cha-intro-tls.texi +++ b/doc/cha-intro-tls.texi @@ -236,12 +236,6 @@ The supported compression algorithms are: @item DEFLATE Zlib compression, using the deflate algorithm. -@item LZO -LZO is a very fast compression algorithm. This algorithm is only -available if the @acronym{GnuTLS-extra} library has been initialized -and the private extensions are enabled, and if GnuTLS was built with -LZO support. - @end table @node Weaknesses and countermeasures diff --git a/doc/cha-preface.texi b/doc/cha-preface.texi index 1c4058bf45..10e41d61fd 100644 --- a/doc/cha-preface.texi +++ b/doc/cha-preface.texi @@ -122,9 +122,8 @@ distribution archive. Typically you invoke @code{./configure} and then @code{make check install}. There are a number of compile-time parameters, as discussed below. -The compression libraries (libz and lzo) are optional dependencies. -You can get libz from @url{http://www.zlib.net/}. You can get lzo -from @url{http://www.oberhumer.com/opensource/lzo/}. +The compression library (libz) is an optional dependency. +You can get libz from @url{http://www.zlib.net/}. The X.509 part of GnuTLS needs ASN.1 functionality, from a library called libtasn1. A copy of libtasn1 is included in GnuTLS. If you diff --git a/doc/cha-programs.texi b/doc/cha-programs.texi index 2f44e8368d..8b9aea55d2 100644 --- a/doc/cha-programs.texi +++ b/doc/cha-programs.texi @@ -506,7 +506,6 @@ Checking for ARCFOUR 40 cipher support... no Checking for MD5 MAC support... yes Checking for SHA1 MAC support... yes Checking for ZLIB compression support (TLS extension)... yes -Checking for LZO compression support (GnuTLS extension)... yes Checking for max record size (TLS extension)... yes Checking for SRP authentication support (TLS extension)... yes Checking for OpenPGP authentication support (TLS extension)... no diff --git a/lib/gnutls_compress.c b/lib/gnutls_compress.c index b0f67ce5ed..67db1fad2f 100644 --- a/lib/gnutls_compress.c +++ b/lib/gnutls_compress.c @@ -103,9 +103,6 @@ gnutls_compression_entry _gnutls_compression_algorithms[MAX_COMP_METHODS] = { }; static const gnutls_compression_method_t supported_compressions[] = { -#ifdef USE_LZO - GNUTLS_COMP_LZO, -#endif #ifdef HAVE_LIBZ GNUTLS_COMP_DEFLATE, #endif @@ -168,9 +165,7 @@ gnutls_compression_get_id (const char *name) /** * gnutls_compression_list: * - * Get a list of compression methods. Note that to be able to use LZO - * compression, you must link to libgnutls-extra and call - * gnutls_global_init_extra(). + * Get a list of compression methods. * * Returns: a zero-terminated list of #gnutls_compression_method_t * integers indicating the available compression methods. @@ -299,26 +294,6 @@ _gnutls_supported_compression_methods (gnutls_session_t session, } -#ifdef USE_LZO -#ifdef USE_MINILZO -/* Get the prototypes only. Since LZO is a GPLed library, the - * gnutls_global_init_extra() has to be called, before LZO compression - * can be used. - */ -#include "../libextra/minilzo/minilzo.h" -#elif HAVE_LZO_LZO1X_H -#include -#elif HAVE_LZO1X_H -#include -#endif - -typedef int (*LZO_FUNC) (); - -LZO_FUNC _gnutls_lzo1x_decompress_safe = NULL; -LZO_FUNC _gnutls_lzo1x_1_compress = NULL; - -#endif - /* The flag d is the direction (compress, decompress). Non zero is * decompress. */ @@ -380,21 +355,6 @@ _gnutls_comp_init (gnutls_compression_method_t method, int d) } } break; -#endif - case GNUTLS_COMP_LZO: -#ifdef USE_LZO - /* LZO does not use memory on decompressor */ - if (!d) - { - ret->handle = gnutls_malloc (LZO1X_1_MEM_COMPRESS); - - if (ret->handle == NULL) - { - gnutls_assert (); - goto cleanup_ret; - } - } - break; #endif case GNUTLS_COMP_NULL: case GNUTLS_COMP_UNKNOWN: @@ -459,39 +419,6 @@ _gnutls_compress (comp_hd_t handle, const opaque * plain, switch (handle->algo) { -#ifdef USE_LZO - case GNUTLS_COMP_LZO: - { - lzo_uint out_len; - size_t size; - int err; - - if (_gnutls_lzo1x_1_compress == NULL) - return GNUTLS_E_COMPRESSION_FAILED; - - size = plain_size + plain_size / 64 + 16 + 3; - *compressed = gnutls_malloc (size); - if (*compressed == NULL) - { - gnutls_assert (); - return GNUTLS_E_MEMORY_ERROR; - } - - err = _gnutls_lzo1x_1_compress (plain, plain_size, *compressed, - &out_len, handle->handle); - - if (err != LZO_E_OK) - { - gnutls_assert (); - gnutls_free (*compressed); - *compressed = NULL; - return GNUTLS_E_COMPRESSION_FAILED; - } - - compressed_size = out_len; - break; - } -#endif #ifdef HAVE_LIBZ case GNUTLS_COMP_DEFLATE: { @@ -574,51 +501,6 @@ _gnutls_decompress (comp_hd_t handle, opaque * compressed, switch (handle->algo) { -#ifdef USE_LZO - case GNUTLS_COMP_LZO: - { - lzo_uint out_size; - lzo_uint new_size; - int err; - - if (_gnutls_lzo1x_decompress_safe == NULL) - return GNUTLS_E_DECOMPRESSION_FAILED; - - *plain = NULL; - out_size = compressed_size + compressed_size; - plain_size = 0; - - do - { - out_size += 512; - *plain = gnutls_realloc_fast (*plain, out_size); - if (*plain == NULL) - { - gnutls_assert (); - return GNUTLS_E_MEMORY_ERROR; - } - - new_size = out_size; - err = - _gnutls_lzo1x_decompress_safe (compressed, - compressed_size, *plain, - &new_size, NULL); - - } - while ((err == LZO_E_OUTPUT_OVERRUN && out_size < max_record_size)); - - if (err != LZO_E_OK) - { - gnutls_assert (); - gnutls_free (*plain); - *plain = NULL; - return GNUTLS_E_DECOMPRESSION_FAILED; - } - - plain_size = new_size; - break; - } -#endif #ifdef HAVE_LIBZ case GNUTLS_COMP_DEFLATE: { diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c index 3ba8a1a67a..c87f1cfec6 100644 --- a/lib/gnutls_errors.c +++ b/lib/gnutls_errors.c @@ -224,8 +224,6 @@ static const gnutls_error_entry error_algorithms[] = { GNUTLS_E_OPENPGP_KEYRING_ERROR, 1), ERROR_ENTRY (N_("The initialization of crypto backend has failed."), GNUTLS_E_CRYPTO_INIT_FAILED, 1), - ERROR_ENTRY (N_("The initialization of LZO has failed."), - GNUTLS_E_LZO_INIT_FAILED, 1), ERROR_ENTRY (N_("No supported compression algorithms have been found."), GNUTLS_E_NO_COMPRESSION_ALGORITHMS, 1), ERROR_ENTRY (N_("No supported cipher suites have been found."), diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c index ed3037db5c..bce13df080 100644 --- a/lib/gnutls_state.c +++ b/lib/gnutls_state.c @@ -764,9 +764,8 @@ _gnutls_record_set_default_version (gnutls_session_t session, * suites (the ones that start with 0xFF). By default or if @allow * is 0 then these cipher suites will not be advertized nor used. * - * Unless this function is called with the option to allow (1), then - * no compression algorithms, like LZO. That is because these - * algorithms are not yet defined in any RFC or even internet draft. + * Currently GnuTLS does not include such cipher-suites or + * compression algorithms. * * Enabling the private ciphersuites when talking to other than * gnutls servers and clients may cause interoperability problems. diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index 75521da663..12f8d73f2f 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -263,7 +263,6 @@ extern "C" * @GNUTLS_COMP_NULL: The NULL compression method (uncompressed). * @GNUTLS_COMP_DEFLATE: The deflate/zlib compression method. * @GNUTLS_COMP_ZLIB: Same as %GNUTLS_COMP_DEFLATE. - * @GNUTLS_COMP_LZO: The non-standard LZO compression method. * * Enumeration of different TLS compression methods. */ @@ -273,9 +272,6 @@ extern "C" GNUTLS_COMP_NULL = 1, GNUTLS_COMP_DEFLATE = 2, GNUTLS_COMP_ZLIB = GNUTLS_COMP_DEFLATE, - GNUTLS_COMP_LZO = 3 /* only available if gnutls-extra has - been initialized - */ } gnutls_compression_method_t; /** @@ -1644,7 +1640,6 @@ extern "C" */ #define GNUTLS_E_NO_TEMPORARY_RSA_PARAMS -84 -#define GNUTLS_E_LZO_INIT_FAILED -85 #define GNUTLS_E_NO_COMPRESSION_ALGORITHMS -86 #define GNUTLS_E_NO_CIPHER_SUITES -87 diff --git a/lib/libgnutls.map b/lib/libgnutls.map index f5d967e4fa..2efb8dfe9f 100644 --- a/lib/libgnutls.map +++ b/lib/libgnutls.map @@ -717,8 +717,6 @@ GNUTLS_PRIVATE { # Internal symbols needed by libgnutls-extra for LZO: _gnutls_compression_algorithms; _gnutls_comp_algorithms_size; - _gnutls_lzo1x_decompress_safe; - _gnutls_lzo1x_1_compress; # Internal symbols needed by libgnutls-openssl: _gnutls_pkix1_asn; _gnutls_x509_parse_dn_oid; diff --git a/libextra/gnutls_extra.c b/libextra/gnutls_extra.c index 302b092a68..bdcbfccf7e 100644 --- a/libextra/gnutls_extra.c +++ b/libextra/gnutls_extra.c @@ -25,69 +25,12 @@ #include #include #include +#include #ifdef HAVE_GCRYPT #include #endif -#ifdef USE_LZO -#ifdef USE_MINILZO -#include "minilzo/minilzo.h" -#elif HAVE_LZO_LZO1X_H -#include -#elif HAVE_LZO1X_H -#include -#endif -#endif -#include - -#ifdef USE_LZO -#include - -/* the number of the compression algorithms available in the compression - * structure. - */ -extern int _gnutls_comp_algorithms_size; - -typedef int (*LZO_FUNC) (); -extern LZO_FUNC _gnutls_lzo1x_decompress_safe; -extern LZO_FUNC _gnutls_lzo1x_1_compress; - -extern gnutls_compression_entry _gnutls_compression_algorithms[]; - -static int -_gnutls_add_lzo_comp (void) -{ - int i; - - /* find the last element */ - for (i = 0; i < _gnutls_comp_algorithms_size; i++) - { - if (_gnutls_compression_algorithms[i].name == NULL) - break; - } - - if (_gnutls_compression_algorithms[i].name == NULL - && (i < _gnutls_comp_algorithms_size - 1)) - { - _gnutls_compression_algorithms[i].name = "GNUTLS_COMP_LZO"; - _gnutls_compression_algorithms[i].id = GNUTLS_COMP_LZO; - _gnutls_compression_algorithms[i].num = 0xf2; - - _gnutls_compression_algorithms[i + 1].name = 0; - - /* Now enable the lzo functions: */ - _gnutls_lzo1x_decompress_safe = lzo1x_decompress_safe; - _gnutls_lzo1x_1_compress = lzo1x_1_compress; - - return 0; /* ok */ - } - - - return GNUTLS_E_MEMORY_ERROR; -} -#endif - static int _gnutls_init_extra = 0; /** @@ -123,28 +66,6 @@ gnutls_global_init_extra (void) if (_gnutls_init_extra != 1) return 0; - /* Initialize the LZO library - */ -#ifdef USE_LZO - if (lzo_init () != LZO_E_OK) - return GNUTLS_E_LZO_INIT_FAILED; - - /* Add the LZO compression method in the list of compression - * methods. - */ - { - int ret; - - ret = _gnutls_add_lzo_comp (); - if (ret < 0) - { - gnutls_assert (); - return ret; - } - } -#endif - - #ifdef HAVE_GCRYPT #ifdef gcry_fips_mode_active /* Libgcrypt manual says that gcry_version_check must be called diff --git a/m4/hooks.m4 b/m4/hooks.m4 index c629e6f3a9..76a366cb94 100644 --- a/m4/hooks.m4 +++ b/m4/hooks.m4 @@ -156,35 +156,6 @@ fi fi - AC_ARG_WITH(lzo, - AS_HELP_STRING([--with-lzo], [use experimental LZO compression]), - use_lzo=$withval, use_lzo=no) - AC_MSG_CHECKING([whether to include LZO compression support]) - AC_MSG_RESULT($use_lzo) - LZO_LIBS= - if test "$use_lzo" = "yes"; then - AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2) - if test "$LZO_LIBS" = ""; then - AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [ - use_lzo=no - AC_MSG_WARN( - *** - *** Could not find liblzo or liblzo2. Disabling LZO compression. - ) - ]) - fi - fi - AC_SUBST(LZO_LIBS) - if test "$use_lzo" = "yes"; then - AC_DEFINE([USE_LZO], 1, [whether to use the LZO compression]) - if test "$LZO_LIBS" = "-llzo"; then - AC_CHECK_HEADERS(lzo1x.h) - elif test "$LZO_LIBS" = "-llzo2"; then - AC_CHECK_HEADERS(lzo/lzo1x.h) - fi - fi - AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes") - AC_MSG_CHECKING([whether C99 macros are supported]) AC_TRY_COMPILE(, [