Generate SSH key on the device - #962
Closed
amberin wants to merge 9 commits into
Closed
Conversation
N.B. Requires API >= 26. Apache MINA SSHD is now the standard SSH transport library for JGit. It supports more modern key algorithms than Jsch. I have added a notification prompt to the user upon new or unexpected SSH server host key. I have no idea what I'm doing, but it seems to work.
A generated key can optionally be protected by biometric auth or device credential. This makes it harder to steal, but will obviously not play well with auto-sync. The default key type is EDCSA. ED25519 keys are faster, but not supported natively by the Android key store. The methods currently called when unlocking a ED25519 key do not respect the validity duration setting, which means that the key needs to be unlocked before each use. This may be twice during a sync, if we need to both fetch and push. RSA and EDCSA keys respect the validity duration setting, meaning we leave them unlocked for 15 seconds. A way to speed up Git syncing while requiring auth upon each key use would be to use SSH multiplexing and keep the SSH session open until we push (or decide not to push). N.B. Much of this code has been taken and re-worked from https://github.com/android-password-store/Android-Password-Store. That project is also GPL-3.0, but I don't know how to properly attribute those authors in the Orgzly code base.
- Make "git push" run blocking. Mostly to make the "syncing in progress" status information more reliable. - Show more informative snackbar when "git push" goes wrong. The user will now find out if pushing fails because of e.g. missing write permission. - Remove two unused methods and an unused return value. - Tidy up some variables.
The TransportException class path was wrong, so the exception type was not being recognized. Make an attempt to find the cause if JGit throws the generic "remote hung up unexpectedly" exception.
We were always ending up in RepoCloneTask. Separate two different error cases, so that we can actually distinguish between them.
Also, use more specific inputTypes. Also, fix the branch name always showing as the default value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
N. B. This is built on top of #948.
Also contains some general minor polish of the Git-related code.