Fix OpenSSL 3 and fold-expression warning regressions
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -530,7 +530,8 @@ public:
|
||||
{
|
||||
BeginMessage(pszCommand);
|
||||
ssSend << a1;
|
||||
(ssSend << ... << args);
|
||||
using swallow = int[];
|
||||
(void)swallow{0, ((void)(ssSend << args), 0)...};
|
||||
EndMessage();
|
||||
}
|
||||
catch (...)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user