1
0
Fork 0
mirror of https://github.com/seiichiro0185/sailotp.git synced 2024-11-21 23:39:41 +00:00

Github #28 Check Input for Valid Base32

This commit is contained in:
seiichiro 2019-02-23 16:39:15 +01:00
parent 714f1f1917
commit 2db3986513
11 changed files with 53 additions and 51 deletions

View file

@ -115,6 +115,8 @@ Dialog {
text: paramKey != "" ? paramKey : "" text: paramKey != "" ? paramKey : ""
placeholderText: qsTr("Secret OTP Key") placeholderText: qsTr("Secret OTP Key")
focus: true 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 horizontalAlignment: TextInput.AlignLeft
EnterKey.enabled: text.length > 15 EnterKey.enabled: text.length > 15
@ -168,7 +170,7 @@ Dialog {
} }
// Check if we can Save // 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 // Save if page is Left with Add
onDone: { onDone: {

View file

@ -101,28 +101,28 @@ Lizenz: BSD (3-Klausel)</translation>
<translation>Geheimer Schlüssel</translation> <translation>Geheimer Schlüssel</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>Länge</translation> <translation>Länge</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Länge des Tokens</translation> <translation>Länge des Tokens</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Zeitabweichung (Sekunden)</translation> <translation>Zeitabweichung (Sekunden)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation>Nächster Zählerwert</translation> <translation>Nächster Zählerwert</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation>Nächster Wert für den Zähler</translation> <translation>Nächster Wert für den Zähler</translation>
</message> </message>

View file

@ -101,28 +101,28 @@ Licencia: BSD (de 3 cláusulas)</translation>
<translation>Llave secreta OTP</translation> <translation>Llave secreta OTP</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>Longitud</translation> <translation>Longitud</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Longitud del token</translation> <translation>Longitud del token</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Derivación de tiempo (segundos)</translation> <translation>Derivación de tiempo (segundos)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation>Siguiente Contador</translation> <translation>Siguiente Contador</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation>Siguiente valor del contador</translation> <translation>Siguiente valor del contador</translation>
</message> </message>

View file

@ -101,28 +101,28 @@ Lisenssi: BSD (3-clause)</translation>
<translation>Salainen OTP-avain</translation> <translation>Salainen OTP-avain</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>Pituus</translation> <translation>Pituus</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Tunnuksen pituus</translation> <translation>Tunnuksen pituus</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Aikapoikkeama (sekunneissa)</translation> <translation>Aikapoikkeama (sekunneissa)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation>Seuraava laskenta-arvo</translation> <translation>Seuraava laskenta-arvo</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation>Laskurin seuraava arvo</translation> <translation>Laskurin seuraava arvo</translation>
</message> </message>

View file

@ -100,28 +100,28 @@ Licence : BSD (3 clauses)</translation>
<translation>Clé secrète OTP</translation> <translation>Clé secrète OTP</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>Longueur</translation> <translation>Longueur</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Longueur du jeton</translation> <translation>Longueur du jeton</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Dérivation de temps (secondes)</translation> <translation>Dérivation de temps (secondes)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation>Prochaine valeur du compteur</translation> <translation>Prochaine valeur du compteur</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation>Prochaine valeur du compteur</translation> <translation>Prochaine valeur du compteur</translation>
</message> </message>

View file

@ -101,28 +101,28 @@ Licenza: BSD (3-clause)</translation>
<translation>Chiave OTP segreta</translation> <translation>Chiave OTP segreta</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>Lunghezza</translation> <translation>Lunghezza</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Lunghezza del Token</translation> <translation>Lunghezza del Token</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Derivazione Temporale (Secondi)</translation> <translation>Derivazione Temporale (Secondi)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation>Valore Prossimo Contatore</translation> <translation>Valore Prossimo Contatore</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation>Prossimo Valore del Contatore</translation> <translation>Prossimo Valore del Contatore</translation>
</message> </message>

View file

@ -100,28 +100,28 @@ Licença: BSD (3-clause)</translation>
<translation>Chave secreta OTP</translation> <translation>Chave secreta OTP</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>Tamanho</translation> <translation>Tamanho</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Tamanho to Token</translation> <translation>Tamanho to Token</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Derivação do tempo (segundos)</translation> <translation>Derivação do tempo (segundos)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation>Próximo valor do contador</translation> <translation>Próximo valor do contador</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation>Próximo valor do contador</translation> <translation>Próximo valor do contador</translation>
</message> </message>

View file

@ -101,28 +101,28 @@ License: BSD (3-clause)</source>
<translation>Секретный ключ OTP</translation> <translation>Секретный ключ OTP</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>Длина</translation> <translation>Длина</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Длина токена</translation> <translation>Длина токена</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Интервал расхождения (секунд)</translation> <translation>Интервал расхождения (секунд)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation>Следующее значение счетчика</translation> <translation>Следующее значение счетчика</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation>Следующее значение счетчика</translation> <translation>Следующее значение счетчика</translation>
</message> </message>

View file

@ -101,28 +101,28 @@ Licens: BSD (3-clause)</translation>
<translation>Hemlig OTP-nyckel</translation> <translation>Hemlig OTP-nyckel</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>längd</translation> <translation>längd</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Längden av token</translation> <translation>Längden av token</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Tidsavvikelsen (sekunder)</translation> <translation>Tidsavvikelsen (sekunder)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation>Nästa räknarvärde</translation> <translation>Nästa räknarvärde</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation>Nästa värde räknaren</translation> <translation>Nästa värde räknaren</translation>
</message> </message>

View file

@ -100,28 +100,28 @@ License: BSD (3-clause)</source>
<translation>OTP密钥</translation> <translation>OTP密钥</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation></translation> <translation></translation>
</message> </message>

View file

@ -99,28 +99,28 @@ License: BSD (3-clause)</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="128"/> <location filename="../qml/pages/AddOTP.qml" line="130"/>
<source>Length</source> <source>Length</source>
<translation>Length</translation> <translation>Length</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="130"/> <location filename="../qml/pages/AddOTP.qml" line="132"/>
<source>Length of the Token</source> <source>Length of the Token</source>
<translation>Length of the Token</translation> <translation>Length of the Token</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="142"/>
<location filename="../qml/pages/AddOTP.qml" line="144"/> <location filename="../qml/pages/AddOTP.qml" line="144"/>
<location filename="../qml/pages/AddOTP.qml" line="146"/>
<source>Time Derivation (Seconds)</source> <source>Time Derivation (Seconds)</source>
<translation>Time Derivation (Seconds)</translation> <translation>Time Derivation (Seconds)</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="156"/> <location filename="../qml/pages/AddOTP.qml" line="158"/>
<source>Next Counter Value</source> <source>Next Counter Value</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/AddOTP.qml" line="158"/> <location filename="../qml/pages/AddOTP.qml" line="160"/>
<source>Next Value of the Counter</source> <source>Next Value of the Counter</source>
<translation></translation> <translation></translation>
</message> </message>