libcrypto++: fix build with GCC 4.7.0 (#12310)
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 7 Jan 2013 21:04:06 +0000 (21:04 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 7 Jan 2013 21:04:06 +0000 (21:04 +0000)
Signed-off-by: Florian Fainelli <florian@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/packages@35048 3c298f89-4303-0410-b956-a3cf2f4a3e73

libs/libcrypto++/Makefile
libs/libcrypto++/patches/004-gcc4.7.0.patch [new file with mode: 0644]

index f9bbd79..734ef0a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009-2010 OpenWrt.org
+# Copyright (C) 2009-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcrypto++
 PKG_VERSION:=5.6.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/libc/libcrypto++/
diff --git a/libs/libcrypto++/patches/004-gcc4.7.0.patch b/libs/libcrypto++/patches/004-gcc4.7.0.patch
new file mode 100644 (file)
index 0000000..a2ef66a
--- /dev/null
@@ -0,0 +1,102 @@
+diff -rupN libcrypto++-5.6.0.orig/algebra.cpp libcrypto++-5.6.0/algebra.cpp\r
+--- libcrypto++-5.6.0.orig/algebra.cpp Sun Mar  1 20:44:04 2009\r
++++ libcrypto++-5.6.0/algebra.cpp      Fri Oct 12 20:18:44 2012\r
+@@ -58,7 +58,7 @@ template <class T> const T& AbstractEucl\r
+       Element g[3]={b, a};\r
+       unsigned int i0=0, i1=1, i2=2;\r
\r
+-      while (!Equal(g[i1], this->Identity()))\r
++      while (!this->Equal(g[i1], this->Identity()))\r
+       {\r
+               g[i2] = Mod(g[i0], g[i1]);\r
+               unsigned int t = i0; i0 = i1; i1 = i2; i2 = t;\r
+diff -rupN libcrypto++-5.6.0.orig/eccrypto.cpp libcrypto++-5.6.0/eccrypto.cpp\r
+--- libcrypto++-5.6.0.orig/eccrypto.cpp        Sun Mar 15 03:48:02 2009\r
++++ libcrypto++-5.6.0/eccrypto.cpp     Fri Oct 12 20:17:08 2012\r
+@@ -435,7 +435,7 @@ template <class EC> void DL_GroupParamet\r
+       StringSource ssG(param.g, true, new HexDecoder);\r
+       Element G;\r
+       bool result = GetCurve().DecodePoint(G, ssG, (size_t)ssG.MaxRetrievable());\r
+-      SetSubgroupGenerator(G);\r
++      this->SetSubgroupGenerator(G);\r
+       assert(result);\r
\r
+       StringSource ssN(param.n, true, new HexDecoder);\r
+@@ -591,7 +591,7 @@ bool DL_GroupParameters_EC<EC>::Validate\r
+       if (level >= 2 && pass)\r
+       {\r
+               const Integer &q = GetSubgroupOrder();\r
+-              Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : ExponentiateElement(g, q);\r
++              Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : this->ExponentiateElement(g, q);\r
+               pass = pass && IsIdentity(gq);\r
+       }\r
+       return pass;\r
+@@ -629,7 +629,7 @@ void DL_PublicKey_EC<EC>::BERDecodePubli\r
+       typename EC::Point P;\r
+       if (!this->GetGroupParameters().GetCurve().DecodePoint(P, bt, size))\r
+               BERDecodeError();\r
+-      SetPublicElement(P);\r
++      this->SetPublicElement(P);\r
+ }\r
\r
+ template <class EC>\r
+diff -rupN libcrypto++-5.6.0.orig/eccrypto.h libcrypto++-5.6.0/eccrypto.h\r
+--- libcrypto++-5.6.0.orig/eccrypto.h  Sun Mar  1 20:44:02 2009\r
++++ libcrypto++-5.6.0/eccrypto.h       Fri Oct 12 20:17:30 2012\r
+@@ -43,7 +43,7 @@ public:\r
+       void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero())\r
+       {\r
+               this->m_groupPrecomputation.SetCurve(ec);\r
+-              SetSubgroupGenerator(G);\r
++              this->SetSubgroupGenerator(G);\r
+               m_n = n;\r
+               m_k = k;\r
+       }\r
+@@ -145,9 +145,9 @@ public:\r
+       typedef typename EC::Point Element;\r
\r
+       void Initialize(const DL_GroupParameters_EC<EC> &params, const Element &Q)\r
+-              {this->AccessGroupParameters() = params; SetPublicElement(Q);}\r
++              {this->AccessGroupParameters() = params; this->SetPublicElement(Q);}\r
+       void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q)\r
+-              {this->AccessGroupParameters().Initialize(ec, G, n); SetPublicElement(Q);}\r
++              {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);}\r
\r
+       // X509PublicKey\r
+       void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size);\r
+@@ -166,9 +166,9 @@ public:\r
+       void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x)\r
+               {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);}\r
+       void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC<EC> &params)\r
+-              {GenerateRandom(rng, params);}\r
++              {this->GenerateRandom(rng, params);}\r
+       void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n)\r
+-              {GenerateRandom(rng, DL_GroupParameters_EC<EC>(ec, G, n));}\r
++              {this->GenerateRandom(rng, DL_GroupParameters_EC<EC>(ec, G, n));}\r
\r
+       // PKCS8PrivateKey\r
+       void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size);\r
+diff -rupN libcrypto++-5.6.0.orig/panama.cpp libcrypto++-5.6.0/panama.cpp\r
+--- libcrypto++-5.6.0.orig/panama.cpp  Sun Mar  1 20:44:00 2009\r
++++ libcrypto++-5.6.0/panama.cpp       Fri Oct 12 20:19:27 2012\r
+@@ -420,7 +420,7 @@ void PanamaHash<B>::TruncatedFinal(byte \r
+ {\r
+       this->ThrowIfInvalidTruncatedSize(size);\r
\r
+-      PadLastBlock(this->BLOCKSIZE, 0x01);\r
++      this->PadLastBlock(this->BLOCKSIZE, 0x01);\r
+       \r
+       HashEndianCorrectedBlock(this->m_data);\r
\r
+diff -rupN libcrypto++-5.6.0.orig/secblock.h libcrypto++-5.6.0/secblock.h\r
+--- libcrypto++-5.6.0.orig/secblock.h  Sun Mar 15 03:48:02 2009\r
++++ libcrypto++-5.6.0/secblock.h       Fri Oct 12 20:13:31 2012\r
+@@ -94,7 +94,7 @@ public:\r
\r
+       pointer allocate(size_type n, const void * = NULL)\r
+       {\r
+-              CheckSize(n);\r
++              this->CheckSize(n);\r
+               if (n == 0)\r
+                       return NULL;\r
\r