Skip to content

Commit df42bcd

Browse files
committed
Merge #9785: Avoid variable length arrays
c801c82 Move BIP70_MAX_PAYMENTREQUEST_SIZE to header (Pieter Wuille) 914fad1 Make KEY_SIZE a compile-time constant (Pieter Wuille)
2 parents f87e8f5 + c801c82 commit df42bcd

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/httprpc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static bool multiUserAuthorized(std::string strUserPass)
112112
std::string strSalt = vFields[1];
113113
std::string strHash = vFields[2];
114114

115-
unsigned int KEY_SIZE = 32;
115+
static const unsigned int KEY_SIZE = 32;
116116
unsigned char out[KEY_SIZE];
117117

118118
CHMAC_SHA256(reinterpret_cast<const unsigned char*>(strSalt.c_str()), strSalt.size()).Write(reinterpret_cast<const unsigned char*>(strPass.c_str()), strPass.size()).Finalize(out);

src/qt/paymentserver.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ const char* BIP70_MESSAGE_PAYMENTREQUEST = "PaymentRequest";
5555
const char* BIP71_MIMETYPE_PAYMENT = "application/bitcoin-payment";
5656
const char* BIP71_MIMETYPE_PAYMENTACK = "application/bitcoin-paymentack";
5757
const char* BIP71_MIMETYPE_PAYMENTREQUEST = "application/bitcoin-paymentrequest";
58-
// BIP70 max payment request size in bytes (DoS protection)
59-
const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE = 50000;
6058

6159
struct X509StoreDeleter {
6260
void operator()(X509_STORE* b) {

src/qt/paymentserver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class QUrl;
5353
QT_END_NAMESPACE
5454

5555
// BIP70 max payment request size in bytes (DoS protection)
56-
extern const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE;
56+
static const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE = 50000;
5757

5858
class PaymentServer : public QObject
5959
{

0 commit comments

Comments
 (0)