mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix OTP errors
This commit is contained in:
@@ -64,7 +64,7 @@ class SetOTPDialogFragment : DialogFragment() {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
private var mSecretWellFormed = true
|
private var mSecretWellFormed = false
|
||||||
private var mCounterWellFormed = true
|
private var mCounterWellFormed = true
|
||||||
private var mPeriodWellFormed = true
|
private var mPeriodWellFormed = true
|
||||||
private var mDigitsWellFormed = true
|
private var mDigitsWellFormed = true
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ object OtpEntryFields {
|
|||||||
try {
|
try {
|
||||||
otpElement.setBase32Secret(secretParam)
|
otpElement.setBase32Secret(secretParam)
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
otpElement.setBase32Secret("")
|
Log.e(TAG, "Unable to retrieve OTP secret.", exception)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +161,7 @@ object OtpEntryFields {
|
|||||||
otpElement.digits = try {
|
otpElement.digits = try {
|
||||||
digitsParam.toIntOrNull() ?: OTP_DEFAULT_DIGITS
|
digitsParam.toIntOrNull() ?: OTP_DEFAULT_DIGITS
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
|
Log.e(TAG, "Unable to retrieve OTP digits.", exception)
|
||||||
OTP_DEFAULT_DIGITS
|
OTP_DEFAULT_DIGITS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,6 +170,7 @@ object OtpEntryFields {
|
|||||||
otpElement.counter = try {
|
otpElement.counter = try {
|
||||||
counterParam.toLongOrNull() ?: HOTP_INITIAL_COUNTER
|
counterParam.toLongOrNull() ?: HOTP_INITIAL_COUNTER
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
|
Log.e(TAG, "Unable to retrieve HOTP counter.", exception)
|
||||||
HOTP_INITIAL_COUNTER
|
HOTP_INITIAL_COUNTER
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,6 +179,7 @@ object OtpEntryFields {
|
|||||||
otpElement.period = try {
|
otpElement.period = try {
|
||||||
stepParam.toIntOrNull() ?: TOTP_DEFAULT_PERIOD
|
stepParam.toIntOrNull() ?: TOTP_DEFAULT_PERIOD
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
|
Log.e(TAG, "Unable to retrieve TOTP period.", exception)
|
||||||
TOTP_DEFAULT_PERIOD
|
TOTP_DEFAULT_PERIOD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user