aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bitcoin-qt.pro6
-rw-r--r--src/qt/askpassphrasedialog.cpp14
-rw-r--r--src/qt/askpassphrasedialog.h2
-rw-r--r--src/rpcmining.cpp2
4 files changed, 13 insertions, 11 deletions
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro
index c38f265054..cd9755e8fa 100644
--- a/bitcoin-qt.pro
+++ b/bitcoin-qt.pro
@@ -33,11 +33,13 @@ contains(RELEASE, 1) {
!win32 {
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
-QMAKE_CXXFLAGS *= -fstack-protector-all --param ssp-buffer-size=1
-QMAKE_LFLAGS *= -fstack-protector-all --param ssp-buffer-size=1
+QMAKE_CXXFLAGS *= -fstack-protector-all
+QMAKE_LFLAGS *= -fstack-protector-all
# We need to exclude this for Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable!
# This can be enabled for Windows, when we switch to MinGW >= 4.4.x.
}
+# for extra security (see: https://wiki.debian.org/Hardening)
+QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp
index 03aa7af0be..cf35ee2457 100644
--- a/src/qt/askpassphrasedialog.cpp
+++ b/src/qt/askpassphrasedialog.cpp
@@ -19,7 +19,7 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE);
-
+
// Setup Caps Lock detection.
ui->passEdit1->installEventFilter(this);
ui->passEdit2->installEventFilter(this);
@@ -108,15 +108,15 @@ void AskPassphraseDialog::accept()
if(model->setWalletEncrypted(true, newpass1))
{
QMessageBox::warning(this, tr("Wallet encrypted"),
- "<qt>" +
+ "<qt>" +
tr("Bitcoin will close now to finish the encryption process. "
"Remember that encrypting your wallet cannot fully protect "
- "your bitcoins from being stolen by malware infecting your computer.") +
- "<br><br><b>" +
+ "your bitcoins from being stolen by malware infecting your computer.") +
+ "<br><br><b>" +
tr("IMPORTANT: Any previous backups you have made of your wallet file "
"should be replaced with the newly generated, encrypted wallet file. "
"For security reasons, previous backups of the unencrypted wallet file "
- "will become useless as soon as you start using the new, encrypted wallet.") +
+ "will become useless as soon as you start using the new, encrypted wallet.") +
"</b></qt>");
QApplication::quit();
}
@@ -221,7 +221,7 @@ bool AskPassphraseDialog::event(QEvent *event)
return QWidget::event(event);
}
-bool AskPassphraseDialog::eventFilter(QObject *, QEvent *event)
+bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
{
/* Detect Caps Lock.
* There is no good OS-independent way to check a key state in Qt, but we
@@ -244,5 +244,5 @@ bool AskPassphraseDialog::eventFilter(QObject *, QEvent *event)
}
}
}
- return false;
+ return QDialog::eventFilter(object, event);
}
diff --git a/src/qt/askpassphrasedialog.h b/src/qt/askpassphrasedialog.h
index b500ff49bf..338853ce22 100644
--- a/src/qt/askpassphrasedialog.h
+++ b/src/qt/askpassphrasedialog.h
@@ -39,7 +39,7 @@ private:
private slots:
void textChanged();
bool event(QEvent *event);
- bool eventFilter(QObject *, QEvent *event);
+ bool eventFilter(QObject *object, QEvent *event);
};
#endif // ASKPASSPHRASEDIALOG_H
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index 0270b5f102..0591f35392 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -198,7 +198,7 @@ Value getwork(const Array& params, bool fHelp)
Value getblocktemplate(const Array& params, bool fHelp)
{
- if (fHelp || params.size() != 1)
+ if (fHelp || params.size() > 1)
throw runtime_error(
"getblocktemplate [params]\n"
"Returns data needed to construct a block to work on:\n"