-
-
Notifications
You must be signed in to change notification settings - Fork 270
Let SshKeyGenFragment use the Android Keystore #807
Let SshKeyGenFragment use the Android Keystore #807
Conversation
I should probably that the reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Needs a release notes entry.
94f88ab
to
631318c
Compare
Release builds crash for me with diff --git app/proguard-rules.pro app/proguard-rules.pro
index 474b45d0065d..b6958c965e0f 100644
--- app/proguard-rules.pro
+++ app/proguard-rules.pro
@@ -27,3 +27,4 @@
-keep class org.bouncycastle.jcajce.provider.** { *; }
-keep class org.bouncycastle.jce.provider.** { *; }
-keep class !org.bouncycastle.jce.provider.X509LDAPCertStoreSpi { *; }
+-keep class net.i2p.crypto.eddsa.spec.EdDSANamedCurveTable { *; } |
That seems to be an issue with the filesDir style of dependency declaration. I can only fix that by manually adding the dependencies of SSHJ to our build.gradle. But of course this will not be necessary once 0.30.0 is released. |
Can probably just apply the shadow plugin and build a 'fat JAR' in the mean time. |
I just looked into how we do password authentication via SSH, but am confused: Is this function
SshSessionFactory , but the code that calls it supplies the https_password to it. I don't want to break HTTPS when I switch the backend for SSH password authentication over to SSHJ.
|
It's using an |
9acc7bd
to
f2fa080
Compare
I can't test the ED25519 key I generated on my PC with builds off this branch, what am I missing? The crash is caused by |
I think that is because of the way I build the SSHJ jar. Could you try adding the dependency (https://github.com/hierynomus/sshj/blob/master/build.gradle#L52) manually? |
On it |
Works on release builds with the explicit dependency. |
JitPack doesn't seem to have Java 9 runners which SSHJ mandates now so we can't rely on them to be able to eliminate this JAR either. Gonna have to wait it out for an SSHJ release... |
I'm positive we'll get a new release soon, the current maintainer seems to be quite responsive. |
@FabianHenneke this is gonna need a rebase soon-ish, I wanted to test drive this a bit more to confirm that the opening the biometric dialog is not error-prone. |
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
d9af43a
to
0a623fd
Compare
I rebased and along the way removed some unnecessary |
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
0a623fd
to
11339c8
Compare
* develop: (77 commits) Add debug icon and update color palette (android-password-store#931) Revert "Work around Chrome Autofill issue (android-password-store#921)" (android-password-store#933) github: remove freeDebug variant from pull request matrix (android-password-store#932) Properly guard against invalid renaming (android-password-store#929) Fix navigation bar theming and reformat (android-password-store#930) Exclude third_party scope from reformats (android-password-store#927) Move password export to the IO dispatcher (android-password-store#918) Mention android-password-store#482 being fixed in the changelog (android-password-store#925) global: set an import order rule and reformat with it (android-password-store#924) styles: re-add alertDialogTheme override (android-password-store#923) Work around Chrome Autofill issue (android-password-store#921) Major UI overhaul and the introduction of a new icon (android-password-store#920) Update Public Suffix List data (android-password-store#917) Migrate to ActivityResultContracts (android-password-store#910) release: script improvements (android-password-store#915) Deploy both variants to snapshot directory (android-password-store#914) Fill OTP fields with SMS codes (android-password-store#900) Fix up URIish instances with @ in user name (android-password-store#913) build: upgrade Gradle wrapper (android-password-store#911) Scroll to files and enter folders when created (android-password-store#909) ... Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Not sure how well I did on the blind merge but this should be okay. I'm gonna email Jeroen and see if we can somehow expedite a 0.30.0 release. |
Unfortunately, a release at this point wouldn't help too much: The issues hierynomus/sshj#600 and hierynomus/sshj#608 are still open, only the former has a PR to fix it. These would break the new SHA256 and SHA512 signature types and possibly the EC algorithms for us. |
* develop: Add changelog entry for ed25519 support (android-password-store#943)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
No longer blocked on hierynomus/sshj#608 since we could work around this issue on our side. |
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
I changed the config to be compatible with the concept of key algorithms introduced in SSHJ 0.30.0. |
I will radically simplify the algorithm selection and remove Strongbox support since on second thought I fail to see how it has a strictly positive effect on any reasonable threat model. The new UI will briefly explain pros and cons of the only two choices (RSA 3072 and P-384). |
While working on v2 of this PR, I came up with an idea: We could offer ed25519 by wrapping the secret key with a Keystore-backed |
Seems like a good option, certainly in favor of adding. |
Superseded by #1070. |
📢 Type of change
📜 Description
Note: This is ready for review, but requires a patched SSHJ dependency since version 0.30.0 hasn't been released yet. Once it is and the review is done, I will remove the
.jar
and depend on the Maven repository.Implement an SSH auth method backed by an Android Keystore key and make
SshKeyGenFragment
generate such a key.In detail, this means the following:
BiometricAuthenticator
to fix one of two memory leaks.Note: SSHJ so far doesn't support SHA-256/512 signatures with
ssh-rsa
key types. This will probably be fixed upstream at some point, which is why we allow these signature algorithms to be used with our Keystore keys. Again, in the context of SSH authentication, relying on SHA1 is not a major issue.💡 Motivation and Context
We were not making use of the extensive Android capabilities around cryptography and had to rely on Jsch to generate SSH keys for us.
💚 How did you test it?
I generated and used both RSA and EC keys, please do the same.
📝 Checklist
🔮 Next steps
📸 Screenshots / GIFs
Screenshots