23498052 update libgcrypt to version 1.7.0
authorJan Friedel <jan.friedel@oracle.com>
Fri, 17 Jun 2016 08:45:56 -0700
changeset 6240 7fdcf093fdc2
parent 6239 925323933ffd
child 6241 5d26d14bd9fa
23498052 update libgcrypt to version 1.7.0 22840429 problem in LIBRARY/LIBGCRYPT
components/libgcrypt/Makefile
components/libgcrypt/libgcrypt.p5m
components/libgcrypt/patches/01_sparcv8.patch
components/libgcrypt/patches/libgcrypt-01-asm-divide.patch
components/libgcrypt/patches/libgcrypt-02-automake.patch
components/libgcrypt/patches/libgcrypt-03-aliasing.patch
components/libgcrypt/test/results-all.master
--- a/components/libgcrypt/Makefile	Fri Jun 17 08:45:56 2016 -0700
+++ b/components/libgcrypt/Makefile	Fri Jun 17 08:45:56 2016 -0700
@@ -23,18 +23,28 @@
 # Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 BUILD_BITS= 64_and_32
+
+# GCC 5.3 with the default optimization -O3 (set via shared-macros.mk),
+# inlines _gcry_cipher_ocb_get_l, double_block_cpy and double_block to
+# _gcry_cipher_ocb_authenticate on amd64. Due to a bug in GCC, the
+# inlined code is incorrect and the library produces data with errors
+# (manifested through failed 'basic' test results).  The optimization is
+# lowered down on the affected platform.  For more information see:
+# https://lists.gnupg.org/pipermail/gcrypt-devel/2016-April/003858.html
+gcc_OPT.i386.64 = -O2
+
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		libgcrypt
-COMPONENT_VERSION=	1.6.4
+COMPONENT_VERSION=	1.7.0
 COMPONENT_PROJECT_URL=  ftp://ftp.gnupg.org/gcrypt/libgcrypt/ 
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
 COMPONENT_ARCHIVE_HASH= \
-    sha256:c9bc2c7fe2e5f4ea13b0c74f9d24bcbb1ad889bb39297d8082aebf23f4336026
+    sha256:b0e67ea74474939913c4d9d9ef4ef5ec378efbe2bebe36389dee319c79bffa92
 COMPONENT_ARCHIVE_URL=  ftp://ftp.gnupg.org/gcrypt/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	library/libgcrypt
 
-TPNO=			26276
+TPNO=			27993
 
 # Requires new pkgmogrify feature, available in S12 but not 11.3, so do not
 # publish.
@@ -56,20 +66,10 @@
 # of Solaris Studio as the component compiler.
 COMPILER =		gcc
 
-#
-# The gcc deliverred with Solaris prior the gcc version 5.3 uses
-# different assembler versions on x86 and SPARC platforms. This causes
-# compilation issues. The GCC_ROOT explicitly sets the version of the
-# compiler to version 5.3 which resolves this problem. The line should
-# be removed once gcc on both platforms starts using the same assembler.
-GCC_ROOT = /usr/gcc/5.3
-
 CONFIGURE_OPTIONS += --sysconfdir=$(ETCDIR)
 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS += --enable-maintainer-mode 
 CONFIGURE_OPTIONS += --disable-asm
-CONFIGURE_OPTIONS += --enable-threads=posix
-CONFIGURE_OPTIONS += --enable-ciphers=arcfour:blowfish:des:aes:twofish:serpent:rfc2268:seed:camellia:cast5
 
 ASLR_MODE = $(ASLR_ENABLE)
 
--- a/components/libgcrypt/libgcrypt.p5m	Fri Jun 17 08:45:56 2016 -0700
+++ b/components/libgcrypt/libgcrypt.p5m	Fri Jun 17 08:45:56 2016 -0700
@@ -45,12 +45,12 @@
 file usr/bin/$(MACH32)/libgcrypt-config path=usr/bin/libgcrypt-config
 file path=usr/bin/mpicalc
 file path=usr/include/gcrypt.h
