From 2db39865130f9def362433a64c27a4f9695de908 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sat, 23 Feb 2019 16:39:15 +0100 Subject: [PATCH] Github #28 Check Input for Valid Base32 --- qml/pages/AddOTP.qml | 4 +++- translations/harbour-sailotp-de.ts | 10 +++++----- translations/harbour-sailotp-es.ts | 10 +++++----- translations/harbour-sailotp-fi.ts | 10 +++++----- translations/harbour-sailotp-fr.ts | 10 +++++----- translations/harbour-sailotp-it.ts | 10 +++++----- translations/harbour-sailotp-pt_BR.ts | 10 +++++----- translations/harbour-sailotp-ru.ts | 10 +++++----- translations/harbour-sailotp-sv.ts | 10 +++++----- translations/harbour-sailotp-zh_CN.ts | 10 +++++----- translations/harbour-sailotp.ts | 10 +++++----- 11 files changed, 53 insertions(+), 51 deletions(-) diff --git a/qml/pages/AddOTP.qml b/qml/pages/AddOTP.qml index ac33528..28ce97c 100644 --- a/qml/pages/AddOTP.qml +++ b/qml/pages/AddOTP.qml @@ -115,6 +115,8 @@ Dialog { text: paramKey != "" ? paramKey : "" placeholderText: qsTr("Secret OTP Key") focus: true + validator: RegExpValidator { regExp: /^(?:[A-Za-z2-7]{8})*(?:[A-Za-z2-7]{2}={6}|[A-Za-z2-7]{4}={4}|[A-Za-z2-7]{5}={3}|[A-Za-z2-7]{7}=)?$/ } + inputMethodHints: Qt.ImhNoPredictiveText horizontalAlignment: TextInput.AlignLeft EnterKey.enabled: text.length > 15 @@ -168,7 +170,7 @@ Dialog { } // Check if we can Save - canAccept: otpLabel.text.length > 0 && otpSecret.text.length >= 16 && otpLen.text >= 1 && ((paramType == "TOTP" && otpDiff.text != "") || paramType == "TOTP_STEAM" || otpCounter.text.length > 0) ? true : false + canAccept: otpLabel.text.length > 0 && otpSecret.text.length >= 16 && otpSecret.acceptableInput && otpLen.text >= 1 && ((paramType == "TOTP" && otpDiff.text != "") || paramType == "TOTP_STEAM" || otpCounter.text.length > 0) ? true : false // Save if page is Left with Add onDone: { diff --git a/translations/harbour-sailotp-de.ts b/translations/harbour-sailotp-de.ts index e230827..4e18625 100644 --- a/translations/harbour-sailotp-de.ts +++ b/translations/harbour-sailotp-de.ts @@ -101,28 +101,28 @@ Lizenz: BSD (3-Klausel) Geheimer Schlüssel - + Length Länge - + Length of the Token Länge des Tokens - + Time Derivation (Seconds) Zeitabweichung (Sekunden) - + Next Counter Value Nächster Zählerwert - + Next Value of the Counter Nächster Wert für den Zähler diff --git a/translations/harbour-sailotp-es.ts b/translations/harbour-sailotp-es.ts index 8863118..4693c0b 100644 --- a/translations/harbour-sailotp-es.ts +++ b/translations/harbour-sailotp-es.ts @@ -101,28 +101,28 @@ Licencia: BSD (de 3 cláusulas) Llave secreta OTP - + Length Longitud - + Length of the Token Longitud del token - + Time Derivation (Seconds) Derivación de tiempo (segundos) - + Next Counter Value Siguiente Contador - + Next Value of the Counter Siguiente valor del contador diff --git a/translations/harbour-sailotp-fi.ts b/translations/harbour-sailotp-fi.ts index c0e6fcc..151b61e 100644 --- a/translations/harbour-sailotp-fi.ts +++ b/translations/harbour-sailotp-fi.ts @@ -101,28 +101,28 @@ Lisenssi: BSD (3-clause) Salainen OTP-avain - + Length Pituus - + Length of the Token Tunnuksen pituus - + Time Derivation (Seconds) Aikapoikkeama (sekunneissa) - + Next Counter Value Seuraava laskenta-arvo - + Next Value of the Counter Laskurin seuraava arvo diff --git a/translations/harbour-sailotp-fr.ts b/translations/harbour-sailotp-fr.ts index 201381e..2212fee 100644 --- a/translations/harbour-sailotp-fr.ts +++ b/translations/harbour-sailotp-fr.ts @@ -100,28 +100,28 @@ Licence : BSD (3 clauses) Clé secrète OTP - + Length Longueur - + Length of the Token Longueur du jeton - + Time Derivation (Seconds) Dérivation de temps (secondes) - + Next Counter Value Prochaine valeur du compteur - + Next Value of the Counter Prochaine valeur du compteur diff --git a/translations/harbour-sailotp-it.ts b/translations/harbour-sailotp-it.ts index bc9ef24..07f0973 100644 --- a/translations/harbour-sailotp-it.ts +++ b/translations/harbour-sailotp-it.ts @@ -101,28 +101,28 @@ Licenza: BSD (3-clause) Chiave OTP segreta - + Length Lunghezza - + Length of the Token Lunghezza del Token - + Time Derivation (Seconds) Derivazione Temporale (Secondi) - + Next Counter Value Valore Prossimo Contatore - + Next Value of the Counter Prossimo Valore del Contatore diff --git a/translations/harbour-sailotp-pt_BR.ts b/translations/harbour-sailotp-pt_BR.ts index c441792..b13d1dd 100644 --- a/translations/harbour-sailotp-pt_BR.ts +++ b/translations/harbour-sailotp-pt_BR.ts @@ -100,28 +100,28 @@ Licença: BSD (3-clause) Chave secreta OTP - + Length Tamanho - + Length of the Token Tamanho to Token - + Time Derivation (Seconds) Derivação do tempo (segundos) - + Next Counter Value Próximo valor do contador - + Next Value of the Counter Próximo valor do contador diff --git a/translations/harbour-sailotp-ru.ts b/translations/harbour-sailotp-ru.ts index 163aa1d..53dedbb 100644 --- a/translations/harbour-sailotp-ru.ts +++ b/translations/harbour-sailotp-ru.ts @@ -101,28 +101,28 @@ License: BSD (3-clause) Секретный ключ OTP - + Length Длина - + Length of the Token Длина токена - + Time Derivation (Seconds) Интервал расхождения (секунд) - + Next Counter Value Следующее значение счетчика - + Next Value of the Counter Следующее значение счетчика diff --git a/translations/harbour-sailotp-sv.ts b/translations/harbour-sailotp-sv.ts index 021a4d3..f7a883c 100644 --- a/translations/harbour-sailotp-sv.ts +++ b/translations/harbour-sailotp-sv.ts @@ -101,28 +101,28 @@ Licens: BSD (3-clause) Hemlig OTP-nyckel - + Length längd - + Length of the Token Längden av token - + Time Derivation (Seconds) Tidsavvikelsen (sekunder) - + Next Counter Value Nästa räknarvärde - + Next Value of the Counter Nästa värde på räknaren diff --git a/translations/harbour-sailotp-zh_CN.ts b/translations/harbour-sailotp-zh_CN.ts index f27ead1..1424470 100644 --- a/translations/harbour-sailotp-zh_CN.ts +++ b/translations/harbour-sailotp-zh_CN.ts @@ -100,28 +100,28 @@ License: BSD (3-clause) OTP密钥 - + Length 长度 - + Length of the Token 令牌的长度 - + Time Derivation (Seconds) 时间推导(秒) - + Next Counter Value 下一个计数器的值 - + Next Value of the Counter 下一个计数器的值 diff --git a/translations/harbour-sailotp.ts b/translations/harbour-sailotp.ts index d107c4a..e748339 100644 --- a/translations/harbour-sailotp.ts +++ b/translations/harbour-sailotp.ts @@ -99,28 +99,28 @@ License: BSD (3-clause) - + Length Length - + Length of the Token Length of the Token - + Time Derivation (Seconds) Time Derivation (Seconds) - + Next Counter Value - + Next Value of the Counter