Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJonathan White <support@dmapps.us>2019-11-09 02:06:13 +0300
committerJanek Bevendorff <janek@jbev.net>2019-11-09 02:53:40 +0300
commitf9d26960462349196306a4ce4815978e5268ec47 (patch)
treedf246cb2a7b04384bef2b32f009f590e37757924 /tests
parent4edb623745a925bb96df0fab93bb87b2f6dec64f (diff)
Relax strictness of TOTP Base32 validation
* Fix #3754 - Accept valid TOTP keys that require padding when converted to Base32. * Allow use of spaces and lower case letters in the TOTP secret key.
Diffstat (limited to 'tests')
-rw-r--r--tests/gui/TestGui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp
index ca208db01..2a0bef483 100644
--- a/tests/gui/TestGui.cpp
+++ b/tests/gui/TestGui.cpp
@@ -756,7 +756,8 @@ void TestGui::testTotp()
QApplication::processEvents();
- QString exampleSeed = "gezdgnbvgy3tqojqgezdgnbvgy3tqojq";
+ QString exampleSeed = "gezd gnbvgY 3tqojqGEZdgnb vgy3tqoJq===";
+ QString expectedFinalSeed = exampleSeed.toUpper().remove(" ").remove("=");
auto* seedEdit = setupTotpDialog->findChild<QLineEdit*>("seedEdit");
seedEdit->setText("");
QTest::keyClicks(seedEdit, exampleSeed);
@@ -781,7 +782,7 @@ void TestGui::testTotp()
editEntryWidget->setCurrentPage(1);
auto* attrTextEdit = editEntryWidget->findChild<QPlainTextEdit*>("attributesEdit");
QTest::mouseClick(editEntryWidget->findChild<QAbstractButton*>("revealAttributeButton"), Qt::LeftButton);
- QCOMPARE(attrTextEdit->toPlainText(), exampleSeed);
+ QCOMPARE(attrTextEdit->toPlainText(), expectedFinalSeed);
auto* editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);