[tor-commits] [vidalia/alpha] Adds a warning regarding plaintext storage of the passphrase
chiiph at torproject.org
chiiph at torproject.org
Mon Jan 23 16:45:42 UTC 2012
commit 500b509451890d203c2dfb9252e4b08c05ebb968
Author: Tomás Touceda <chiiph at torproject.org>
Date: Thu Jan 19 15:40:11 2012 -0300
Adds a warning regarding plaintext storage of the passphrase
---
src/vidalia/config/AdvancedPage.cpp | 11 +++++++++++
src/vidalia/config/AdvancedPage.h | 3 +++
src/vidalia/config/AdvancedPage.ui | 14 ++++++++++++--
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/vidalia/config/AdvancedPage.cpp b/src/vidalia/config/AdvancedPage.cpp
index b4e5827..ebee44f 100644
--- a/src/vidalia/config/AdvancedPage.cpp
+++ b/src/vidalia/config/AdvancedPage.cpp
@@ -60,6 +60,8 @@ AdvancedPage::AdvancedPage(QWidget *parent)
this, SLOT(authMethodChanged(int)));
connect(ui.chkRandomPassword, SIGNAL(toggled(bool)),
ui.linePassword, SLOT(setDisabled(bool)));
+ connect(ui.chkRandomPassword, SIGNAL(toggled(bool)),
+ this, SLOT(displayWarning(bool)));
connect(ui.btnEditTorConfig, SIGNAL(clicked()),
this, SLOT(displayTorrcDialog()));
connect(ui.rdoControlPort, SIGNAL(toggled(bool)), this, SLOT(toggleControl(bool)));
@@ -257,6 +259,7 @@ AdvancedPage::authMethodChanged(int index)
bool usePassword = (indexToAuthMethod(index) == TorSettings::PasswordAuth);
ui.linePassword->setEnabled(usePassword && !ui.chkRandomPassword->isChecked());
ui.chkRandomPassword->setEnabled(usePassword);
+ ui.lblWarn->setVisible((ui.chkRandomPassword->checkState() == Qt::Unchecked) and usePassword);
}
/** Returns the authentication method for the given <b>index</b>. */
@@ -432,3 +435,11 @@ AdvancedPage::toggleAuto(bool)
ui.label->setVisible(!ui.chkAuto->isChecked());
ui.lineControlPort->setVisible(!ui.chkAuto->isChecked());
}
+
+void
+AdvancedPage::displayWarning(bool checked)
+{
+ ui.lblWarn->setVisible(!checked and
+ indexToAuthMethod(ui.cmbAuthMethod->currentIndex()) ==
+ TorSettings::PasswordAuth);
+}
diff --git a/src/vidalia/config/AdvancedPage.h b/src/vidalia/config/AdvancedPage.h
index 4510310..df2587f 100644
--- a/src/vidalia/config/AdvancedPage.h
+++ b/src/vidalia/config/AdvancedPage.h
@@ -78,6 +78,9 @@ private slots:
/** Called when the user checks "Configure ControlPort automatically" */
void toggleAuto(bool);
+ /** Called when the user checks "Randomly Generate" checkbox */
+ void displayWarning(bool);
+
private:
/** Returns the authentication method for the given <b>index</b>. */
TorSettings::AuthenticationMethod indexToAuthMethod(int index);
diff --git a/src/vidalia/config/AdvancedPage.ui b/src/vidalia/config/AdvancedPage.ui
index 7776a18..664d322 100644
--- a/src/vidalia/config/AdvancedPage.ui
+++ b/src/vidalia/config/AdvancedPage.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>578</width>
- <height>543</height>
+ <width>586</width>
+ <height>522</height>
</rect>
</property>
<property name="contextMenuPolicy">
@@ -249,6 +249,16 @@
</item>
</layout>
</item>
+ <item>
+ <widget class="QLabel" name="lblWarn">
+ <property name="text">
+ <string>WARNING: If you hand pick the password it will be saved as plain text in Vidalia's configuration file. Using a random password is safer.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
More information about the tor-commits
mailing list