FreeBSD Bugzilla – Attachment 134194 Details for
Bug 178827
[PATCH] security/cryptopp: Bug in libc++ causes key generation to get stuck in endless loop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
cryptopp-5.6.1_3.patch
cryptopp-5.6.1_3.patch (text/x-patch), 2.82 KB, created by
Michael Gmelin
on 2013-05-22 12:37:58 UTC
(
hide
)
Description:
cryptopp-5.6.1_3.patch
Filename:
MIME Type:
Creator:
Michael Gmelin
Created:
2013-05-22 12:37:58 UTC
Size:
2.82 KB
patch
obsolete
>diff -ruN --exclude=CVS ../cryptopp.orig/Makefile ./Makefile >--- ../cryptopp.orig/Makefile 2013-05-22 02:18:44.000000000 +0200 >+++ ./Makefile 2013-05-22 02:19:32.000000000 +0200 >@@ -3,7 +3,7 @@ > > PORTNAME= cryptopp > PORTVERSION= 5.6.1 >-PORTREVISION= 2 >+PORTREVISION= 3 > CATEGORIES= security > MASTER_SITES= SF \ > http://www.cryptopp.com/ >diff -ruN --exclude=CVS ../cryptopp.orig/files/patch-misc.h ./files/patch-misc.h >--- ../cryptopp.orig/files/patch-misc.h 1970-01-01 01:00:00.000000000 +0100 >+++ ./files/patch-misc.h 2013-05-22 13:22:25.245963334 +0200 >@@ -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<bool> struct IsUnsigned {}; >++ >+ template <class T> >+-std::string IntToString(T a, unsigned int base = 10) >++std::string IntToStringImpl(T a, unsigned int base, IsUnsigned<true>) >+ { >+ 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 <class T> >++std::string IntToStringImpl(T a, unsigned int base, IsUnsigned<false>) >++{ >++ bool negate = false; >++ if (a < 0) >++ { >++ negate = true; >++ a = 0-a; // VC .NET does not like -a >++ } >++ std::string result = IntToStringImpl(a, base, IsUnsigned<true>()); >+ if (negate) >+ result = "-" + result; >+ return result; >+ } >+ >++template <class T> >++std::string IntToString(T a, unsigned int base = 10) >++{ >++ return IntToStringImpl(a, base, IsUnsigned<(static_cast<T>(-1) > 0)>()); >++} >++ >+ template <class T1, class T2> >+ inline T1 SaturatingSubtract(const T1 &a, const T2 &b) >+ { >diff -ruN --exclude=CVS ../cryptopp.orig/files/patch-nbtheory.cpp ./files/patch-nbtheory.cpp >--- ../cryptopp.orig/files/patch-nbtheory.cpp 1970-01-01 01:00:00.000000000 +0100 >+++ ./files/patch-nbtheory.cpp 2013-05-22 02:18:29.000000000 +0200 >@@ -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<bool> >++ std::vector<bool>::iterator pos = m_sieve.begin()+m_next; >++ for (std::vector<bool>::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()) >+ {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 178827
:
134193
| 134194