-link path=usr/lib/$(MACH64)/libgcrypt.so target=libgcrypt.so.20.0.4
-link path=usr/lib/$(MACH64)/libgcrypt.so.20 target=libgcrypt.so.20.0.4
-file path=usr/lib/$(MACH64)/libgcrypt.so.20.0.4
-link path=usr/lib/libgcrypt.so target=libgcrypt.so.20.0.4
-link path=usr/lib/libgcrypt.so.20 target=libgcrypt.so.20.0.4
-file path=usr/lib/libgcrypt.so.20.0.4
+link path=usr/lib/$(MACH64)/libgcrypt.so target=libgcrypt.so.20.1.0
+link path=usr/lib/$(MACH64)/libgcrypt.so.20 target=libgcrypt.so.20.1.0
+file path=usr/lib/$(MACH64)/libgcrypt.so.20.1.0
+link path=usr/lib/libgcrypt.so target=libgcrypt.so.20.1.0
+link path=usr/lib/libgcrypt.so.20 target=libgcrypt.so.20.1.0
+file path=usr/lib/libgcrypt.so.20.1.0
 file path=usr/share/aclocal/libgcrypt.m4
 file path=usr/share/info/gcrypt.info
 file path=usr/share/man/man1/hmac256.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libgcrypt/patches/01_sparcv8.patch	Fri Jun 17 08:45:56 2016 -0700
