nettle: downgrade to 2.7.1 since gnutls is incompatible with 3.0

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 41263
This commit is contained in:
Steven Barth 2014-06-18 17:06:30 +00:00
parent 43c0ad0f00
commit 5142e91b2d
6 changed files with 1915 additions and 88 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=nettle PKG_NAME:=nettle
PKG_VERSION:=3.0 PKG_VERSION:=2.7.1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/nettle PKG_SOURCE_URL:=@GNU/nettle
PKG_MD5SUM:=f64b1bf1e774b7ae6e507318e340250e PKG_MD5SUM:=003d5147911317931dd453520eb234a5
PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org> PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
PKG_LICENSE:=LGPLv2 PKG_LICENSE:=LGPLv2

File diff suppressed because it is too large Load Diff

View File

@ -24,11 +24,13 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
testsuite/testutils.h | 5 ++-- testsuite/testutils.h | 5 ++--
18 files changed, 102 insertions(+), 39 deletions(-) 18 files changed, 102 insertions(+), 39 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 3b0e1cb..42be3a9 100644
--- a/Makefile.in --- a/Makefile.in
+++ b/Makefile.in +++ b/Makefile.in
@@ -15,6 +15,10 @@ MKDIR_P = @MKDIR_P@ @@ -16,6 +16,10 @@ MKDIR_P = @MKDIR_P@
OPT_ASM_NETTLE_SOURCES = @OPT_ASM_NETTLE_SOURCES@
OPT_ASM_HOGWEED_SOURCES = @OPT_ASM_HOGWEED_SOURCES@ OPT_ASM_SOURCES = @OPT_ASM_SOURCES@
+OPT_HOGWEED_SOURCES = @OPT_HOGWEED_SOURCES@ +OPT_HOGWEED_SOURCES = @OPT_HOGWEED_SOURCES@
+ +
@ -37,27 +39,29 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
SUBDIRS = tools testsuite examples SUBDIRS = tools testsuite examples
include config.make include config.make
@@ -132,7 +136,7 @@ nettle_SOURCES = aes-decrypt-internal.c @@ -106,7 +110,7 @@ nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c \
write-be32.c write-le32.c write-le64.c \ nettle-meta-armors.c \
yarrow256.c yarrow_key_event.c write-be32.c write-le32.c write-le64.c
-hogweed_SOURCES = sexp.c sexp-format.c \ -hogweed_SOURCES = sexp.c sexp-format.c \
+hogweed_SOURCES = $(OPT_HOGWEED_SOURCES) sexp.c sexp-format.c \ +hogweed_SOURCES = $(OPT_HOGWEED_SOURCES) sexp.c sexp-format.c \
sexp-transport.c sexp-transport-format.c \ sexp-transport.c sexp-transport-format.c \
bignum.c bignum-random.c bignum-random-prime.c \ bignum.c bignum-next-prime.c \
sexp2bignum.c \ bignum-random.c bignum-random-prime.c \
@@ -183,7 +187,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1. @@ -156,7 +160,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1.h bignum.h blowfish.h \
pgp.h pkcs1.h realloc.h ripemd160.h rsa.h \ pgp.h pkcs1.h realloc.h ripemd160.h rsa.h rsa-compat.h \
salsa20.h sexp.h \ salsa20.h sexp.h \
serpent.h sha.h sha1.h sha2.h sha3.h twofish.h \ serpent.h sha.h sha1.h sha2.h sha3.h twofish.h \
- umac.h yarrow.h poly1305.h - umac.h yarrow.h
+ umac.h yarrow.h poly1305.h $(OPT_HOGWEED_HEADERS) + umac.h yarrow.h $(OPT_HOGWEED_HEADERS)
INSTALL_HEADERS = $(HEADERS) nettle-stdint.h INSTALL_HEADERS = $(HEADERS) nettle-stdint.h
diff --git a/bignum.h b/bignum.h
index 746b21f..1f2ff07 100644
--- a/bignum.h --- a/bignum.h
+++ b/bignum.h +++ b/bignum.h
@@ -36,7 +36,11 @@ @@ -28,7 +28,11 @@
#include "nettle-meta.h" #include "nettle-meta.h"
@ -70,6 +74,8 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "nettle-types.h" #include "nettle-types.h"
#ifdef __cplusplus #ifdef __cplusplus
diff --git a/configure.ac b/configure.ac
index 78a3d4e..93eb09a 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -72,6 +72,16 @@ AC_ARG_ENABLE(arm-neon, @@ -72,6 +72,16 @@ AC_ARG_ENABLE(arm-neon,
@ -89,7 +95,7 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \ LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \
`echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \ `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \
/usr/local/lib /sw/local/lib /sw/lib \ /usr/local/lib /sw/local/lib /sw/lib \
@@ -441,7 +451,7 @@ case "$host_os" in @@ -409,7 +419,7 @@ case "$host_os" in
LIBHOGWEED_SONAME='libhogweed.$(LIBHOGWEED_MAJOR).dylib' LIBHOGWEED_SONAME='libhogweed.$(LIBHOGWEED_MAJOR).dylib'
LIBHOGWEED_FILE='libhogweed.$(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR).dylib' LIBHOGWEED_FILE='libhogweed.$(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR).dylib'
LIBHOGWEED_LINK='$(CC) $(CFLAGS) -dynamiclib -L. $(LDFLAGS) -install_name ${libdir}/$(LIBHOGWEED_SONAME) -compatibility_version $(LIBHOGWEED_MAJOR) -current_version $(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR)' LIBHOGWEED_LINK='$(CC) $(CFLAGS) -dynamiclib -L. $(LDFLAGS) -install_name ${libdir}/$(LIBHOGWEED_SONAME) -compatibility_version $(LIBHOGWEED_MAJOR) -current_version $(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR)'
@ -98,33 +104,35 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
;; ;;
solaris*) solaris*)
# Sun's ld uses -h to set the soname, and this option is passed # Sun's ld uses -h to set the soname, and this option is passed
@@ -457,7 +467,7 @@ case "$host_os" in @@ -425,7 +435,7 @@ case "$host_os" in
LIBHOGWEED_SONAME='$(LIBHOGWEED_FORLINK).$(LIBHOGWEED_MAJOR)' LIBHOGWEED_SONAME='$(LIBHOGWEED_FORLINK).$(LIBHOGWEED_MAJOR)'
LIBHOGWEED_FILE='$(LIBHOGWEED_SONAME).$(LIBHOGWEED_MINOR)' LIBHOGWEED_FILE='$(LIBHOGWEED_SONAME).$(LIBHOGWEED_MINOR)'
LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -G -h $(LIBHOGWEED_SONAME)' LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -L. -G -h $(LIBHOGWEED_SONAME)'
- LIBHOGWEED_LIBS='libnettle.so -lgmp' - LIBHOGWEED_LIBS='-lnettle -lgmp'
+ LIBHOGWEED_LIBS='libnettle.so $(GMP_LIBS)' + LIBHOGWEED_LIBS='-lnettle $(GMP_LIBS)'
;; ;;
*) *)
LIBNETTLE_FORLINK=libnettle.so LIBNETTLE_FORLINK=libnettle.so
@@ -474,7 +484,7 @@ case "$host_os" in @@ -443,7 +453,7 @@ case "$host_os" in
# (does not work in general, e.g., with static linking all of
# -lhogweed -lgmp -lnettle are still required). Also makes dlopen # -lhogweed -lgmp -lnettle are still required). Also makes dlopen
# of libhogweed.so work, without having to use RTLD_GLOBAL. # of libhogweed.so work, without having to use RTLD_GLOBAL.
- LIBHOGWEED_LIBS='libnettle.so -lgmp' # Depends on -L. above, to locate nettle.so.
+ LIBHOGWEED_LIBS='libnettle.so $(GMP_LIBS)' - LIBHOGWEED_LIBS='-lnettle -lgmp'
+ LIBHOGWEED_LIBS='-lnettle $(GMP_LIBS)'
;; ;;
esac esac
@@ -692,7 +702,18 @@ if test "x$nettle_cv_fcntl_locking" = "x @@ -644,32 +654,55 @@ if test "x$nettle_cv_fcntl_locking" = "xyes" ; then
AC_DEFINE(HAVE_FCNTL_LOCKING)
fi fi
# Checks for libraries -# Checks for libraries
-AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
- [AC_MSG_WARN(
+TESTSUITE_LIBS="" +TESTSUITE_LIBS=""
+ +
+OPT_HOGWEED_SOURCES="" +OPT_HOGWEED_SOURCES=""
+OPT_HOGWEED_HEADERS="" +OPT_HOGWEED_HEADERS=""
if test "x$enable_public_key" = "xyes" ; then
+if test "x$enable_mini_gmp" = xyes ; then +if test "x$enable_mini_gmp" = xyes ; then
+ OPT_HOGWEED_SOURCES="$OPT_HOGWEED_SOURCES mini-gmp.c" + OPT_HOGWEED_SOURCES="$OPT_HOGWEED_SOURCES mini-gmp.c"
+ OPT_HOGWEED_HEADERS="$OPT_HOGWEED_HEADERS mini-gmp.h" + OPT_HOGWEED_HEADERS="$OPT_HOGWEED_HEADERS mini-gmp.h"
@ -132,44 +140,63 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
+ IF_NOT_MINI_GMP='#' + IF_NOT_MINI_GMP='#'
+ GMP_NUMB_BITS="0" + GMP_NUMB_BITS="0"
+else +else
AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
[AC_MSG_WARN(
[GNU MP not found, or not 3.1 or up, see http://gmplib.org/.
@@ -701,9 +722,7 @@ if test "x$enable_public_key" = "xyes" ;
# Add -R flags needed to run programs linked with gmp
LSH_RPATH_FIX
-fi
-if test "x$enable_public_key" = "xyes" ; then
# Check for gmp limb size
nettle_cv_gmp_numb_bits=0
if test "$enable_public_key" = yes; then
@@ -714,12 +733,23 @@ if test "x$enable_public_key" = "xyes" ;
AC_MSG_RESULT([$nettle_cv_gmp_numb_bits bits])
fi
+ +
+ # Checks for libraries
+ AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
+ [AC_MSG_WARN(
[GNU MP not found, or not 3.1 or up, see http://gmplib.org/.
Support for public key algorithms will be unavailable.])]
- enable_public_key=no)
+ enable_public_key=no)
GMP_NUMB_BITS="$nettle_cv_gmp_numb_bits" -# Add -R flags needed to run programs linked with gmp
AC_SUBST([GMP_NUMB_BITS]) -LSH_RPATH_FIX
+ # Add -R flags needed to run programs linked with gmp
+ LSH_RPATH_FIX
AH_TEMPLATE([HAVE_MPZ_POWM_SEC], [Define if mpz_powm_sec is available (appeared in GMP-5)]) -# Check for gmp limb size
AC_CHECK_FUNC(__gmpz_powm_sec, [AC_DEFINE(HAVE_MPZ_POWM_SEC)]) -nettle_cv_gmp_numb_bits=0
-if test "$enable_public_key" = yes; then
- AC_MSG_CHECKING([for GMP limb size])
- AC_COMPUTE_INT(nettle_cv_gmp_numb_bits, [GMP_NUMB_BITS],
- [#include <gmp.h>],
- [AC_MSG_FAILURE([cannot find value of GMP_NUMB_BITS])])
+ # Check for gmp limb size
+ nettle_cv_gmp_numb_bits=0
+ if test "$enable_public_key" = yes; then
+ AC_MSG_CHECKING([for GMP limb size])
+ AC_COMPUTE_INT(nettle_cv_gmp_numb_bits, [GMP_NUMB_BITS],
+ [#include <gmp.h>],
+ [AC_MSG_FAILURE([cannot find value of GMP_NUMB_BITS])])
- AC_MSG_RESULT([$nettle_cv_gmp_numb_bits bits])
+ AC_MSG_RESULT([$nettle_cv_gmp_numb_bits bits])
+ fi
+
+ GMP_NUMB_BITS="$nettle_cv_gmp_numb_bits"
+
+ AH_TEMPLATE([HAVE_MPZ_POWM_SEC], [Define if mpz_powm_sec is available (appeared in GMP-5)])
+ AC_CHECK_FUNC(__gmpz_powm_sec, [AC_DEFINE(HAVE_MPZ_POWM_SEC)])
+
+ IF_NOT_MINI_GMP='' + IF_NOT_MINI_GMP=''
+ TESTSUITE_LIBS="-lgmp" + TESTSUITE_LIBS="-lgmp"
+fi fi
-GMP_NUMB_BITS="$nettle_cv_gmp_numb_bits"
-AC_SUBST([GMP_NUMB_BITS])
+AC_SUBST([GMP_LIBS]) +AC_SUBST([GMP_LIBS])
-AH_TEMPLATE([HAVE_MPZ_POWM_SEC], [Define if mpz_powm_sec is available (appeared in GMP-5)])
-AC_CHECK_FUNC(__gmpz_powm_sec, [AC_DEFINE(HAVE_MPZ_POWM_SEC)])
+dnl The testsuite requires gmp +dnl The testsuite requires gmp
+AC_SUBST([TESTSUITE_LIBS]) +AC_SUBST([TESTSUITE_LIBS])
+AC_SUBST([GMP_NUMB_BITS]) +AC_SUBST([GMP_NUMB_BITS])
+AC_SUBST([OPT_HOGWEED_SOURCES]) +AC_SUBST([OPT_HOGWEED_SOURCES])
+AC_SUBST([OPT_HOGWEED_HEADERS]) +AC_SUBST([OPT_HOGWEED_HEADERS])
+
fi
AH_TEMPLATE([WITH_HOGWEED], [Defined if public key features are enabled]) AH_TEMPLATE([WITH_HOGWEED], [Defined if public key features are enabled])
@@ -765,6 +795,7 @@ else
@@ -714,6 +747,7 @@ else
IF_DOCUMENTATION='#' IF_DOCUMENTATION='#'
fi fi
@ -177,9 +204,11 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
AC_SUBST(IF_HOGWEED) AC_SUBST(IF_HOGWEED)
AC_SUBST(IF_STATIC) AC_SUBST(IF_STATIC)
AC_SUBST(IF_SHARED) AC_SUBST(IF_SHARED)
diff --git a/dsa.h b/dsa.h
index 7ee2624..478e4fc 100644
--- a/dsa.h --- a/dsa.h
+++ b/dsa.h +++ b/dsa.h
@@ -34,7 +34,7 @@ @@ -26,7 +26,7 @@
#ifndef NETTLE_DSA_H_INCLUDED #ifndef NETTLE_DSA_H_INCLUDED
#define NETTLE_DSA_H_INCLUDED #define NETTLE_DSA_H_INCLUDED
@ -188,9 +217,11 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "nettle-types.h" #include "nettle-types.h"
diff --git a/ecc-internal.h b/ecc-internal.h
index e8974fe..5cdd0e1 100644
--- a/ecc-internal.h --- a/ecc-internal.h
+++ b/ecc-internal.h +++ b/ecc-internal.h
@@ -34,7 +34,7 @@ @@ -25,7 +25,7 @@
#ifndef NETTLE_ECC_INTERNAL_H_INCLUDED #ifndef NETTLE_ECC_INTERNAL_H_INCLUDED
#define NETTLE_ECC_INTERNAL_H_INCLUDED #define NETTLE_ECC_INTERNAL_H_INCLUDED
@ -199,9 +230,11 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "nettle-types.h" #include "nettle-types.h"
#include "ecc-curve.h" #include "ecc-curve.h"
diff --git a/ecc.h b/ecc.h
index 609d246..924f8ec 100644
--- a/ecc.h --- a/ecc.h
+++ b/ecc.h +++ b/ecc.h
@@ -34,7 +34,7 @@ @@ -25,7 +25,7 @@
#ifndef NETTLE_ECC_H_INCLUDED #ifndef NETTLE_ECC_H_INCLUDED
#define NETTLE_ECC_H_INCLUDED #define NETTLE_ECC_H_INCLUDED
@ -210,9 +243,11 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "nettle-types.h" #include "nettle-types.h"
diff --git a/eccdata.c b/eccdata.c
index 466753c..24f64e3 100644
--- a/eccdata.c --- a/eccdata.c
+++ b/eccdata.c +++ b/eccdata.c
@@ -33,11 +33,14 @@ @@ -24,11 +24,14 @@
/* Development of Nettle's ECC support was funded by the .SE Internet Fund. */ /* Development of Nettle's ECC support was funded by the .SE Internet Fund. */
@ -227,7 +262,7 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "mini-gmp.c" #include "mini-gmp.c"
/* Affine coordinates, for simplicity. Infinity point represented as x /* Affine coordinates, for simplicity. Infinity point represented as x
@@ -904,6 +907,7 @@ int @@ -895,6 +898,7 @@ int
main (int argc, char **argv) main (int argc, char **argv)
{ {
struct ecc_curve ecc; struct ecc_curve ecc;
@ -235,7 +270,7 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
if (argc < 4) if (argc < 4)
{ {
@@ -911,6 +915,7 @@ main (int argc, char **argv) @@ -902,6 +906,7 @@ main (int argc, char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -243,7 +278,7 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
ecc_curve_init (&ecc, atoi(argv[1])); ecc_curve_init (&ecc, atoi(argv[1]));
ecc_pippenger_precompute (&ecc, atoi(argv[2]), atoi(argv[3])); ecc_pippenger_precompute (&ecc, atoi(argv[2]), atoi(argv[3]));
@@ -921,7 +926,12 @@ main (int argc, char **argv) @@ -912,7 +917,12 @@ main (int argc, char **argv)
ecc_curve_check (&ecc); ecc_curve_check (&ecc);
if (argc > 4) if (argc > 4)
@ -257,6 +292,8 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 563d0dc..2bb0436 100644
--- a/examples/Makefile.in --- a/examples/Makefile.in
+++ b/examples/Makefile.in +++ b/examples/Makefile.in
@@ -11,7 +11,7 @@ PRE_CPPFLAGS = -I.. -I$(top_srcdir) @@ -11,7 +11,7 @@ PRE_CPPFLAGS = -I.. -I$(top_srcdir)
@ -268,9 +305,11 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
HOGWEED_TARGETS = rsa-keygen$(EXEEXT) rsa-sign$(EXEEXT) \ HOGWEED_TARGETS = rsa-keygen$(EXEEXT) rsa-sign$(EXEEXT) \
rsa-verify$(EXEEXT) rsa-encrypt$(EXEEXT) rsa-decrypt$(EXEEXT) \ rsa-verify$(EXEEXT) rsa-encrypt$(EXEEXT) rsa-decrypt$(EXEEXT) \
diff --git a/examples/ecc-benchmark.c b/examples/ecc-benchmark.c
index 1faf6dc..16a1fd6 100644
--- a/examples/ecc-benchmark.c --- a/examples/ecc-benchmark.c
+++ b/examples/ecc-benchmark.c +++ b/examples/ecc-benchmark.c
@@ -46,6 +46,8 @@ @@ -37,6 +37,8 @@
#include "timing.h" #include "timing.h"
@ -279,16 +318,20 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "../ecc.h" #include "../ecc.h"
#include "../ecc-internal.h" #include "../ecc-internal.h"
#include "../gmp-glue.h" #include "../gmp-glue.h"
diff --git a/gmp-glue.c b/gmp-glue.c
index a2633a5..d76fdea 100644
--- a/gmp-glue.c --- a/gmp-glue.c
+++ b/gmp-glue.c +++ b/gmp-glue.c
@@ -271,3 +271,4 @@ gmp_free(void *p, size_t n) @@ -239,3 +239,4 @@ gmp_free_limbs (mp_limb_t *p, mp_size_t n)
free_func (p, (size_t) n); free_func (p, (size_t) n * sizeof(mp_limb_t));
} }
+ +
diff --git a/gmp-glue.h b/gmp-glue.h
index 269667f..f51b5b5 100644
--- a/gmp-glue.h --- a/gmp-glue.h
+++ b/gmp-glue.h +++ b/gmp-glue.h
@@ -33,7 +33,7 @@ @@ -23,7 +23,7 @@
#ifndef NETTLE_GMP_GLUE_H_INCLUDED #ifndef NETTLE_GMP_GLUE_H_INCLUDED
#define NETTLE_GMP_GLUE_H_INCLUDED #define NETTLE_GMP_GLUE_H_INCLUDED
@ -297,9 +340,11 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "nettle-stdint.h" #include "nettle-stdint.h"
diff --git a/hogweed.pc.in b/hogweed.pc.in
index 457f5f2..9a9dea0 100644
--- a/hogweed.pc.in --- a/hogweed.pc.in
+++ b/hogweed.pc.in +++ b/hogweed.pc.in
@@ -13,6 +13,6 @@ URL: http://www.lysator.liu.se/~nisse/ne @@ -13,6 +13,6 @@ URL: http://www.lysator.liu.se/~nisse/nettle
Version: @PACKAGE_VERSION@ Version: @PACKAGE_VERSION@
Requires.private: nettle Requires.private: nettle
Libs: -L${libdir} -lhogweed Libs: -L${libdir} -lhogweed
@ -307,6 +352,8 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
+Libs.private: @GMP_LIBS@ +Libs.private: @GMP_LIBS@
Cflags: -I${includedir} Cflags: -I${includedir}
diff --git a/mini-gmp.c b/mini-gmp.c
index 766df30..cf76a2a 100644
--- a/mini-gmp.c --- a/mini-gmp.c
+++ b/mini-gmp.c +++ b/mini-gmp.c
@@ -1388,7 +1388,7 @@ mpz_clear (mpz_t r) @@ -1388,7 +1388,7 @@ mpz_clear (mpz_t r)
@ -318,6 +365,8 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
mpz_realloc (mpz_t r, mp_size_t size) mpz_realloc (mpz_t r, mp_size_t size)
{ {
size = GMP_MAX (size, 1); size = GMP_MAX (size, 1);
diff --git a/mini-gmp.h b/mini-gmp.h
index d8f691f..dac7d1e 100644
--- a/mini-gmp.h --- a/mini-gmp.h
+++ b/mini-gmp.h +++ b/mini-gmp.h
@@ -70,6 +70,11 @@ typedef struct @@ -70,6 +70,11 @@ typedef struct
@ -343,9 +392,11 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#define mpz_odd_p(z) (((z)->_mp_size != 0) & (int) (z)->_mp_d[0]) #define mpz_odd_p(z) (((z)->_mp_size != 0) & (int) (z)->_mp_d[0])
#define mpz_even_p(z) (! mpz_odd_p (z)) #define mpz_even_p(z) (! mpz_odd_p (z))
diff --git a/pkcs1.h b/pkcs1.h
index fa27225..f402688 100644
--- a/pkcs1.h --- a/pkcs1.h
+++ b/pkcs1.h +++ b/pkcs1.h
@@ -34,7 +34,7 @@ @@ -26,7 +26,7 @@
#ifndef NETTLE_PKCS1_H_INCLUDED #ifndef NETTLE_PKCS1_H_INCLUDED
#define NETTLE_PKCS1_H_INCLUDED #define NETTLE_PKCS1_H_INCLUDED
@ -354,9 +405,11 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "nettle-types.h" #include "nettle-types.h"
#ifdef __cplusplus #ifdef __cplusplus
diff --git a/rsa.h b/rsa.h
index 4226f38..c293cd1 100644
--- a/rsa.h --- a/rsa.h
+++ b/rsa.h +++ b/rsa.h
@@ -34,7 +34,7 @@ @@ -26,7 +26,7 @@
#ifndef NETTLE_RSA_H_INCLUDED #ifndef NETTLE_RSA_H_INCLUDED
#define NETTLE_RSA_H_INCLUDED #define NETTLE_RSA_H_INCLUDED
@ -365,18 +418,20 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
#include "nettle-types.h" #include "nettle-types.h"
#include "md5.h" #include "md5.h"
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index 91f6e2a..c8ab5f6 100644
--- a/testsuite/Makefile.in --- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in +++ b/testsuite/Makefile.in
@@ -50,7 +50,7 @@ TS_HOGWEED = $(TS_HOGWEED_SOURCES:.c=$(E @@ -47,7 +47,7 @@ TS_HOGWEED = $(TS_HOGWEED_SOURCES:.c=$(EXEEXT))
TS_C = $(TS_NETTLE) @IF_HOGWEED@ $(TS_HOGWEED) TS_C = $(TS_NETTLE) @IF_HOGWEED@ $(TS_HOGWEED)
TS_CXX = @IF_CXX@ $(CXX_SOURCES:.cxx=$(EXEEXT)) TS_CXX = @IF_CXX@ $(CXX_SOURCES:.cxx=$(EXEEXT))
TARGETS = $(TS_C) $(TS_CXX) TARGETS = $(TS_C) $(TS_CXX)
-TS_SH = sexp-conv-test pkcs1-conv-test nettle-pbkdf2-test symbols-test -TS_SH = sexp-conv-test pkcs1-conv-test symbols-test
+TS_SH = sexp-conv-test pkcs1-conv-test nettle-pbkdf2-test symbols-test @IF_NOT_MINI_GMP@ +TS_SH = sexp-conv-test pkcs1-conv-test @IF_NOT_MINI_GMP@ symbols-test
TS_ALL = $(TARGETS) $(TS_SH) TS_ALL = $(TARGETS) $(TS_SH)
EXTRA_SOURCES = sha1-huge-test.c EXTRA_SOURCES = sha1-huge-test.c
EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT)) EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT))
@@ -78,7 +78,7 @@ all: $(EXTRA_TARGETS) @@ -75,7 +75,7 @@ all: $(TARGETS) $(EXTRA_TARGETS)
LIB_HOGWEED = @IF_HOGWEED@ -lhogweed LIB_HOGWEED = @IF_HOGWEED@ -lhogweed
TEST_OBJS = testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \ TEST_OBJS = testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \
@ -385,6 +440,8 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
../nettle-internal.$(OBJEXT): ../nettle-internal.$(OBJEXT):
( cd .. && $(MAKE) nettle-internal.$(OBJEXT) ) ( cd .. && $(MAKE) nettle-internal.$(OBJEXT) )
diff --git a/testsuite/testutils.h b/testsuite/testutils.h
index 123bae2..a677a2a 100644
--- a/testsuite/testutils.h --- a/testsuite/testutils.h
+++ b/testsuite/testutils.h +++ b/testsuite/testutils.h
@@ -12,11 +12,10 @@ @@ -12,11 +12,10 @@
@ -399,5 +456,8 @@ Subject: [PATCH 2/5] Added option to use mini-gmp in hogweed.
+# include <gmp.h> +# include <gmp.h>
+# undef USE_MINI_GMP +# undef USE_MINI_GMP
# include "rsa.h" # include "rsa.h"
# include "dsa-compat.h" # include "dsa.h"
# include "ecc-curve.h" # include "ecc-curve.h"
--
1.9.2

View File

@ -9,6 +9,8 @@ Subject: [PATCH 3/5] Include local macros in nettle.m4 to allow regeneration.
2 files changed, 1210 insertions(+) 2 files changed, 1210 insertions(+)
create mode 100644 nettle.m4 create mode 100644 nettle.m4
diff --git a/configure.ac b/configure.ac
index 93eb09a..c24f954 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -7,6 +7,7 @@ AC_PREREQ(2.61) @@ -7,6 +7,7 @@ AC_PREREQ(2.61)
@ -19,6 +21,9 @@ Subject: [PATCH 3/5] Include local macros in nettle.m4 to allow regeneration.
AC_CONFIG_HEADER([config.h]) AC_CONFIG_HEADER([config.h])
diff --git a/nettle.m4 b/nettle.m4
new file mode 100644
index 0000000..98b399b
--- /dev/null --- /dev/null
+++ b/nettle.m4 +++ b/nettle.m4
@@ -0,0 +1,1209 @@ @@ -0,0 +1,1209 @@
@ -1231,3 +1236,6 @@ Subject: [PATCH 3/5] Include local macros in nettle.m4 to allow regeneration.
+ac_cv_type_intmax_t="$ac_cv_type_intmax_t" +ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
+]) +])
+]) +])
--
1.9.2

View File

@ -13,10 +13,12 @@ Subject: [PATCH 4/5] Added-auto-generated-nettle-config.h
7 files changed, 13 insertions(+), 2 deletions(-) 7 files changed, 13 insertions(+), 2 deletions(-)
create mode 100644 nettle-config.h.in create mode 100644 nettle-config.h.in
diff --git a/Makefile.in b/Makefile.in
index 42be3a9..280dd30 100644
--- a/Makefile.in --- a/Makefile.in
+++ b/Makefile.in +++ b/Makefile.in
@@ -178,7 +178,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1. @@ -151,7 +151,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1.h bignum.h blowfish.h \
ecc-curve.h ecc.h ecdsa.h \ des.h des-compat.h dsa.h ecc-curve.h ecc.h ecdsa.h \
gcm.h gosthash94.h hmac.h \ gcm.h gosthash94.h hmac.h \
knuth-lfib.h \ knuth-lfib.h \
- macros.h \ - macros.h \
@ -24,18 +26,20 @@ Subject: [PATCH 4/5] Added-auto-generated-nettle-config.h
md2.h md4.h \ md2.h md4.h \
md5.h md5-compat.h \ md5.h md5-compat.h \
memxor.h \ memxor.h \
@@ -203,7 +203,7 @@ DISTFILES = $(SOURCES) $(HEADERS) getopt @@ -174,7 +174,7 @@ DISTFILES = $(SOURCES) $(HEADERS) getopt.h .bootstrap run-tests \
config.guess config.sub install-sh texinfo.tex \
config.h.in config.m4.in config.make.in Makefile.in \ config.h.in config.m4.in config.make.in Makefile.in \
README AUTHORS COPYING.LESSERv3 COPYINGv2 COPYINGv3 \ README AUTHORS COPYING.LIB INSTALL NEWS TODO ChangeLog \
INSTALL NEWS TODO ChangeLog \
- nettle.pc.in hogweed.pc.in \ - nettle.pc.in hogweed.pc.in \
+ nettle.pc.in hogweed.pc.in nettle-config.h.in \ + nettle.pc.in hogweed.pc.in nettle-config.h.in \
$(des_headers) descore.README \ memxor.c $(des_headers) descore.README \
aes-internal.h camellia-internal.h serpent-internal.h \ aes-internal.h camellia-internal.h serpent-internal.h \
cast128_sboxes.h desinfo.h desCode.h \ cast128_sboxes.h desinfo.h desCode.h \
diff --git a/bignum.h b/bignum.h
index 1f2ff07..c31ccaa 100644
--- a/bignum.h --- a/bignum.h
+++ b/bignum.h +++ b/bignum.h
@@ -34,6 +34,7 @@ @@ -26,6 +26,7 @@
#ifndef NETTLE_BIGNUM_H_INCLUDED #ifndef NETTLE_BIGNUM_H_INCLUDED
#define NETTLE_BIGNUM_H_INCLUDED #define NETTLE_BIGNUM_H_INCLUDED
@ -43,6 +47,8 @@ Subject: [PATCH 4/5] Added-auto-generated-nettle-config.h
#include "nettle-meta.h" #include "nettle-meta.h"
#ifdef USE_MINI_GMP #ifdef USE_MINI_GMP
diff --git a/configure.ac b/configure.ac
index c24f954..cb65bcd 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -10,6 +10,7 @@ AC_CONFIG_AUX_DIR([.]) @@ -10,6 +10,7 @@ AC_CONFIG_AUX_DIR([.])
@ -51,11 +57,13 @@ Subject: [PATCH 4/5] Added-auto-generated-nettle-config.h
AC_CONFIG_HEADER([config.h]) AC_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADER([nettle-config.h]) +AC_CONFIG_HEADER([nettle-config.h])
LIBNETTLE_MAJOR=5 LIBNETTLE_MAJOR=4
LIBNETTLE_MINOR=0 LIBNETTLE_MINOR=7
diff --git a/examples/ecc-benchmark.c b/examples/ecc-benchmark.c
index 16a1fd6..eaaf3a5 100644
--- a/examples/ecc-benchmark.c --- a/examples/ecc-benchmark.c
+++ b/examples/ecc-benchmark.c +++ b/examples/ecc-benchmark.c
@@ -47,6 +47,7 @@ @@ -38,6 +38,7 @@
#include "timing.h" #include "timing.h"
#undef USE_MINI_GMP #undef USE_MINI_GMP
@ -63,6 +71,9 @@ Subject: [PATCH 4/5] Added-auto-generated-nettle-config.h
#include <gmp.h> #include <gmp.h>
#include "../ecc.h" #include "../ecc.h"
#include "../ecc-internal.h" #include "../ecc-internal.h"
diff --git a/nettle-config.h.in b/nettle-config.h.in
new file mode 100644
index 0000000..11330ff
--- /dev/null --- /dev/null
+++ b/nettle-config.h.in +++ b/nettle-config.h.in
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
@ -72,6 +83,8 @@ Subject: [PATCH 4/5] Added-auto-generated-nettle-config.h
+#undef USE_MINI_GMP +#undef USE_MINI_GMP
+ +
+#endif +#endif
diff --git a/testsuite/testutils.h b/testsuite/testutils.h
index a677a2a..6e9b30c 100644
--- a/testsuite/testutils.h --- a/testsuite/testutils.h
+++ b/testsuite/testutils.h +++ b/testsuite/testutils.h
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
@ -81,4 +94,7 @@ Subject: [PATCH 4/5] Added-auto-generated-nettle-config.h
+# define NETTLE_CONFIG_H_INCLUDED +# define NETTLE_CONFIG_H_INCLUDED
# undef USE_MINI_GMP # undef USE_MINI_GMP
# include "rsa.h" # include "rsa.h"
# include "dsa-compat.h" # include "dsa.h"
--
1.9.2

View File

@ -7,9 +7,11 @@ Subject: [PATCH 5/5] allow der-iterator to be used with mini-gmp
der-iterator.c | 4 ++-- der-iterator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/der-iterator.c b/der-iterator.c
index 2e6efd5..5ab15b9 100644
--- a/der-iterator.c --- a/der-iterator.c
+++ b/der-iterator.c +++ b/der-iterator.c
@@ -38,7 +38,7 @@ @@ -30,7 +30,7 @@
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
@ -18,7 +20,7 @@ Subject: [PATCH 5/5] allow der-iterator to be used with mini-gmp
#include "bignum.h" #include "bignum.h"
#endif #endif
@@ -254,7 +254,7 @@ asn1_der_get_uint32(struct asn1_der_iter @@ -246,7 +246,7 @@ asn1_der_get_uint32(struct asn1_der_iterator *i,
return 1; return 1;
} }
@ -27,3 +29,6 @@ Subject: [PATCH 5/5] allow der-iterator to be used with mini-gmp
int int
asn1_der_get_bignum(struct asn1_der_iterator *i, asn1_der_get_bignum(struct asn1_der_iterator *i,
mpz_t x, unsigned max_bits) mpz_t x, unsigned max_bits)
--
1.9.2