diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2020-12-10 22:47:18 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-10 22:47:18 +0530 |
| commit | ce2e657108187a34416cfbfc0c5d2fc8bb9277f3 (patch) | |
| tree | 850810300c35213d54f8acccb1cbe474002f6829 /app/src/main/java/dev/msfjarvis/aps/ui/git/base | |
| parent | c02ad427be3652298f4a07a5f1a0d68e4ac44c45 (diff) | |
| download | HardenedPass-ce2e657108187a34416cfbfc0c5d2fc8bb9277f3.tar.gz HardenedPass-ce2e657108187a34416cfbfc0c5d2fc8bb9277f3.zip | |
Better guidance for users to deal with host key changes (#1242)
* Provide actionable guidance for host key mismatches
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Update changelog
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Hide host key clear button after use
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/dev/msfjarvis/aps/ui/git/base')
| -rw-r--r-- | app/src/main/java/dev/msfjarvis/aps/ui/git/base/BaseGitActivity.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/git/base/BaseGitActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/git/base/BaseGitActivity.kt index 89455c90..558f60a2 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/git/base/BaseGitActivity.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/git/base/BaseGitActivity.kt @@ -29,6 +29,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import net.schmizz.sshj.common.DisconnectReason import net.schmizz.sshj.common.SSHException +import net.schmizz.sshj.transport.TransportException import net.schmizz.sshj.userauth.UserAuthException /** @@ -76,6 +77,10 @@ abstract class BaseGitActivity : ContinuationContainerActivity() { if (err.message?.contains("cannot open additional channels") == true) { GitSettings.useMultiplexing = false SSHException(DisconnectReason.TOO_MANY_CONNECTIONS, "The server does not support multiple Git operations per SSH session. Please try again, a slower fallback mode will be used.") + } else if (err is TransportException && err.disconnectReason == DisconnectReason.HOST_KEY_NOT_VERIFIABLE) { + SSHException(DisconnectReason.HOST_KEY_NOT_VERIFIABLE, + "WARNING: The remote host key has changed. If this is expected, please go to Git server settings and clear the saved host key." + ) } else { err } |
