aboutsummaryrefslogtreecommitdiff
path: root/security/cryptopp
diff options
context:
space:
mode:
authorJason E. Hale <jhale@FreeBSD.org>2018-08-24 17:22:01 +0000
committerJason E. Hale <jhale@FreeBSD.org>2018-08-24 17:22:01 +0000
commitedf512ca2e5e5a59e84993103663d499dc54600d (patch)
tree755180fd4810fbf33aa78186166afc94eafc7a8e /security/cryptopp
parentd0dff0b145c82c7f6acffe2125012004f4d4d6cb (diff)
downloadports-edf512ca2e5e5a59e84993103663d499dc54600d.tar.gz
ports-edf512ca2e5e5a59e84993103663d499dc54600d.zip
Update security/cryptopp to 7.0.0
We now install a pkgconfig file which will allow ports to check whether cryptopp was built with assembly instructions enabled or not. There are a few functions that will be undefined if built without assembly and -DCRYPTOPP_DISABLE_ASM needs to be passed to the compiler in that case to avoid build failures. This is not new, but the pkgconf file should make it easier to determine if the flag is needed or not. Fix several ports due to API changes and to use the new pkgconf file to determine cryptopp location and build flags. Special cases below. deskutils/cdcat - Use cryptopp shared library instead of static, detect with pkgconf devel/xeus - Fix dependencies and remove header-only libraries from RUN_DEPENDS - Rework to use the cryptopp pkgconf file - net/cppzmq CMake files were fixed in r477649, remove hacks for that as they were seemingly causing devel/xeus-cling to link to cryptopp unnecessarily - Remove C++17 code from cryptopp checks for compatibility devel/xeus-cling - Fix dependencies - Remove hacks for previously broken cppzmq CMake files and no longer needed cryptopp dependency Changes: https://www.cryptopp.com/#news PR: 230579 (original patch, not used) Submitted by: yuri
Notes
Notes: svn path=/head/; revision=477967
Diffstat (limited to 'security/cryptopp')
-rw-r--r--security/cryptopp/Makefile36
-rw-r--r--security/cryptopp/distinfo6
-rw-r--r--security/cryptopp/files/patch-GNUmakefile48
-rw-r--r--security/cryptopp/files/patch-config.h33
-rw-r--r--security/cryptopp/files/patch-cpu.h17
-rw-r--r--security/cryptopp/files/patch-misc.h26
-rw-r--r--security/cryptopp/files/patch-sse-simd.cpp13
-rw-r--r--security/cryptopp/pkg-plist19
8 files changed, 90 insertions, 108 deletions
diff --git a/security/cryptopp/Makefile b/security/cryptopp/Makefile
index 02182635ca71..73700d87bba6 100644
--- a/security/cryptopp/Makefile
+++ b/security/cryptopp/Makefile
@@ -1,13 +1,8 @@
# Created by: George Reid <greid@ukug.uk.freebsd.org>
# $FreeBSD$
-# Minor version bumps may not be ABI compatible and deskutils/cdcat
-# links to the static library, so bump PORTREVISION of dependent
-# ports when appropriate.
-
PORTNAME= cryptopp
-PORTVERSION= 5.6.5
-PORTREVISION= 5
+PORTVERSION= 7.0.0
CATEGORIES= security
MASTER_SITES= http://www.cryptopp.com/
DISTNAME= cryptopp${PORTVERSION:S/.//g}
@@ -30,7 +25,7 @@ NO_WRKSUBDIR= yes
CXXFLAGS+= -Wno-deprecated-declarations -fPIC
MAKEFILE= GNUmakefile
-ALL_TARGET= static shared
+ALL_TARGET= static shared libcryptopp.pc
SOVERSION= ${PORTVERSION:R:R}
PLIST_SUB+= SOVERSION=${SOVERSION} \
@@ -61,30 +56,18 @@ THREADS_LDFLAGS= -lpthread
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MSIMD}
-. if ${MACHINE_CPU:Msse2}
-USES+= compiler:c++14-lang
-CXXFLAGS+= -msse2
-. else
+. if !${MACHINE_CPU:Msse2}
CXXFLAGS+= -DCRYPTOPP_DISABLE_ASM -DCRYPTOPP_DISABLE_SSE2
. endif
-. if ${MACHINE_CPU:Msse3} && ${MACHINE_CPU:Mssse3}
-CXXFLAGS+= -msse3 -mssse3
-. else
-CXXFLAGS+= -DCRYPTOPP_DISABLE_SSE3
+. if !${MACHINE_CPU:Mssse3}
+CXXFLAGS+= -DCRYPTOPP_DISABLE_SSSE3
. endif
-. if ${MACHINE_CPU:Msse41} && ${MACHINE_CPU:Msse42}
-CXXFLAGS+= -msse4.1 -msse4.2
-. else
+. if !${MACHINE_CPU:Msse41}
CXXFLAGS+= -DCRYPTOPP_DISABLE_SSE4
. endif
.else
-CXXFLAGS+= -DCRYPTOPP_DISABLE_ASM
-.endif
-
-.include <bsd.port.pre.mk>
-
-.if ${PORT_OPTIONS:MSIMD} && ${MACHINE_CPU:Msse2} && ${CHOSEN_COMPILER_TYPE} == gcc
-USE_GCC= yes
+CXXFLAGS+= -DCRYPTOPP_DISABLE_ASM -DCRYPTOPP_DISABLE_SSE2 \
+ -DCRYPTOPP_DISABLE_SSSE3 -DCRYPTOPP_DISABLE_SSE4
.endif
pre-configure-FULL_DEBUG-on:
@@ -105,6 +88,7 @@ do-install:
${INSTALL_LIB} ${WRKSRC}/libcryptopp.so ${STAGEDIR}${PREFIX}/lib/libcryptopp.so.${PORTVERSION}
${LN} -fs libcryptopp.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libcryptopp.so.${SOVERSION}
${LN} -fs libcryptopp.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libcryptopp.so
+ ${INSTALL_DATA} ${WRKSRC}/libcryptopp.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
@${MKDIR} ${STAGEDIR}${PREFIX}/include/cryptopp
(for i in `${FIND} ${WRKSRC}/ -name '*.h' \
-and -not -name 'dll.h' \
@@ -121,4 +105,4 @@ do-install-TOOLS-on:
${INSTALL_PROGRAM} ${WRKSRC}/cryptest.exe ${STAGEDIR}${PREFIX}/bin/cryptest
${INSTALL_DATA} ${WRKSRC}/TestData/usage.dat ${STAGEDIR}${DATADIR}/TestData
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/security/cryptopp/distinfo b/security/cryptopp/distinfo
index 3507e3daa7d0..b58dfc78260a 100644
--- a/security/cryptopp/distinfo
+++ b/security/cryptopp/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1480818667
-SHA256 (cryptopp565.zip) = a75ef486fe3128008bbb201efee3dcdcffbe791120952910883b26337ec32c34
-SIZE (cryptopp565.zip) = 4220843
+TIMESTAMP = 1534123149
+SHA256 (cryptopp700.zip) = a4bc939910edd3d29fb819a6fc0dfdc293f686fa62326f61c56d72d0a366ceb0
+SIZE (cryptopp700.zip) = 7296665
diff --git a/security/cryptopp/files/patch-GNUmakefile b/security/cryptopp/files/patch-GNUmakefile
index 2e95be9a6c88..4e7fb30ea3a7 100644
--- a/security/cryptopp/files/patch-GNUmakefile
+++ b/security/cryptopp/files/patch-GNUmakefile
@@ -1,40 +1,24 @@
---- GNUmakefile.orig 2016-10-10 23:49:54 UTC
+We need to export the CRYPTOPP_DISABLE_ASM flag if cryptopp was not built
+with SIMD support. Certain functions prototypes are guarded by this
+flag and build failures will arise in other ports if not set appropriately.
+
+--- GNUmakefile.orig 2018-04-08 08:47:12 UTC
+++ GNUmakefile
-@@ -41,7 +41,7 @@ SUNCC_511_OR_LATER := $(shell $(CXX) -V
- SUNCC_512_OR_LATER := $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: (Sun|Studio) .* (5\.1[2-9]|5\.[2-9]|6\.)")
- SUNCC_513_OR_LATER := $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: (Sun|Studio) .* (5\.1[3-9]|5\.[2-9]|6\.)")
+@@ -90,7 +90,7 @@ SUNCC_512_OR_LATER := $(shell echo "$(SUNCC_VERSION)"
+ SUNCC_513_OR_LATER := $(shell echo "$(SUNCC_VERSION)" | $(GREP) -i -c -E "CC: (Sun|Studio) .* (5\.1[3-9]|5\.[2-9]|6\.)")
+ # Enable shared object versioning for Linux
-HAS_SOLIB_VERSION := $(IS_LINUX)
+HAS_SOLIB_VERSION := 1
# Fixup SunOS
ifeq ($(IS_SUN),1)
-@@ -126,11 +126,6 @@ ifeq ($(IS_X86)$(IS_X32)$(IS_CYGWIN)$(IS
- endif
-
- # Guard use of -march=native
--ifeq ($(GCC42_OR_LATER)$(IS_NETBSD),10)
-- CXXFLAGS += -march=native
--else ifneq ($(CLANG_COMPILER)$(INTEL_COMPILER),00)
-- CXXFLAGS += -march=native
--else
- # GCC 3.3 and "unknown option -march="
- # Ubuntu GCC 4.1 compiler crash with -march=native
- # NetBSD GCC 4.8 compiler and "bad value (native) for -march= switch"
-@@ -140,7 +135,6 @@ else
- else ifeq ($(SUN_COMPILER)$(IS_X86),01)
- CXXFLAGS += -m32
- endif # X86/X32/X64
--endif
-
- # Aligned access required for -O3 and above due to vectorization
- UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h)
-@@ -404,7 +398,7 @@ ifeq ($(HAS_SOLIB_VERSION),1)
- # Full version suffix for shared library
- SOLIB_VERSION_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)
- # Different patchlevels are compatible, minor versions are not
--SOLIB_COMPAT_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR)
-+SOLIB_COMPAT_SUFFIX=.$(LIB_MAJOR)
- SOLIB_FLAGS=-Wl,-soname,libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
- endif # HAS_SOLIB_VERSION
+@@ -957,7 +957,7 @@ libcryptopp.pc:
+ @echo 'Version: 7.0' >> libcryptopp.pc
+ @echo 'URL: https://cryptopp.com/' >> libcryptopp.pc
+ @echo '' >> libcryptopp.pc
+- @echo 'Cflags: -I$${includedir}' >> libcryptopp.pc
++ @echo 'Cflags: -I$${includedir} $(findstring -DCRYPTOPP_DISABLE_ASM,$(CXXFLAGS))' >> libcryptopp.pc
+ @echo 'Libs: -L$${libdir} -lcryptopp' >> libcryptopp.pc
+ # This recipe prepares the distro files
diff --git a/security/cryptopp/files/patch-config.h b/security/cryptopp/files/patch-config.h
deleted file mode 100644
index b12b8a2f7f36..000000000000
--- a/security/cryptopp/files/patch-config.h
+++ /dev/null
@@ -1,33 +0,0 @@
-The definition of CRYPTOPP_BOOL_ALIGN16_ENABLED was incorrect for i386.
-For NetBSD, this resulted in the inability to build cryptopp on i386.
-On FreeBSD, it built, but deskutils/cdcat choked on it while building on
-FreeBSD 10/i386 and FreeBSD 11/i386. (PR: 192199)
-
---- config.h.orig 2016-10-10 23:49:54 UTC
-+++ config.h
-@@ -534,12 +534,6 @@ NAMESPACE_END
- # endif
- #endif
-
--#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
-- #define CRYPTOPP_BOOL_ALIGN16 1
--#else
-- #define CRYPTOPP_BOOL_ALIGN16 0
--#endif
--
- // how to allocate 16-byte aligned memory (for SSE2)
- #if defined(CRYPTOPP_MSVC6PP_OR_LATER)
- #define CRYPTOPP_MM_MALLOC_AVAILABLE
-@@ -553,6 +547,12 @@ NAMESPACE_END
- #define CRYPTOPP_NO_ALIGNED_ALLOC
- #endif
-
-+#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) || !defined(CPRYPTO_NO_ALIGNED_ALLOC)
-+ #define CRYPTOPP_BOOL_ALIGN16 1
-+#else
-+ #define CRYPTOPP_BOOL_ALIGN16 0
-+#endif
-+
- // Apple always provides 16-byte aligned, and tells us to use calloc
- // http://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html
-
diff --git a/security/cryptopp/files/patch-cpu.h b/security/cryptopp/files/patch-cpu.h
new file mode 100644
index 000000000000..11cc6b1df9fb
--- /dev/null
+++ b/security/cryptopp/files/patch-cpu.h
@@ -0,0 +1,17 @@
+Fix build with SIMD on FreeBSD 10.x
+
+--- cpu.h.orig 2018-04-08 08:47:11 UTC
++++ cpu.h
+@@ -614,7 +614,12 @@ inline int GetCacheLineSize()
+ #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
+ #define GNU_AS3(x, y, z) #x ", " #y ", " #z ";" NEW_LINE
+ #define GNU_ASL(x) "\n" #x ":" NEW_LINE
++ // clang 5.0.0 and apple clang 9.0.0 don't support numerical backward jumps
++#if (CRYPTOPP_LLVM_CLANG_VERSION >= 30000) || (CRYPTOPP_APPLE_CLANG_VERSION >= 90000)
++ #define GNU_ASJ(x, y, z) ATT_PREFIX ";" NEW_LINE #x " " #y #z ";" NEW_LINE INTEL_PREFIX ";" NEW_LINE
++#else
+ #define GNU_ASJ(x, y, z) #x " " #y #z ";" NEW_LINE
++#endif
+ #define AS1(x) GNU_AS1(x)
+ #define AS2(x, y) GNU_AS2(x, y)
+ #define AS3(x, y, z) GNU_AS3(x, y, z)
diff --git a/security/cryptopp/files/patch-misc.h b/security/cryptopp/files/patch-misc.h
index 8b966dd471be..194061634cb6 100644
--- a/security/cryptopp/files/patch-misc.h
+++ b/security/cryptopp/files/patch-misc.h
@@ -2,12 +2,12 @@ This fixes a warning triggered by testing an unsigned parameter
against 0. The patch solves this by creating a different template
for signed case. (PR: 178827)
---- misc.h.orig 2016-10-10 23:49:54 UTC
+--- misc.h.orig 2018-04-08 08:47:11 UTC
+++ misc.h
-@@ -529,8 +529,10 @@ inline bool SafeConvert(T1 from, T2 &to)
- //! \param value the value to convert
- //! \param base the base to use during the conversion
- //! \returns the string representation of value in base.
+@@ -572,8 +572,10 @@ inline bool SafeConvert(T1 from, T2 &to)
+ /// \param value the value to convert
+ /// \param base the base to use during the conversion
+ /// \returns the string representation of value in base.
+template<bool> struct IsUnsigned {};
+
template <class T>
@@ -16,7 +16,7 @@ for signed case. (PR: 178827)
{
// Hack... set the high bit for uppercase.
static const unsigned int HIGH_BIT = (1U << 31);
-@@ -541,12 +543,6 @@ std::string IntToString(T value, unsigne
+@@ -584,12 +586,6 @@ std::string IntToString(T value, unsigned int base = 1
if (value == 0)
return "0";
@@ -29,7 +29,7 @@ for signed case. (PR: 178827)
std::string result;
while (value > 0)
{
-@@ -554,11 +550,30 @@ std::string IntToString(T value, unsigne
+@@ -597,9 +593,28 @@ std::string IntToString(T value, unsigned int base = 1
result = char((digit < 10 ? '0' : (CH - 10)) + digit) + result;
value /= base;
}
@@ -49,14 +49,12 @@ for signed case. (PR: 178827)
if (negate)
result = "-" + result;
return result;
- }
-
++}
++
+template <class T>
+std::string IntToString(T value, unsigned int base = 10)
+{
+ return IntToStringImpl(value, base, IsUnsigned<(static_cast<T>(-1) > 0)>());
-+}
-+
- //! \brief Converts an unsigned value to a string
- //! \param value the value to convert
- //! \param base the base to use during the conversion
+ }
+
+ /// \brief Converts an unsigned value to a string
diff --git a/security/cryptopp/files/patch-sse-simd.cpp b/security/cryptopp/files/patch-sse-simd.cpp
new file mode 100644
index 000000000000..52eddb09bf38
--- /dev/null
+++ b/security/cryptopp/files/patch-sse-simd.cpp
@@ -0,0 +1,13 @@
+Fix build without SIMD on FreeBSD 10.x
+
+--- sse-simd.cpp.orig 2018-04-08 08:47:12 UTC
++++ sse-simd.cpp
+@@ -23,7 +23,7 @@
+ #endif
+
+ // Needed by SunCC and MSVC
+-#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
++#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && defined(CRYPTOPP_SSE2_ASM_AVAILABLE)
+ # include <emmintrin.h>
+ #endif
+
diff --git a/security/cryptopp/pkg-plist b/security/cryptopp/pkg-plist
index 18a458440d48..bbe3232974fa 100644
--- a/security/cryptopp/pkg-plist
+++ b/security/cryptopp/pkg-plist
@@ -1,11 +1,13 @@
%%TOOLS%%bin/cryptest
include/cryptopp/3way.h
include/cryptopp/adler32.h
+include/cryptopp/adv-simd.h
include/cryptopp/aes.h
include/cryptopp/algebra.h
include/cryptopp/algparam.h
include/cryptopp/arc4.h
include/cryptopp/argnames.h
+include/cryptopp/aria.h
include/cryptopp/asn.h
include/cryptopp/authenc.h
include/cryptopp/base32.h
@@ -31,11 +33,13 @@ include/cryptopp/des.h
include/cryptopp/dh.h
include/cryptopp/dh2.h
include/cryptopp/dmac.h
+include/cryptopp/drbg.h
include/cryptopp/dsa.h
include/cryptopp/eax.h
include/cryptopp/ec2n.h
include/cryptopp/eccrypto.h
include/cryptopp/ecp.h
+include/cryptopp/ecpoint.h
include/cryptopp/elgamal.h
include/cryptopp/emsa2.h
include/cryptopp/eprecomp.h
@@ -53,6 +57,7 @@ include/cryptopp/gf2n.h
include/cryptopp/gfpcrypt.h
include/cryptopp/gost.h
include/cryptopp/gzip.h
+include/cryptopp/hashfwd.h
include/cryptopp/hex.h
include/cryptopp/hkdf.h
include/cryptopp/hmac.h
@@ -62,6 +67,7 @@ include/cryptopp/ida.h
include/cryptopp/idea.h
include/cryptopp/integer.h
include/cryptopp/iterhash.h
+include/cryptopp/kalyna.h
include/cryptopp/keccak.h
include/cryptopp/lubyrack.h
include/cryptopp/luc.h
@@ -77,6 +83,7 @@ include/cryptopp/modes.h
include/cryptopp/modexppc.h
include/cryptopp/mqueue.h
include/cryptopp/mqv.h
+include/cryptopp/naclite.h
include/cryptopp/nbtheory.h
include/cryptopp/network.h
include/cryptopp/nr.h
@@ -84,10 +91,13 @@ include/cryptopp/oaep.h
include/cryptopp/oids.h
include/cryptopp/osrng.h
include/cryptopp/ossig.h
+include/cryptopp/padlkrng.h
include/cryptopp/panama.h
include/cryptopp/pch.h
include/cryptopp/pkcspad.h
+include/cryptopp/poly1305.h
include/cryptopp/polynomi.h
+include/cryptopp/ppc-simd.h
include/cryptopp/pssr.h
include/cryptopp/pubkey.h
include/cryptopp/pwdbased.h
@@ -105,6 +115,7 @@ include/cryptopp/rsa.h
include/cryptopp/rw.h
include/cryptopp/safer.h
include/cryptopp/salsa.h
+include/cryptopp/scrypt.h
include/cryptopp/seal.h
include/cryptopp/secblock.h
include/cryptopp/seckey.h
@@ -115,20 +126,27 @@ include/cryptopp/sha.h
include/cryptopp/sha3.h
include/cryptopp/shacal2.h
include/cryptopp/shark.h
+include/cryptopp/simon.h
include/cryptopp/simple.h
+include/cryptopp/siphash.h
include/cryptopp/skipjack.h
+include/cryptopp/sm3.h
+include/cryptopp/sm4.h
include/cryptopp/smartptr.h
include/cryptopp/socketft.h
include/cryptopp/sosemanuk.h
+include/cryptopp/speck.h
include/cryptopp/square.h
include/cryptopp/stdcpp.h
include/cryptopp/strciphr.h
include/cryptopp/tea.h
+include/cryptopp/threefish.h
include/cryptopp/tiger.h
include/cryptopp/trap.h
include/cryptopp/trdlocal.h
include/cryptopp/trunhash.h
include/cryptopp/ttmac.h
+include/cryptopp/tweetnacl.h
include/cryptopp/twofish.h
include/cryptopp/validate.h
include/cryptopp/vmac.h
@@ -146,5 +164,6 @@ lib/libcryptopp.a
lib/libcryptopp.so
lib/libcryptopp.so.%%SOVERSION%%
lib/libcryptopp.so.%%PORTVERSION%%
+libdata/pkgconfig/libcryptopp.pc
%%TOOLS%%%%DATADIR%%/TestData/usage.dat
%%PORTDOCS%%%%DOCSDIR%%/README