diff --git a/backport-Clear-GCC-overflow-warning.patch b/backport-Clear-GCC-overflow-warning.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f71b62f79e4660129ccff94b878aa2cf5ef61d6 --- /dev/null +++ b/backport-Clear-GCC-overflow-warning.patch @@ -0,0 +1,23 @@ +From 9bb6680cfaedd3d46eff082ede8d0c76be6a2145 Mon Sep 17 00:00:00 2001 +From: Jeffrey Walton +Date: Thu, 25 Apr 2024 01:33:44 -0400 +Subject: [PATCH] Clear GCC overflow warning + +--- + esign.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/esign.cpp b/esign.cpp +index 10f4e47b4..5bcbbe973 100644 +--- a/esign.cpp ++++ b/esign.cpp +@@ -111,6 +111,9 @@ void InvertibleESIGNFunction::GenerateRandom(RandomNumberGenerator &rng, const N + + if (param.GetValue("Seed", seedParam)) + { ++ if (seedParam.size() > seed.ELEMS_MAX - 4) ++ throw InvalidArgument("InvertibleESIGNFunction::GenerateRandom: buffer overflow"); ++ + seed.resize(seedParam.size() + 4); + std::memcpy(seed + 4, seedParam.begin(), seedParam.size()); + diff --git a/backport-chore-fix-typos.patch b/backport-chore-fix-typos.patch new file mode 100644 index 0000000000000000000000000000000000000000..5e4030a96a311531942e94af4dbbb1e6f45f96c8 --- /dev/null +++ b/backport-chore-fix-typos.patch @@ -0,0 +1,65 @@ +From c2bd7efb49610c97cbd2e2258654bd51f741112d Mon Sep 17 00:00:00 2001 +From: Snoppy +Date: Tue, 23 Apr 2024 22:04:07 +0800 +Subject: [PATCH] chore: fix typos (#1274) + +Signed-off-by: snoppy +--- + nbtheory.h | 2 +- + osrng.cpp | 2 +- + rdrand.h | 2 +- + validate.h | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/nbtheory.h b/nbtheory.h +index 66b805a66..bdaf275d0 100644 +--- a/nbtheory.h ++++ b/nbtheory.h +@@ -112,7 +112,7 @@ CRYPTOPP_DLL bool CRYPTOPP_API IsPrime(const Integer &p); + /// level is greater than 1, then 10 round RabinMillerTest() primality testing is performed. + CRYPTOPP_DLL bool CRYPTOPP_API VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level = 1); + +-/// \brief Application callback to signal suitability of a cabdidate prime ++/// \brief Application callback to signal suitability of a candidate prime + class CRYPTOPP_DLL PrimeSelector + { + public: +diff --git a/osrng.cpp b/osrng.cpp +index bb92e832f..220fdfcf5 100644 +--- a/osrng.cpp ++++ b/osrng.cpp +@@ -23,7 +23,7 @@ + + // FreeBSD links /dev/urandom -> /dev/random. It showed up when we added + // O_NOFOLLOW to harden the non-blocking generator. Use Arc4Random instead +-// for a non-blocking generator. Arc4Random is cryptograhic quality prng ++// for a non-blocking generator. Arc4Random is cryptographic quality prng + // based on ChaCha20. The ChaCha20 generator is seeded from /dev/random, + // so we can't completely avoid the blocking. + // https://www.freebsd.org/cgi/man.cgi?query=arc4random_buf. +diff --git a/rdrand.h b/rdrand.h +index 17169c7a6..9c25395db 100644 +--- a/rdrand.h ++++ b/rdrand.h +@@ -20,7 +20,7 @@ + // GenerateBlock unconditionally retries and always fulfills the request. + + // Throughput varies wildly depending on processor and manufacturer. A Core i5 or +-// Core i7 RDRAND can generate at over 200 MiB/s. It is below theroetical ++// Core i7 RDRAND can generate at over 200 MiB/s. It is below theoretical + // maximum, but it takes about 5 instructions to generate, retry and store a + // result. A low-end Celeron may perform RDRAND at about 7 MiB/s. RDSEED + // performs at about 1/4 to 1/2 the rate of RDRAND. AMD RDRAND performed poorly +diff --git a/validate.h b/validate.h +index d55e48f79..9053393f1 100644 +--- a/validate.h ++++ b/validate.h +@@ -21,7 +21,7 @@ NAMESPACE_BEGIN(CryptoPP) + NAMESPACE_BEGIN(Test) + + // A hint to help locate TestData/ and TestVectors/ after install. Due to +-// execve the path can be malicious. If the path is ficticous then we move ++// execve the path can be malicious. If the path is fictitious then we move + // onto the next potential path. Also note we only read from the path; we + // never write through it. Storage for the string is in test.cpp. + extern std::string g_argvPathHint; diff --git a/cryptopp.spec b/cryptopp.spec index a993e035103c768f7bb8d82c7893e1a9218169c2..4d812c1f2cbb5eb5e7989f0555f530a9589f9df2 100755 --- a/cryptopp.spec +++ b/cryptopp.spec @@ -2,13 +2,15 @@ Name: cryptopp Version: 8.9.0 -Release: 1 +Release: 2 Summary: C++ class library of cryptographic schemes License: Boost URL: http://www.cryptopp.com/ Source0: http://www.cryptopp.com/cryptopp890.zip Source1: cryptopp.pc #Patch0: https://github.com/weidai11/cryptopp/commit/94aba0105efa.patch +Patch0: backport-chore-fix-typos.patch +Patch1: backport-Clear-GCC-overflow-warning.patch BuildRequires: doxygen BuildRequires: clang @@ -117,6 +119,10 @@ rm %{buildroot}%{_libdir}/libcryptopp.a %{_datadir}/%{name} %changelog +* Tue Jul 16 2024 zhangxingrong- - 8.9.0-2 +- chore: fix typos (#1274) +- Clear GCC overflow warning + * Tue Mar 05 mengchaoming - 8.9.0-1 - upgrade to version 8.9.0