mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
parent
3bbaeab278
commit
ba1bbd3b52
@ -29,6 +29,7 @@ TotpSetupDialog::TotpSetupDialog(QWidget* parent, Entry* entry)
|
|||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
setFixedSize(sizeHint());
|
setFixedSize(sizeHint());
|
||||||
|
|
||||||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close()));
|
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close()));
|
||||||
|
@ -163,7 +163,7 @@
|
|||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>60</number>
|
<number>86400</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>30</number>
|
<number>30</number>
|
||||||
|
@ -114,7 +114,7 @@ QSharedPointer<Totp::Settings> Totp::parseSettings(const QString& rawSettings, c
|
|||||||
|
|
||||||
// Bound digits and step
|
// Bound digits and step
|
||||||
settings->digits = qBound(1u, settings->digits, 10u);
|
settings->digits = qBound(1u, settings->digits, 10u);
|
||||||
settings->step = qBound(1u, settings->step, 60u);
|
settings->step = qBound(1u, settings->step, 86400u);
|
||||||
|
|
||||||
// Detect custom settings, used by setup GUI
|
// Detect custom settings, used by setup GUI
|
||||||
if (settings->encoder.shortName.isEmpty()
|
if (settings->encoder.shortName.isEmpty()
|
||||||
|
@ -59,6 +59,12 @@ void TestTotp::testParseSecret()
|
|||||||
QCOMPARE(settings->step, 30u);
|
QCOMPARE(settings->step, 30u);
|
||||||
QCOMPARE(settings->algorithm, Totp::Algorithm::Sha512);
|
QCOMPARE(settings->algorithm, Totp::Algorithm::Sha512);
|
||||||
|
|
||||||
|
// Max TOTP step of 24-hours
|
||||||
|
secret.replace("period=30", "period=90000");
|
||||||
|
settings = Totp::parseSettings(secret);
|
||||||
|
QVERIFY(!settings.isNull());
|
||||||
|
QCOMPARE(settings->step, 86400u);
|
||||||
|
|
||||||
// KeeOTP Parsing
|
// KeeOTP Parsing
|
||||||
secret = "key=HXDMVJECJJWSRBY%3d&step=25&size=8&otpHashMode=Sha256";
|
secret = "key=HXDMVJECJJWSRBY%3d&step=25&size=8&otpHashMode=Sha256";
|
||||||
settings = Totp::parseSettings(secret);
|
settings = Totp::parseSettings(secret);
|
||||||
|
Loading…
Reference in New Issue
Block a user