From owner-svn-ports-head@FreeBSD.ORG Wed May 22 22:41:43 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8E484ED6; Wed, 22 May 2013 22:41:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8029CD88; Wed, 22 May 2013 22:41:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MMfhfr001143; Wed, 22 May 2013 22:41:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MMfg7x001140; Wed, 22 May 2013 22:41:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305222241.r4MMfg7x001140@svn.freebsd.org> From: Xin LI Date: Wed, 22 May 2013 22:41:42 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r318802 - in head/security/cryptopp: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 22:41:43 -0000 Author: delphij Date: Wed May 22 22:41:42 2013 New Revision: 318802 URL: http://svnweb.freebsd.org/changeset/ports/318802 Log: This changeset fixes two issues with crypto++ library: * patch-misc.h This fixes a warning triggered by testing an unsigned parameter against 0. The patch solves this by creating a different template for signed case. * patch-nbtheory.cpp This is a workaround for a bug with the current version of libc++ shipped with FreeBSD 9.x, which causes an infinite loop when generating RSA key, possibly also other operations. PR: ports/178827 Submitted by: Michael Gmelin Added: head/security/cryptopp/files/patch-misc.h (contents, props changed) head/security/cryptopp/files/patch-nbtheory.cpp (contents, props changed) Modified: head/security/cryptopp/Makefile Modified: head/security/cryptopp/Makefile ============================================================================== --- head/security/cryptopp/Makefile Wed May 22 22:21:52 2013 (r318801) +++ head/security/cryptopp/Makefile Wed May 22 22:41:42 2013 (r318802) @@ -3,7 +3,7 @@ PORTNAME= cryptopp PORTVERSION= 5.6.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= security MASTER_SITES= SF \ http://www.cryptopp.com/ Added: head/security/cryptopp/files/patch-misc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/cryptopp/files/patch-misc.h Wed May 22 22:41:42 2013 (r318802) @@ -0,0 +1,54 @@ +--- misc.h.orig 2010-08-06 18:46:18.000000000 +0000 ++++ misc.h 2013-05-22 08:43:01.949194748 +0000 +@@ -405,17 +405,13 @@ + return order == GetNativeByteOrder(); + } + ++template struct IsUnsigned {}; ++ + template +-std::string IntToString(T a, unsigned int base = 10) ++std::string IntToStringImpl(T a, unsigned int base, IsUnsigned) + { + if (a == 0) + return "0"; +- bool negate = false; +- if (a < 0) +- { +- negate = true; +- a = 0-a; // VC .NET does not like -a +- } + std::string result; + while (a > 0) + { +@@ -423,11 +419,30 @@ + result = char((digit < 10 ? '0' : ('a' - 10)) + digit) + result; + a /= base; + } ++ return result; ++} ++ ++template ++std::string IntToStringImpl(T a, unsigned int base, IsUnsigned) ++{ ++ bool negate = false; ++ if (a < 0) ++ { ++ negate = true; ++ a = 0-a; // VC .NET does not like -a ++ } ++ std::string result = IntToStringImpl(a, base, IsUnsigned()); + if (negate) + result = "-" + result; + return result; + } + ++template ++std::string IntToString(T a, unsigned int base = 10) ++{ ++ return IntToStringImpl(a, base, IsUnsigned<(static_cast(-1) > 0)>()); ++} ++ + template + inline T1 SaturatingSubtract(const T1 &a, const T2 &b) + { Added: head/security/cryptopp/files/patch-nbtheory.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/cryptopp/files/patch-nbtheory.cpp Wed May 22 22:41:42 2013 (r318802) @@ -0,0 +1,21 @@ +--- nbtheory.cpp.orig 2013-05-22 00:16:26.761193859 +0000 ++++ nbtheory.cpp 2013-05-22 00:15:29.401256454 +0000 +@@ -307,7 +307,18 @@ + + bool PrimeSieve::NextCandidate(Integer &c) + { ++#if defined(__clang__) && defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 1101 ++ // Workaround for a bug in libc++ in std::find on std::vector ++ std::vector::iterator pos = m_sieve.begin()+m_next; ++ for (std::vector::iterator end = m_sieve.end(); pos != end; ++pos) ++ { ++ if (*pos == false) ++ break; ++ } ++ bool safe = SafeConvert(pos - m_sieve.begin(), m_next); ++#else + bool safe = SafeConvert(std::find(m_sieve.begin()+m_next, m_sieve.end(), false) - m_sieve.begin(), m_next); ++#endif + assert(safe); + if (m_next == m_sieve.size()) + {