@@ -0,0 +1,23 @@
+
+The patch fixes the gcc portability on Solaris 9 SPARC boxes.
+
+In the mpi/longlong.h adds __sparcv8 as an alias for __sparc_v8__. If
+not applied, the compilation process fails during linkage with a
+missing/unresolved symbol __udiv_qrnnd.
+
+This patch originally comes from the upstream and it was locally updated
+to reflect indentation added to the file in the 1.7 branch; the original
+patch was applied on the 1.6 branch but it has been withdrawn for 1.7.
+https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=d2816248461c24a7ea81a1de2f562f481ccc9edd
+
+--- ./mpi/longlong.h.orig	Thu Jun  2 03:11:06 2016
++++ ./mpi/longlong.h	Thu Jun  2 03:11:33 2016
+@@ -1293,7 +1293,7 @@
+ 	     "rJ" ((USItype)(al)),                                      \
+ 	     "rI" ((USItype)(bl))                                       \
+ 	   __CLOBBER_CC)
+-# if defined (__sparc_v8__)
++# if defined (__sparc_v8__) || defined (__sparcv8)
+ /* Don't match immediate range because, 1) it is not often useful,
+    2) the 'I' flag thinks of the range as a 13 bit signed interval,
+    while we want to match a 13 bit interval, sign extended to 32 bits,
--- a/components/libgcrypt/patches/libgcrypt-01-asm-divide.patch	Fri Jun 17 08:45:56 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#
-# This patch addresses https://bugs.gnupg.org/gnupg/issue2102
-#
-# The patch comes from the upstream. Its content is a relevant part of
-# the following diff: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commitdiff;h=43376891c01f4aff1fbfb23beafebb5adfd0868c
-#
---- ./configure.orig	Sat Apr 16 01:42:26 2016
-+++ ./configure	Sat Apr 16 01:42:31 2016
-@@ -16519,6 +16519,11 @@
- 		"asmfunc:\n\t"
-                 ".size asmfunc,.-asmfunc;\n\t"
-                 ".type asmfunc,@function;\n\t"
-+		/* Test if assembler allows use of '/' for constant division
-+		 * (Solaris/x86 issue). If previous constant division check
-+		 * and "-Wa,--divide" workaround failed, this causes assembly
-+		 * to be disable on this machine. */
-+		"xorl \$(123456789/12345678), %ebp;\n\t"
-             );
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
--- a/components/libgcrypt/patches/libgcrypt-02-automake.patch	Fri Jun 17 08:45:56 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-Source:
-External
-
-Info:
-configure script enforces particular version of automake(1); userland
-build machines have recently switched from 1.11 to 1.15.
-
-Status:
-N/A
-
---- ./configure.orig	Wed Dec 30 22:28:45 2015
-+++ ./configure	Wed Dec 30 22:30:16 2015
-@@ -2733,7 +2733,7 @@
- 
- 
- 
--am__api_version='1.14'
-+am__api_version='1.15'
- 
- # Find a good install program.  We prefer a C program (faster),
- # so one script is as good as another.  But avoid the broken or
--- a/components/libgcrypt/patches/libgcrypt-03-aliasing.patch	Fri Jun 17 08:45:56 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-#
-# Resolves issues reported by 'make check':
-# selftest for CFB failed - see syslog for details
-# pass 0, algo 4, mode 1, gcry_cipher_setkey failed: Selftest failed
-# pass 0, algo 4, mode 2, gcry_cipher_setkey failed: Selftest failed
-# pass 0, algo 4, mode 5, gcry_cipher_setkey failed: Selftest failed
-# pass 0, algo 4, mode 3, gcry_cipher_setkey failed: Selftest failed
-# pass 0, algo 4, mode 3, gcry_cipher_setkey failed: Selftest failed
-# pass 0, algo 4, mode 6, gcry_cipher_setkey failed: Selftest failed
-# FAIL: basic
-# 
-# The original bug in the upstream: https://bugs.gnupg.org/gnupg/issue2144
-# This is an alternate patch to the fix delivered by the upstream. This
-# is because upstream has resolved the issue in a source code of a later
-# version of libgcrypt (post 1.6.4); the patch used by the upstream
-# patches files not yet existing in the version 1.6.4. This patch will
-# go away once libgcrypt is update to a version > 1.6.4.
-#
-# This is an in-house developed patch inspired by the comments made by
-# the libgcrypt community in the respective email thread on
-# [email protected].
-#
---- ./cipher/bufhelp.h.aliasing	2015-02-27 10:54:03.000000000 +0100
-+++ ./cipher/bufhelp.h	2015-03-13 15:03:43.301749751 +0100
-@@ -80,7 +80,7 @@ do_bytes:
-   for (; len; len--)
-     *dst++ = *src++;
- #endif /*__GNUC__ >= 4 && (__x86_64__ || __i386__)*/
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- 
- /* Optimized function for buffer xoring */
-@@ -117,7 +117,7 @@ do_bytes:
-   /* Handle tail.  */
-   for (; len; len--)
-     *dst++ = *src1++ ^ *src2++;
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- 
- /* Optimized function for buffer xoring with two destination buffers.  Used
-@@ -155,7 +155,7 @@ do_bytes:
-   /* Handle tail.  */
-   for (; len; len--)
-     *dst1++ = (*dst2++ ^= *src++);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- 
- /* Optimized function for combined buffer xoring and copying.  Used by mainly
-@@ -208,7 +208,7 @@ do_bytes:
-       *dst_xor++ = *srcdst_cpy ^ *src_xor++;
-       *srcdst_cpy++ = temp;
-     }
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- 
- /* Optimized function for combined buffer xoring and copying.  Used by mainly
-@@ -234,7 +234,7 @@ buf_eq_const(const void *_a, const void
-     diff -= !!(a[i] - b[i]);
- 
-   return !diff;
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- 
- #ifndef BUFHELP_FAST_UNALIGNED_ACCESS
-@@ -246,14 +246,14 @@ static inline u32 buf_get_be32(const voi
-   const byte *in = _buf;
-   return ((u32)in[0] << 24) | ((u32)in[1] << 16) | \
-          ((u32)in[2] << 8) | (u32)in[3];
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline u32 buf_get_le32(const void *_buf)
- {
-   const byte *in = _buf;
-   return ((u32)in[3] << 24) | ((u32)in[2] << 16) | \
-          ((u32)in[1] << 8) | (u32)in[0];
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline void buf_put_be32(void *_buf, u32 val)
- {
-@@ -262,7 +262,7 @@ static inline void buf_put_be32(void *_b
-   out[1] = val >> 16;
-   out[2] = val >> 8;
-   out[3] = val;
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline void buf_put_le32(void *_buf, u32 val)
- {
-@@ -271,7 +271,7 @@ static inline void buf_put_le32(void *_b
-   out[2] = val >> 16;
-   out[1] = val >> 8;
-   out[0] = val;
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- #ifdef HAVE_U64_TYPEDEF
- /* Functions for loading and storing unaligned u64 values of different
-@@ -283,7 +283,7 @@ static inline u64 buf_get_be64(const voi
-          ((u64)in[2] << 40) | ((u64)in[3] << 32) | \
-          ((u64)in[4] << 24) | ((u64)in[5] << 16) | \
-          ((u64)in[6] << 8) | (u64)in[7];
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline u64 buf_get_le64(const void *_buf)
- {
-@@ -292,7 +292,7 @@ static inline u64 buf_get_le64(const voi
-          ((u64)in[5] << 40) | ((u64)in[4] << 32) | \
-          ((u64)in[3] << 24) | ((u64)in[2] << 16) | \
-          ((u64)in[1] << 8) | (u64)in[0];
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline void buf_put_be64(void *_buf, u64 val)
- {
-@@ -305,7 +305,7 @@ static inline void buf_put_be64(void *_b
-   out[5] = val >> 16;
-   out[6] = val >> 8;
-   out[7] = val;
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline void buf_put_le64(void *_buf, u64 val)
- {
-@@ -318,7 +318,7 @@ static inline void buf_put_le64(void *_b
-   out[2] = val >> 16;
-   out[1] = val >> 8;
-   out[0] = val;
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- #endif /*HAVE_U64_TYPEDEF*/
- 
- #else /*BUFHELP_FAST_UNALIGNED_ACCESS*/
-@@ -328,24 +328,24 @@ static inline void buf_put_le64(void *_b
- static inline u32 buf_get_be32(const void *_buf)
- {
-   return be_bswap32(*(const u32 *)_buf);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline u32 buf_get_le32(const void *_buf)
- {
-   return le_bswap32(*(const u32 *)_buf);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline void buf_put_be32(void *_buf, u32 val)
- {
-   u32 *out = _buf;
-   *out = be_bswap32(val);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline void buf_put_le32(void *_buf, u32 val)
- {
-   u32 *out = _buf;
-   *out = le_bswap32(val);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- #ifdef HAVE_U64_TYPEDEF
- /* Functions for loading and storing unaligned u64 values of different
-@@ -353,24 +353,24 @@ static inline void buf_put_le32(void *_b
- static inline u64 buf_get_be64(const void *_buf)
- {
-   return be_bswap64(*(const u64 *)_buf);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline u64 buf_get_le64(const void *_buf)
- {
-   return le_bswap64(*(const u64 *)_buf);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline void buf_put_be64(void *_buf, u64 val)
- {
-   u64 *out = _buf;
-   *out = be_bswap64(val);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- 
- static inline void buf_put_le64(void *_buf, u64 val)
- {
-   u64 *out = _buf;
-   *out = le_bswap64(val);
--}
-+} __attribute__ ((optimize("no-strict-aliasing")))
- #endif /*HAVE_U64_TYPEDEF*/
- 
- #endif /*BUFHELP_FAST_UNALIGNED_ACCESS*/
--- a/components/libgcrypt/test/results-all.master	Fri Jun 17 08:45:56 2016 -0700
+++ b/components/libgcrypt/test/results-all.master	Fri Jun 17 08:45:56 2016 -0700
@@ -1,6 +1,6 @@
 PASS: version
 PASS: mpitests
-PASS: tsexp
+PASS: t-sexp
 PASS: t-convert
 PASS: t-mpi-bit
 PASS: t-mpi-point
@@ -20,6 +20,7 @@
 PASS: random
 PASS: dsa-rfc6979
 PASS: t-ed25519
+PASS: t-cv25519
 PASS: benchmark
 PASS: bench-slope
-All 24 tests passed
+All 25 tests passed