diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-03 18:44:30 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-03 18:44:30 +0100 |
| commit | cc6ca1c969a7e6cb0d849001effe1dd158b0b5b0 (patch) | |
| tree | 77f0dfbaee16d4e7bcdf343c77704d674b366cf1 /app/src | |
| parent | bf58bcfd32160f55b5fb28cde15a93691e624da5 (diff) | |
| download | HardenedPass-cc6ca1c969a7e6cb0d849001effe1dd158b0b5b0.tar.gz HardenedPass-cc6ca1c969a7e6cb0d849001effe1dd158b0b5b0.zip | |
fix(git): stop SSH auth hanging after a closed screen lock prompt
executeAfterAuthentication waited for another result whenever the
prompt reported Failure, on the assumption that Failure meant a failed
attempt with the prompt still open. Failure comes from error callbacks
(lockout, timeout, unable to process), which always close the prompt,
so the operation hung forever. Only Retry keeps the prompt open; every
other result now ends the wait, and Failure and CanceledBySystem fail
the operation with the generic screen lock error, like the other
non-success results.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'app/src')
| -rw-r--r-- | app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt b/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt index 2d8b46ca..25d99d6d 100644 --- a/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt +++ b/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt @@ -12,9 +12,7 @@ import app.passwordstore.data.repo.PasswordRepository import app.passwordstore.ui.main.MainActivity import app.passwordstore.ui.setup.SetupStart import app.passwordstore.util.auth.BiometricAuthenticator -import app.passwordstore.util.auth.BiometricAuthenticator.Result.CanceledBySystem import app.passwordstore.util.auth.BiometricAuthenticator.Result.CanceledByUser -import app.passwordstore.util.auth.BiometricAuthenticator.Result.Failure import app.passwordstore.util.auth.BiometricAuthenticator.Result.Retry import app.passwordstore.util.auth.BiometricAuthenticator.Result.Success import app.passwordstore.util.coroutines.DispatcherProvider @@ -163,7 +161,9 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) { callingActivity, R.string.biometric_prompt_title_ssh_auth, ) { result -> - if (result !is Failure && result !is Retry) cont.resume(result) + // Retry: a failed attempt while the prompt stays open. Every other result + // closes it, so waiting for more would leave the operation hanging. + if (result !is Retry) cont.resume(result) } } } @@ -174,10 +174,6 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) { is CanceledByUser -> { return Err(SSHException(DisconnectReason.AUTH_CANCELLED_BY_USER)) } - is Failure, - is CanceledBySystem -> { - throw IllegalStateException("Biometric authentication failures should be ignored") - } else -> { // There is a chance we succeed if the user recently confirmed // their screen lock. Doing so would have a potential to confuse |
