Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion share/translations/keepassxc_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10422,6 +10422,10 @@ Example: JBSWY3DPEHPK3PXP</source>
<translation>Sie haben einen ungültigen geheimen Schlüssel angegeben. Der Schlüssel muss im Base32-Format sein.
Beispiel: JBSWY3DPEHPK3PXP</translation>
</message>
<message>
<source>You have entered an invalid TOTP URI. The URI must start with otpauth://totp/</source>
<translation>Sie haben eine ungültige Totp Uri eingegeben. Die Uri muss mit otpauth://totp/ beginnen.</translation>
</message>
<message>
<source>Confirm Remove TOTP Settings</source>
<translation>Löschen der TOTP-Einstellungen bestätigen</translation>
Expand Down Expand Up @@ -10671,4 +10675,4 @@ Beispiel: JBSWY3DPEHPK3PXP</translation>
<translation>Unbekannt</translation>
</message>
</context>
</TS>
</TS>
12 changes: 12 additions & 0 deletions share/translations/keepassxc_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10440,6 +10440,10 @@ This option is deprecated, use --set-key-file instead.</source>
<source>Secret Key:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>URI:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Secret key must be in Base32 format</source>
<translation type="unfinished"></translation>
Expand All @@ -10452,6 +10456,10 @@ This option is deprecated, use --set-key-file instead.</source>
<source>Default settings (RFC 6238)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Totp Uri</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Steam® settings</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -10498,6 +10506,10 @@ This option is deprecated, use --set-key-file instead.</source>
Example: JBSWY3DPEHPK3PXP</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>You have entered an invalid TOTP URI. The URI must start with otpauth://totp/</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Confirm Remove TOTP Settings</source>
<translation type="unfinished"></translation>
Expand Down
14 changes: 13 additions & 1 deletion share/translations/keepassxc_en_GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10363,6 +10363,10 @@ This option is deprecated, use --set-key-file instead.</translation>
<source>Secret Key:</source>
<translation>Secret Key:</translation>
</message>
<message>
<source>URI:</source>
<translation>URI:</translation>
</message>
<message>
<source>Secret key must be in Base32 format</source>
<translation>Secret key must be in Base32 format</translation>
Expand All @@ -10375,6 +10379,10 @@ This option is deprecated, use --set-key-file instead.</translation>
<source>Default settings (RFC 6238)</source>
<translation>Default settings (RFC 6238)</translation>
</message>
<message>
<source>Totp Uri</source>
<translation>Totp Uri</translation>
</message>
<message>
<source>Steam® settings</source>
<translation>Steam® settings</translation>
Expand Down Expand Up @@ -10422,6 +10430,10 @@ Example: JBSWY3DPEHPK3PXP</source>
<translation>You have entered an invalid secret key. The key must be in Base32 format.
Example: JBSWY3DPEHPK3PXP</translation>
</message>
<message>
<source>You have entered an invalid TOTP URI. The URI must start with otpauth://totp/</source>
<translation>You have entered an invalid Totp Uri. The Uri must start with otpauth://totp/</translation>
</message>
<message>
<source>Confirm Remove TOTP Settings</source>
<translation>Confirm Remove TOTP Settings</translation>
Expand Down Expand Up @@ -10671,4 +10683,4 @@ Example: JBSWY3DPEHPK3PXP</translation>
<translation>Unknown</translation>
</message>
</context>
</TS>
</TS>
14 changes: 13 additions & 1 deletion share/translations/keepassxc_en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10363,6 +10363,10 @@ This option is deprecated, use --set-key-file instead.</translation>
<source>Secret Key:</source>
<translation>Secret Key:</translation>
</message>
<message>
<source>URI:</source>
<translation>URI:</translation>
</message>
<message>
<source>Secret key must be in Base32 format</source>
<translation>Secret key must be in Base32 format</translation>
Expand All @@ -10375,6 +10379,10 @@ This option is deprecated, use --set-key-file instead.</translation>
<source>Default settings (RFC 6238)</source>
<translation>Default settings (RFC 6238)</translation>
</message>
<message>
<source>Totp Uri</source>
<translation>Totp Uri</translation>
</message>
<message>
<source>Steam® settings</source>
<translation>Steam® settings</translation>
Expand Down Expand Up @@ -10422,6 +10430,10 @@ Example: JBSWY3DPEHPK3PXP</source>
<translation>You have entered an invalid secret key. The key must be in Base32 format.
Example: JBSWY3DPEHPK3PXP</translation>
</message>
<message>
<source>You have entered an invalid TOTP URI. The URI must start with otpauth://totp/</source>
<translation>You have entered an invalid Totp Uri. The Uri must start with otpauth://totp/</translation>
</message>
<message>
<source>Confirm Remove TOTP Settings</source>
<translation>Confirm Remove TOTP Settings</translation>
Expand Down Expand Up @@ -10671,4 +10683,4 @@ Example: JBSWY3DPEHPK3PXP</translation>
<translation>Unknown</translation>
</message>
</context>
</TS>
</TS>
4 changes: 2 additions & 2 deletions src/core/Totp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static QList<Totp::Encoder> totpEncoders{
{"steam", Totp::STEAM_SHORTNAME, "23456789BCDFGHJKMNPQRTVWXY", Totp::STEAM_DIGITS, Totp::DEFAULT_STEP, true},
};

static Totp::Algorithm getHashTypeByName(const QString& name)
Totp::Algorithm Totp::getHashTypeByName(const QString& name)
{
auto nameUpper = name.toUpper();
if (nameUpper == "SHA512" || nameUpper == "HMAC-SHA-512") {
Expand All @@ -46,7 +46,7 @@ static Totp::Algorithm getHashTypeByName(const QString& name)
return Totp::Algorithm::Sha1;
}

static QString getNameForHashType(const Totp::Algorithm hashType)
QString Totp::getNameForHashType(const Totp::Algorithm hashType)
{
switch (hashType) {
case Totp::Algorithm::Sha512:
Expand Down
3 changes: 3 additions & 0 deletions src/core/Totp.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ namespace Totp

bool hasCustomSettings(const QSharedPointer<Totp::Settings>& settings);

Totp::Algorithm getHashTypeByName(const QString& name);
QString getNameForHashType(const Totp::Algorithm hashType);

QList<QPair<QString, QString>> supportedEncoders();
QList<QPair<QString, Algorithm>> supportedAlgorithms();

Expand Down
Loading