Fix OpenSSL 3 and fold-expression warning regressions

This commit is contained in:
Krystie
2026-05-09 21:27:36 -07:00
parent cdbbbb5316
commit f5e2ce5ca9
3 changed files with 12 additions and 1 deletions
+8
View File
@@ -11,6 +11,7 @@
#include "version.h"
#include <openssl/bn.h>
#include <openssl/opensslv.h>
#include <algorithm>
#include <stdexcept>
@@ -541,7 +542,14 @@ public:
*/
bool isPrime(const int checks=BN_prime_checks) const {
CAutoBN_CTX pctx;
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
int ret = BN_is_prime_ex(pbn, checks, pctx, nullptr);
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
#pragma GCC diagnostic pop
#endif
if(ret < 0){
throw bignum_error("CBigNum::isPrime :BN_is_prime_ex");
}
+2 -1
View File
@@ -530,7 +530,8 @@ public:
{
BeginMessage(pszCommand);
ssSend << a1;
(ssSend << ... << args);
using swallow = int[];
(void)swallow{0, ((void)(ssSend << args), 0)...};
EndMessage();
}
catch (...)
+2
View File
@@ -601,7 +601,9 @@ inline uint160 Hash160(const std::vector<unsigned char>& vch)
uint256 hash1;
SHA256(&vch[0], vch.size(), (unsigned char*)&hash1);
uint160 hash2;
TRI_OPENSSL_SUPPRESS_DEPRECATED_BEGIN
RIPEMD160((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2);
TRI_OPENSSL_SUPPRESS_DEPRECATED_END
return hash2;
}