mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-09-27 11:51:16 -04:00
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.
This commit is contained in:
parent
4edb623745
commit
f9d2696046
2 changed files with 11 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue