From a8f9bc05c344ec9b9e0dee5499ce0b1427cbfea6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 10 Dec 2013 21:37:30 -0800 Subject: [PATCH] Remove the option of using libcrypto. This scorches the earth and waits for spring; see Ted Zlatanov and Stefan Monnier in . * configure.ac (with_openssl_default, HAVE_LIB_CRYPTO): Remove. Do not say whether Emacs is configured to use a crypto library, since it's no longer an option. (gl_CRYPTO_CHECK): Define a dummy. * lib/gl_openssl.h, m4/gl-openssl.m4: Remove. * admin/merge-gnulib: Remove lib/gl_openssh.h and m4/gl-openssl.m4. * src/Makefile.in (LIB_CRYPTO): Remove. (LIBES): Don't use it. --- ChangeLog | 12 +++++ admin/ChangeLog | 5 ++ admin/merge-gnulib | 3 +- configure.ac | 12 ++--- lib/gl_openssl.h | 116 --------------------------------------------- m4/gl-openssl.m4 | 51 -------------------- src/ChangeLog | 6 +++ src/Makefile.in | 2 - 8 files changed, 28 insertions(+), 179 deletions(-) delete mode 100644 lib/gl_openssl.h delete mode 100644 m4/gl-openssl.m4 diff --git a/ChangeLog b/ChangeLog index 0e5f084210f..787b590f098 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2013-12-11 Paul Eggert + + Remove the option of using libcrypto. + This scorches the earth and waits for spring; + see Ted Zlatanov and Stefan Monnier in + . + * configure.ac (with_openssl_default, HAVE_LIB_CRYPTO): Remove. + Do not say whether Emacs is configured to use a crypto library, + since it's no longer an option. + (gl_CRYPTO_CHECK): Define a dummy. + * lib/gl_openssl.h, m4/gl-openssl.m4: Remove. + 2013-12-10 Paul Eggert * configure.ac: Disable libcrypto by default. diff --git a/admin/ChangeLog b/admin/ChangeLog index 730253e616f..22824995dfc 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2013-12-11 Paul Eggert + + Remove the option of using libcrypto. + * merge-gnulib: Remove lib/gl_openssh.h and m4/gl-openssl.m4. + 2013-12-04 Eli Zaretskii * unidata/unidata-gen.el (unidata-prop-alist): Update bidi-class diff --git a/admin/merge-gnulib b/admin/merge-gnulib index a5bd622f4c0..af9300edbec 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -91,7 +91,8 @@ test -x "$gnulib_srcdir"/gnulib-tool || { } "$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS $GNULIB_MODULES && -rm -- "$src"m4/fcntl-o.m4 "$src"m4/gnulib-cache.m4 "$src"m4/warn-on-use.m4 && +rm -- "$src"lib/gl_openssl.h "$src"m4/fcntl-o.m4 "$src"m4/gl-openssl.m4 \ + "$src"m4/gnulib-cache.m4"$src" m4/warn-on-use.m4 && cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc && cp -- "$gnulib_srcdir"/build-aux/move-if-change "$src"build-aux && autoreconf -i -I m4 -- ${src:+"$src"} diff --git a/configure.ac b/configure.ac index 0a2e5c624e2..41258fcb7a9 100644 --- a/configure.ac +++ b/configure.ac @@ -94,8 +94,7 @@ AC_ARG_WITH(all, [AS_HELP_STRING([--without-all], [omit almost all features and build small executable with minimal dependencies])], - [with_features=$withval - with_openssl_default=$withval], + [with_features=$withval], [with_features=yes]) dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING) @@ -640,6 +639,8 @@ dnl alternative to lib/gnulib.mk, so as to avoid generating header files dnl that clash with MinGW. AM_CONDITIONAL([BUILDING_FOR_WINDOWSNT], [test "x$opsys" = "xmingw32"]) +# Avoid gnulib's tests for -lcrypto, so that there's no static dependency on it. +AC_DEFUN([gl_CRYPTO_CHECK]) # Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, # as we don't use them. AC_DEFUN([gl_FCNTL_O_FLAGS]) @@ -4848,12 +4849,6 @@ else acl_summary=no fi -if test -n "$LIB_CRYPTO"; then - HAVE_LIB_CRYPTO=yes -else - HAVE_LIB_CRYPTO=no -fi - echo " Configured for \`${canonical}'. @@ -4893,7 +4888,6 @@ echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}" echo " Does Emacs use a file notification library? ${NOTIFY_SUMMARY}" echo " Does Emacs use access control lists? ${acl_summary}" -echo " Does Emacs use a crypto library? ${HAVE_LIB_CRYPTO} $LIB_CRYPTO" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" diff --git a/lib/gl_openssl.h b/lib/gl_openssl.h deleted file mode 100644 index 1fb61066b11..00000000000 --- a/lib/gl_openssl.h +++ /dev/null @@ -1,116 +0,0 @@ -/* gl_openssl.h -- wrap openssl crypto hash routines in gnulib interface - - Copyright (C) 2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* Written by Pádraig Brady */ - -#ifndef GL_OPENSSL_NAME -# error "Please define GL_OPENSSL_NAME to 1,5,256 etc." -#endif - -#ifndef _GL_INLINE_HEADER_BEGIN -# error "Please include config.h first." -#endif -_GL_INLINE_HEADER_BEGIN -#ifndef GL_OPENSSL_INLINE -# define GL_OPENSSL_INLINE _GL_INLINE -#endif - -/* Concatenate two preprocessor tokens. */ -#define _GLCRYPTO_CONCAT_(prefix, suffix) prefix##suffix -#define _GLCRYPTO_CONCAT(prefix, suffix) _GLCRYPTO_CONCAT_ (prefix, suffix) - -#if GL_OPENSSL_NAME == 5 -# define OPENSSL_ALG md5 -#else -# define OPENSSL_ALG _GLCRYPTO_CONCAT (sha, GL_OPENSSL_NAME) -#endif - -/* Context type mappings. */ -#if BASE_OPENSSL_TYPE != GL_OPENSSL_NAME -# undef BASE_OPENSSL_TYPE -# if GL_OPENSSL_NAME == 224 -# define BASE_OPENSSL_TYPE 256 -# elif GL_OPENSSL_NAME == 384 -# define BASE_OPENSSL_TYPE 512 -# endif -# define md5_CTX MD5_CTX -# define sha1_CTX SHA_CTX -# define sha224_CTX SHA256_CTX -# define sha224_ctx sha256_ctx -# define sha256_CTX SHA256_CTX -# define sha384_CTX SHA512_CTX -# define sha384_ctx sha512_ctx -# define sha512_CTX SHA512_CTX -# undef _gl_CTX -# undef _gl_ctx -# define _gl_CTX _GLCRYPTO_CONCAT (OPENSSL_ALG, _CTX) /* openssl type. */ -# define _gl_ctx _GLCRYPTO_CONCAT (OPENSSL_ALG, _ctx) /* gnulib type. */ - -struct _gl_ctx { _gl_CTX CTX; }; -#endif - -/* Function name mappings. */ -#define md5_prefix MD5 -#define sha1_prefix SHA1 -#define sha224_prefix SHA224 -#define sha256_prefix SHA256 -#define sha384_prefix SHA384 -#define sha512_prefix SHA512 -#define _GLCRYPTO_PREFIX _GLCRYPTO_CONCAT (OPENSSL_ALG, _prefix) -#define OPENSSL_FN(suffix) _GLCRYPTO_CONCAT (_GLCRYPTO_PREFIX, suffix) -#define GL_CRYPTO_FN(suffix) _GLCRYPTO_CONCAT (OPENSSL_ALG, suffix) - -GL_OPENSSL_INLINE void -GL_CRYPTO_FN (_init_ctx) (struct _gl_ctx *ctx) -{ (void) OPENSSL_FN (_Init) ((_gl_CTX *) ctx); } - -/* These were never exposed by gnulib. */ -#if ! (GL_OPENSSL_NAME == 224 || GL_OPENSSL_NAME == 384) -GL_OPENSSL_INLINE void -GL_CRYPTO_FN (_process_bytes) (const void *buf, size_t len, struct _gl_ctx *ctx) -{ OPENSSL_FN (_Update) ((_gl_CTX *) ctx, buf, len); } - -GL_OPENSSL_INLINE void -GL_CRYPTO_FN (_process_block) (const void *buf, size_t len, struct _gl_ctx *ctx) -{ GL_CRYPTO_FN (_process_bytes) (buf, len, ctx); } -#endif - -GL_OPENSSL_INLINE void * -GL_CRYPTO_FN (_finish_ctx) (struct _gl_ctx *ctx, void *res) -{ OPENSSL_FN (_Final) (res, (_gl_CTX *) ctx); return res; } - -GL_OPENSSL_INLINE void * -GL_CRYPTO_FN (_buffer) (const char *buf, size_t len, void *res) -{ return OPENSSL_FN () ((const unsigned char *) buf, len, res); } - -GL_OPENSSL_INLINE void * -GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void *res) -{ - /* Assume any unprocessed bytes in ctx are not to be ignored. */ - _gl_CTX tmp_ctx = *(_gl_CTX *) ctx; - OPENSSL_FN (_Final) (res, &tmp_ctx); - return res; -} - -/* Undef so we can include multiple times. */ -#undef GL_CRYPTO_FN -#undef OPENSSL_FN -#undef _GLCRYPTO_PREFIX -#undef OPENSSL_ALG -#undef GL_OPENSSL_NAME - -_GL_INLINE_HEADER_END diff --git a/m4/gl-openssl.m4 b/m4/gl-openssl.m4 deleted file mode 100644 index 0434c4c8721..00000000000 --- a/m4/gl-openssl.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# gl-openssl.m4 serial 3 -dnl Copyright (C) 2013 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_SET_CRYPTO_CHECK_DEFAULT], -[ - m4_define([gl_CRYPTO_CHECK_DEFAULT], [$1]) -]) -gl_SET_CRYPTO_CHECK_DEFAULT([no]) - -AC_DEFUN([gl_CRYPTO_CHECK], -[ - dnl gnulib users set this before gl_INIT with gl_SET_CRYPTO_CHECK_DEFAULT() - m4_divert_once([DEFAULTS], [with_openssl_default='gl_CRYPTO_CHECK_DEFAULT']) - - dnl Only clear once, so crypto routines can be checked for individually - m4_divert_once([DEFAULTS], [LIB_CRYPTO=]) - - AC_ARG_WITH([openssl], - [AS_HELP_STRING([--with-openssl], - [use libcrypto hash routines. Valid ARGs are: - 'yes', 'no', 'auto' => use if available, - 'optional' => use if available and warn if not available; - default is ']gl_CRYPTO_CHECK_DEFAULT['])], - [], - [with_openssl=$with_openssl_default]) - - if test "x$1" = xMD5; then - ALG_header=md5.h - else - ALG_header=sha.h - fi - - AC_SUBST([LIB_CRYPTO]) - if test "x$with_openssl" != xno; then - AC_CHECK_LIB([crypto], [$1], - [AC_CHECK_HEADERS([openssl/$ALG_header], - [LIB_CRYPTO=-lcrypto - AC_DEFINE([HAVE_OPENSSL_$1], [1], - [Define to 1 if libcrypto is used for $1.])])]) - if test "x$LIB_CRYPTO" = x; then - if test "x$with_openssl" = xyes; then - AC_MSG_ERROR([openssl development library not found for $1]) - elif test "x$with_openssl" = xoptional; then - AC_MSG_WARN([openssl development library not found for $1]) - fi - fi - fi -]) diff --git a/src/ChangeLog b/src/ChangeLog index a263867d617..58495874b2b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-12-11 Paul Eggert + + Remove the option of using libcrypto. + * Makefile.in (LIB_CRYPTO): Remove. + (LIBES): Don't use it. + 2013-12-11 Juri Linkov * term.c (term_get_fkeys_1): Remove non-standard IBM terminfo diff --git a/src/Makefile.in b/src/Makefile.in index cef1ba5ed2e..7d91928acfe 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -139,7 +139,6 @@ M17N_FLT_LIBS = @M17N_FLT_LIBS@ LIB_ACL=@LIB_ACL@ LIB_CLOCK_GETTIME=@LIB_CLOCK_GETTIME@ -LIB_CRYPTO=@LIB_CRYPTO@ LIB_EACCESS=@LIB_EACCESS@ LIB_FDATASYNC=@LIB_FDATASYNC@ LIB_TIMER_TIME=@LIB_TIMER_TIME@ @@ -404,7 +403,6 @@ ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj) LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ $(LIBX_OTHER) $(LIBSOUND) \ $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \ - $(LIB_CRYPTO) \ $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ -- 2.39.2