From b82695b89ff59ed053f7133ef9c192ffae66ab84 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 5 Nov 2014 11:42:51 +0100 Subject: [Qt] make PaymentServer::ipcParseCommandLine void - the function only returned true, so make it void - add a comment about payment request network detection --- src/qt/paymentserver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qt/paymentserver.h') diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index 25b08cde49..0103cbdd0d 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -59,7 +59,7 @@ class PaymentServer : public QObject public: // Parse URIs on command line // Returns false on error - static bool ipcParseCommandLine(int argc, char *argv[]); + static void ipcParseCommandLine(int argc, char *argv[]); // Returns true if there were URIs on the command line // which were successfully sent to an already-running -- cgit v1.2.3 From 31f84944a5f6f1aa07e36e7700e9ab16be88aa42 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 19 Nov 2014 12:53:57 +0100 Subject: [Qt] add BIP70 payment request size DoS protection for URIs - current code only does this for payment request files, which are used on Mac - also rename readPaymentRequest to readPaymentRequestFromFile, so it's obvious that function only handles payment request files and not URIs - small logging changes in readPaymentRequestFromFile --- src/qt/paymentserver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qt/paymentserver.h') diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index 0103cbdd0d..9acd99723c 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -118,7 +118,7 @@ protected: bool eventFilter(QObject *object, QEvent *event); private: - static bool readPaymentRequest(const QString& filename, PaymentRequestPlus& request); + static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request); bool processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient); void fetchRequest(const QUrl& url); -- cgit v1.2.3 From 4333e26c8e89e3d02cfb4d3464108b1a15175e2b Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 5 Dec 2014 09:39:23 +0100 Subject: [Qt] add BIP70 DoS protection test - this test required to make readPaymentRequestFromFile() public in order to be able to is it in paymentservertests.cpp --- src/qt/paymentserver.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/qt/paymentserver.h') diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index 9acd99723c..42940664ec 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -52,6 +52,9 @@ QT_END_NAMESPACE class CWallet; +// BIP70 max payment request size in bytes (DoS protection) +extern const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE; + class PaymentServer : public QObject { Q_OBJECT @@ -85,6 +88,9 @@ public: // OptionsModel is used for getting proxy settings and display unit void setOptionsModel(OptionsModel *optionsModel); + // This is now public, because we use it in paymentservertests.cpp + static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request); + signals: // Fired when a valid payment request is received void receivedPaymentRequest(SendCoinsRecipient); @@ -118,7 +124,6 @@ protected: bool eventFilter(QObject *object, QEvent *event); private: - static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request); bool processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient); void fetchRequest(const QUrl& url); -- cgit v1.2.3 From 5ec654b8ceb4c5f9aafda2b62a0aa6639d738654 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 5 Dec 2014 09:40:58 +0100 Subject: [Qt] update paymentserver license and cleanup ordering --- src/qt/paymentserver.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qt/paymentserver.h') diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index 42940664ec..e1305b9437 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -1,5 +1,5 @@ // Copyright (c) 2011-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_PAYMENTSERVER_H @@ -40,6 +40,8 @@ class OptionsModel; +class CWallet; + QT_BEGIN_NAMESPACE class QApplication; class QByteArray; @@ -50,8 +52,6 @@ class QSslError; class QUrl; QT_END_NAMESPACE -class CWallet; - // BIP70 max payment request size in bytes (DoS protection) extern const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE; -- cgit v1.2.3