chore: code fixups suggested by static analysis
parent
82ebbdf4f9
commit
653e0b4b44
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* SPDX-FileCopyrightText: 2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
* SPDX-FileCopyrightText: 2020-2021 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
||||||
*/
|
*/
|
||||||
#include "account/actions_p.h"
|
#include "account/actions_p.h"
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
class TestJob: public accounts::AccountJob
|
class TestJob: public accounts::AccountJob // clazy:exclude=ctor-missing-parent-argument
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -29,7 +29,7 @@ public Q_SLOTS:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class DispatchTest: public QObject
|
class DispatchTest: public QObject // clazy:exclude=ctor-missing-parent-argument
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* SPDX-FileCopyrightText: 2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
* SPDX-FileCopyrightText: 2020-2021 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
||||||
*/
|
*/
|
||||||
#include "account.h"
|
#include "account.h"
|
||||||
#include "account_p.h"
|
#include "account_p.h"
|
||||||
|
@ -198,7 +198,7 @@ namespace accounts
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountStorage::addHotp(const QString &name, const QString &issuer, const QString &secret, uint tokenLength,
|
void AccountStorage::addHotp(const QString &name, const QString &issuer, const QString &secret, uint tokenLength,
|
||||||
quint64 counter, const std::optional<uint> &offset, bool addChecksum)
|
quint64 counter, const std::optional<uint> offset, bool addChecksum)
|
||||||
{
|
{
|
||||||
Q_D(AccountStorage);
|
Q_D(AccountStorage);
|
||||||
const std::function<void(SaveHotp*)> handler([this](SaveHotp *job) -> void
|
const std::function<void(SaveHotp*)> handler([this](SaveHotp *job) -> void
|
||||||
|
@ -244,8 +244,8 @@ namespace accounts
|
||||||
return d->activeAccounts();
|
return d->activeAccounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountStorage::handleHotp(const QUuid id, const QString name, const QString issuer,
|
void AccountStorage::handleHotp(const QUuid id, const QString &name, const QString &issuer,
|
||||||
const QByteArray secret, const QByteArray nonce, uint tokenLength,
|
const QByteArray &secret, const QByteArray &nonce, uint tokenLength,
|
||||||
quint64 counter, bool fixedTruncation, uint offset, bool checksum)
|
quint64 counter, bool fixedTruncation, uint offset, bool checksum)
|
||||||
{
|
{
|
||||||
Q_D(AccountStorage);
|
Q_D(AccountStorage);
|
||||||
|
@ -279,9 +279,9 @@ namespace accounts
|
||||||
Q_EMIT added(AccountPrivate::toFullName(name, issuer));
|
Q_EMIT added(AccountPrivate::toFullName(name, issuer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountStorage::handleTotp(const QUuid id, const QString name, const QString issuer,
|
void AccountStorage::handleTotp(const QUuid id, const QString &name, const QString &issuer,
|
||||||
const QByteArray secret, const QByteArray nonce, uint tokenLength,
|
const QByteArray &secret, const QByteArray &nonce, uint tokenLength,
|
||||||
uint timeStep, const QDateTime epoch, Account::Hash hash)
|
uint timeStep, const QDateTime &epoch, Account::Hash hash)
|
||||||
{
|
{
|
||||||
Q_D(AccountStorage);
|
Q_D(AccountStorage);
|
||||||
if (!d->isStillOpen()) {
|
if (!d->isStillOpen()) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* SPDX-FileCopyrightText: 2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
* SPDX-FileCopyrightText: 2020-2021 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
||||||
*/
|
*/
|
||||||
#ifndef ACCOUNTS_ACCOUNT_H
|
#ifndef ACCOUNTS_ACCOUNT_H
|
||||||
#define ACCOUNTS_ACCOUNT_H
|
#define ACCOUNTS_ACCOUNT_H
|
||||||
|
@ -56,7 +56,7 @@ namespace accounts
|
||||||
void setCounter(quint64 counter);
|
void setCounter(quint64 counter);
|
||||||
void advanceCounter(quint64 by = 1ULL);
|
void advanceCounter(quint64 by = 1ULL);
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void tokenChanged(const QString otp);
|
void tokenChanged(const QString &otp);
|
||||||
void removed(void);
|
void removed(void);
|
||||||
void updated(void);
|
void updated(void);
|
||||||
private:
|
private:
|
||||||
|
@ -88,7 +88,7 @@ namespace accounts
|
||||||
const QString &secret,
|
const QString &secret,
|
||||||
uint tokenLength = 6U,
|
uint tokenLength = 6U,
|
||||||
quint64 counter = 0ULL,
|
quint64 counter = 0ULL,
|
||||||
const std::optional<uint> &offset = std::nullopt,
|
const std::optional<uint> offset = std::nullopt,
|
||||||
bool addChecksum = false);
|
bool addChecksum = false);
|
||||||
void addTotp(const QString &name,
|
void addTotp(const QString &name,
|
||||||
const QString &issuer,
|
const QString &issuer,
|
||||||
|
@ -101,8 +101,8 @@ namespace accounts
|
||||||
bool hasError(void) const;
|
bool hasError(void) const;
|
||||||
bool isLoaded(void) const;
|
bool isLoaded(void) const;
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void added(const QString fullName);
|
void added(const QString &fullName);
|
||||||
void removed(const QString fullName);
|
void removed(const QString &fullName);
|
||||||
void error(void);
|
void error(void);
|
||||||
void loaded(void);
|
void loaded(void);
|
||||||
void disposed(void);
|
void disposed(void);
|
||||||
|
@ -113,12 +113,12 @@ namespace accounts
|
||||||
void handleDisposal(void);
|
void handleDisposal(void);
|
||||||
void handleError(void);
|
void handleError(void);
|
||||||
void handleLoaded(void);
|
void handleLoaded(void);
|
||||||
void handleHotp(const QUuid id, const QString name, const QString issuer,
|
void handleHotp(const QUuid id, const QString &name, const QString &issuer,
|
||||||
const QByteArray secret, const QByteArray nonce, uint tokenLength,
|
const QByteArray &secret, const QByteArray &nonce, uint tokenLength,
|
||||||
quint64 counter, bool fixedTruncation, uint offset, bool checksum);
|
quint64 counter, bool fixedTruncation, uint offset, bool checksum);
|
||||||
void handleTotp(const QUuid id, const QString name, const QString issuer,
|
void handleTotp(const QUuid id, const QString &name, const QString &issuer,
|
||||||
const QByteArray secret, const QByteArray nonce, uint tokenLength,
|
const QByteArray &secret, const QByteArray &nonce, uint tokenLength,
|
||||||
uint timeStep, const QDateTime epoch, Account::Hash hash);
|
uint timeStep, const QDateTime &epoch, Account::Hash hash);
|
||||||
private:
|
private:
|
||||||
QScopedPointer<AccountStoragePrivate> m_dptr;
|
QScopedPointer<AccountStoragePrivate> m_dptr;
|
||||||
Q_DECLARE_PRIVATE_D(m_dptr, AccountStorage)
|
Q_DECLARE_PRIVATE_D(m_dptr, AccountStorage)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* SPDX-FileCopyrightText: 2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
* SPDX-FileCopyrightText: 2020-2021 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
||||||
*/
|
*/
|
||||||
#include "account_p.h"
|
#include "account_p.h"
|
||||||
#include "validation.h"
|
#include "validation.h"
|
||||||
|
@ -140,7 +140,8 @@ namespace accounts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountPrivate::acceptTotpTokens(QString token, QString nextToken, QDateTime validFrom, QDateTime validUntil)
|
void AccountPrivate::acceptTotpTokens(const QString &token, const QString &nextToken,
|
||||||
|
const QDateTime &validFrom, const QDateTime &validUntil)
|
||||||
{
|
{
|
||||||
if (!m_is_still_alive) {
|
if (!m_is_still_alive) {
|
||||||
qCDebug(logger)
|
qCDebug(logger)
|
||||||
|
@ -162,7 +163,7 @@ namespace accounts
|
||||||
setToken(token);
|
setToken(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountPrivate::acceptHotpTokens(QString token, QString nextToken, quint64 nextCounter)
|
void AccountPrivate::acceptHotpTokens(const QString &token, const QString &nextToken, quint64 nextCounter)
|
||||||
{
|
{
|
||||||
if (!m_is_still_alive) {
|
if (!m_is_still_alive) {
|
||||||
qCDebug(logger)
|
qCDebug(logger)
|
||||||
|
@ -183,7 +184,7 @@ namespace accounts
|
||||||
setToken(token);
|
setToken(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountPrivate::setToken(QString token)
|
void AccountPrivate::setToken(const QString &token)
|
||||||
{
|
{
|
||||||
Q_Q(Account);
|
Q_Q(Account);
|
||||||
if (m_token != token) {
|
if (m_token != token) {
|
||||||
|
@ -304,9 +305,9 @@ namespace accounts
|
||||||
|
|
||||||
AccountPrivate::AccountPrivate(const std::function<Account*(AccountPrivate*)> &account,
|
AccountPrivate::AccountPrivate(const std::function<Account*(AccountPrivate*)> &account,
|
||||||
AccountStoragePrivate *storage, Dispatcher *dispatcher,
|
AccountStoragePrivate *storage, Dispatcher *dispatcher,
|
||||||
const QUuid &id, const QString &name, const QString &issuer,
|
const QUuid id, const QString &name, const QString &issuer,
|
||||||
const secrets::EncryptedSecret &secret, uint tokenLength,
|
const secrets::EncryptedSecret &secret, uint tokenLength,
|
||||||
quint64 counter, const std::optional<uint> &offset, bool addChecksum) :
|
quint64 counter, const std::optional<uint> offset, bool addChecksum) :
|
||||||
q_ptr(account(this)), m_storage(storage), m_actions(dispatcher), m_is_still_alive(true),
|
q_ptr(account(this)), m_storage(storage), m_actions(dispatcher), m_is_still_alive(true),
|
||||||
m_algorithm(Account::Algorithm::Hotp), m_id(id), m_token(QString()), m_nextToken(QString()),
|
m_algorithm(Account::Algorithm::Hotp), m_id(id), m_token(QString()), m_nextToken(QString()),
|
||||||
m_nextTotpValidFrom(QDateTime::fromMSecsSinceEpoch(0)), // not a totp token so does not really matter
|
m_nextTotpValidFrom(QDateTime::fromMSecsSinceEpoch(0)), // not a totp token so does not really matter
|
||||||
|
@ -321,7 +322,7 @@ namespace accounts
|
||||||
|
|
||||||
AccountPrivate::AccountPrivate(const std::function<Account*(AccountPrivate*)> &account,
|
AccountPrivate::AccountPrivate(const std::function<Account*(AccountPrivate*)> &account,
|
||||||
AccountStoragePrivate *storage, Dispatcher *dispatcher,
|
AccountStoragePrivate *storage, Dispatcher *dispatcher,
|
||||||
const QUuid &id, const QString &name, const QString &issuer,
|
const QUuid id, const QString &name, const QString &issuer,
|
||||||
const secrets::EncryptedSecret &secret, uint tokenLength,
|
const secrets::EncryptedSecret &secret, uint tokenLength,
|
||||||
const QDateTime &epoch, uint timeStep, Account::Hash hash) :
|
const QDateTime &epoch, uint timeStep, Account::Hash hash) :
|
||||||
q_ptr(account(this)), m_storage(storage), m_actions(dispatcher), m_is_still_alive(true),
|
q_ptr(account(this)), m_storage(storage), m_actions(dispatcher), m_is_still_alive(true),
|
||||||
|
@ -449,7 +450,7 @@ namespace accounts
|
||||||
DeleteAccounts *job = new DeleteAccounts(m_settings, ids);
|
DeleteAccounts *job = new DeleteAccounts(m_settings, ids);
|
||||||
m_actions->queueAndProceed(job, [&ids, job, this](void) -> void
|
m_actions->queueAndProceed(job, [&ids, job, this](void) -> void
|
||||||
{
|
{
|
||||||
for (const QUuid &id : ids) {
|
for (const QUuid &id : qAsConst(ids)) {
|
||||||
Account *account = m_accounts[id];
|
Account *account = m_accounts[id];
|
||||||
QObject::connect(job, &DeleteAccounts::finished, account, &Account::removed);
|
QObject::connect(job, &DeleteAccounts::finished, account, &Account::removed);
|
||||||
}
|
}
|
||||||
|
@ -502,7 +503,8 @@ namespace accounts
|
||||||
|
|
||||||
qCDebug(logger) << "Handling storage disposal";
|
qCDebug(logger) << "Handling storage disposal";
|
||||||
|
|
||||||
for (const QString &accountName : m_names.keys()) {
|
const auto &names = m_names.keys();
|
||||||
|
for (const QString &accountName : names) {
|
||||||
const QUuid id = m_names[accountName];
|
const QUuid id = m_names[accountName];
|
||||||
qCDebug(logger) << "Handling account cleanup for account:" << id;
|
qCDebug(logger) << "Handling account cleanup for account:" << id;
|
||||||
|
|
||||||
|
@ -557,7 +559,7 @@ namespace accounts
|
||||||
bool AccountStoragePrivate::addHotp(const std::function<void(SaveHotp*)> &handler,
|
bool AccountStoragePrivate::addHotp(const std::function<void(SaveHotp*)> &handler,
|
||||||
const QString &name, const QString &issuer,
|
const QString &name, const QString &issuer,
|
||||||
const QString &secret, uint tokenLength,
|
const QString &secret, uint tokenLength,
|
||||||
quint64 counter, const std::optional<uint> &offset, bool checksum)
|
quint64 counter, const std::optional<uint> offset, bool checksum)
|
||||||
{
|
{
|
||||||
if (!m_is_still_open) {
|
if (!m_is_still_open) {
|
||||||
qCDebug(logger) << "Will not add new HOTP account: storage no longer open";
|
qCDebug(logger) << "Will not add new HOTP account: storage no longer open";
|
||||||
|
@ -653,9 +655,9 @@ namespace accounts
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Account * AccountStoragePrivate::acceptHotpAccount(const QUuid &id, const QString &name, const QString &issuer,
|
Account * AccountStoragePrivate::acceptHotpAccount(const QUuid id, const QString &name, const QString &issuer,
|
||||||
const secrets::EncryptedSecret &secret, uint tokenLength,
|
const secrets::EncryptedSecret &secret, uint tokenLength,
|
||||||
quint64 counter, const std::optional<uint> &offset, bool checksum)
|
quint64 counter, const std::optional<uint> offset, bool checksum)
|
||||||
{
|
{
|
||||||
Q_Q(AccountStorage);
|
Q_Q(AccountStorage);
|
||||||
qCDebug(logger) << "Registering HOTP account:" << id;
|
qCDebug(logger) << "Registering HOTP account:" << id;
|
||||||
|
@ -675,7 +677,7 @@ namespace accounts
|
||||||
return m_accounts[id];
|
return m_accounts[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
Account * AccountStoragePrivate::acceptTotpAccount(const QUuid &id, const QString &name, const QString &issuer,
|
Account * AccountStoragePrivate::acceptTotpAccount(const QUuid id, const QString &name, const QString &issuer,
|
||||||
const secrets::EncryptedSecret &secret, uint tokenLength,
|
const secrets::EncryptedSecret &secret, uint tokenLength,
|
||||||
uint timeStep, const QDateTime &epoch, Account::Hash hash)
|
uint timeStep, const QDateTime &epoch, Account::Hash hash)
|
||||||
{
|
{
|
||||||
|
@ -773,12 +775,13 @@ namespace accounts
|
||||||
QObject::connect(job, &ComputeTotp::finished, this, &HandleTokenUpdate::deleteLater);
|
QObject::connect(job, &ComputeTotp::finished, this, &HandleTokenUpdate::deleteLater);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleTokenUpdate::totp(QString otp, QString nextOtp, QDateTime validFrom, QDateTime validUntil)
|
void HandleTokenUpdate::totp(const QString &otp, const QString &nextOtp, const QDateTime &validFrom,
|
||||||
|
const QDateTime &validUntil)
|
||||||
{
|
{
|
||||||
m_account->acceptTotpTokens(otp, nextOtp, validFrom, validUntil);
|
m_account->acceptTotpTokens(otp, nextOtp, validFrom, validUntil);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleTokenUpdate::hotp(QString otp, QString nextOtp, quint64 validUntil)
|
void HandleTokenUpdate::hotp(const QString &otp, const QString &nextOtp, quint64 validUntil)
|
||||||
{
|
{
|
||||||
m_account->acceptHotpTokens(otp, nextOtp, validUntil);
|
m_account->acceptHotpTokens(otp, nextOtp, validUntil);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* SPDX-FileCopyrightText: 2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
* SPDX-FileCopyrightText: 2020-2021 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
|
||||||
*/
|
*/
|
||||||
#ifndef ACCOUNTS_ACCOUNT_PRIVATE_H
|
#ifndef ACCOUNTS_ACCOUNT_PRIVATE_H
|
||||||
#define ACCOUNTS_ACCOUNT_PRIVATE_H
|
#define ACCOUNTS_ACCOUNT_PRIVATE_H
|
||||||
|
@ -42,24 +42,25 @@ namespace accounts
|
||||||
static QString toFullName(const QString &name, const QString &issuer);
|
static QString toFullName(const QString &name, const QString &issuer);
|
||||||
explicit AccountPrivate(const std::function<Account*(AccountPrivate*)> &account,
|
explicit AccountPrivate(const std::function<Account*(AccountPrivate*)> &account,
|
||||||
AccountStoragePrivate *storage, Dispatcher *dispatcher,
|
AccountStoragePrivate *storage, Dispatcher *dispatcher,
|
||||||
const QUuid &id, const QString &name, const QString &issuer,
|
const QUuid id, const QString &name, const QString &issuer,
|
||||||
const secrets::EncryptedSecret &secret, uint tokenLength,
|
const secrets::EncryptedSecret &secret, uint tokenLength,
|
||||||
quint64 counter, const std::optional<uint> &offset, bool addChecksum);
|
quint64 counter, const std::optional<uint> offset, bool addChecksum);
|
||||||
explicit AccountPrivate(const std::function<Account*(AccountPrivate*)> &account,
|
explicit AccountPrivate(const std::function<Account*(AccountPrivate*)> &account,
|
||||||
AccountStoragePrivate *storage, Dispatcher *dispatcher,
|
AccountStoragePrivate *storage, Dispatcher *dispatcher,
|
||||||
const QUuid &id, const QString &name, const QString &issuer,
|
const QUuid id, const QString &name, const QString &issuer,
|
||||||
const secrets::EncryptedSecret &secret, uint tokenLength,
|
const secrets::EncryptedSecret &secret, uint tokenLength,
|
||||||
const QDateTime &epoch, uint timeStep, Account::Hash hash);
|
const QDateTime &epoch, uint timeStep, Account::Hash hash);
|
||||||
void recompute(void);
|
void recompute(void);
|
||||||
void setCounter(quint64 counter);
|
void setCounter(quint64 counter);
|
||||||
void remove(void);
|
void remove(void);
|
||||||
void acceptCounter(quint64 counter);
|
void acceptCounter(quint64 counter);
|
||||||
void acceptTotpTokens(QString token, QString nextToken, QDateTime validFrom, QDateTime validUntil);
|
void acceptTotpTokens(const QString &token, const QString &nextToken, const QDateTime &validFrom,
|
||||||
void acceptHotpTokens(QString token, QString nextToken, quint64 validUntil);
|
const QDateTime &validUntil);
|
||||||
|
void acceptHotpTokens(const QString &token, const QString &nextToken, quint64 validUntil);
|
||||||
void markForRemoval(void);
|
void markForRemoval(void);
|
||||||
bool isStillAlive(void) const;
|
bool isStillAlive(void) const;
|
||||||
private:
|
private:
|
||||||
void setToken(QString token);
|
void setToken(const QString &token);
|
||||||
void shiftTokens(void);
|
void shiftTokens(void);
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(AccountPrivate);
|
Q_DISABLE_COPY(AccountPrivate);
|
||||||
|
@ -108,16 +109,16 @@ namespace accounts
|
||||||
AccountSecret *secret(void) const;
|
AccountSecret *secret(void) const;
|
||||||
void removeAccounts(const QSet<QString> &accountNames);
|
void removeAccounts(const QSet<QString> &accountNames);
|
||||||
void acceptAccountRemoval(const QString &accountName);
|
void acceptAccountRemoval(const QString &accountName);
|
||||||
Account * acceptHotpAccount(const QUuid &id, const QString &name, const QString &issuer,
|
Account * acceptHotpAccount(const QUuid id, const QString &name, const QString &issuer,
|
||||||
const secrets::EncryptedSecret &secret, uint tokenLength,
|
const secrets::EncryptedSecret &secret, uint tokenLength,
|
||||||
quint64 counter, const std::optional<uint> &offset, bool checksum);
|
quint64 counter, const std::optional<uint> offset, bool checksum);
|
||||||
Account * acceptTotpAccount(const QUuid &id, const QString &name, const QString &issuer,
|
Account * acceptTotpAccount(const QUuid id, const QString &name, const QString &issuer,
|
||||||
const secrets::EncryptedSecret &secret, uint tokenLength,
|
const secrets::EncryptedSecret &secret, uint tokenLength,
|
||||||
uint timeStep, const QDateTime &epoch, Account::Hash hash);
|
uint timeStep, const QDateTime &epoch, Account::Hash hash);
|
||||||
bool addHotp(const std::function<void(SaveHotp*)> &handler,
|
bool addHotp(const std::function<void(SaveHotp*)> &handler,
|
||||||
const QString &name, const QString &issuer,
|
const QString &name, const QString &issuer,
|
||||||
const QString &secret, uint tokenLength,
|
const QString &secret, uint tokenLength,
|
||||||
quint64 counter, const std::optional<uint> &offset, bool checksum);
|
quint64 counter, const std::optional<uint> offset, bool checksum);
|
||||||
bool addTotp(const std::function<void(SaveTotp*)> &handler,
|
bool addTotp(const std::function<void(SaveTotp*)> &handler,
|
||||||
const QString &name, const QString &issuer,
|
const QString &name, const QString &issuer,
|
||||||
const QString &secret, uint tokenLength,
|
const QString &secret, uint tokenLength,
|
||||||
|
@ -175,8 +176,8 @@ namespace accounts
|
||||||
private:
|
private:
|
||||||
AccountPrivate * const m_account;
|
AccountPrivate * const m_account;
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void totp(QString otp, QString nextOtp, QDateTime validFrom, QDateTime validUntil);
|
void totp(const QString &otp, const QString &nextOtp, const QDateTime &validFrom, const QDateTime &validUntil);
|
||||||
void hotp(QString otp, QString nextOtp, quint64 validUntil);
|
void hotp(const QString &otp, const QString &nextOtp, quint64 validUntil);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue