diff options
author | Jonathan White <support@dmapps.us> | 2019-11-09 02:06:13 +0300 |
---|---|---|
committer | Janek Bevendorff <janek@jbev.net> | 2019-11-09 02:53:40 +0300 |
commit | f9d26960462349196306a4ce4815978e5268ec47 (patch) | |
tree | df246cb2a7b04384bef2b32f009f590e37757924 /tests | |
parent | 4edb623745a925bb96df0fab93bb87b2f6dec64f (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.cpp | 5 |
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); |