aboutsummaryrefslogtreecommitdiff
path: root/src/noui.cpp
diff options
context:
space:
mode:
authorMark Friedenbach <mark@blockstream.io>2014-10-16 16:16:29 -0700
committerMark Friedenbach <mark@blockstream.io>2014-10-17 00:33:31 -0700
commitd4746d56c0c45b8721da36bc19b2bdaba5d7d094 (patch)
tree01304911064e6f0ccce518ab2d7456b89681d0c4 /src/noui.cpp
parente8f6d54f1f58d9a5998e37367b84b427e51e1ad7 (diff)
Add a SECURE style flag for ThreadSafeMessageBox, which indicates that the message contains sensitive information. This keeps the message from being output to the debug log by bitcoind. Fixes a possible security risk when starting bitcoind in server mode without the 'rpcpassword' option configured, resulting in the "suggested" password being output to the debug log.
Diffstat (limited to 'src/noui.cpp')
-rw-r--r--src/noui.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/noui.cpp b/src/noui.cpp
index f786a20db5..8f3b0275b0 100644
--- a/src/noui.cpp
+++ b/src/noui.cpp
@@ -14,6 +14,9 @@
static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
{
+ bool fSecure = style & CClientUIInterface::SECURE;
+ style &= ~CClientUIInterface::SECURE;
+
std::string strCaption;
// Check for usage of predefined caption
switch (style) {
@@ -30,7 +33,8 @@ static bool noui_ThreadSafeMessageBox(const std::string& message, const std::str
strCaption += caption; // Use supplied caption (can be empty)
}
- LogPrintf("%s: %s\n", strCaption, message);
+ if (!fSecure)
+ LogPrintf("%s: %s\n", strCaption, message);
fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
return false;
}