From 14691f23484b2b238302d91de1e91b24f5c90345 Mon Sep 17 00:00:00 2001 From: TranceLove Date: Tue, 18 Aug 2020 23:01:36 +0800 Subject: [PATCH] Lifting tweaks in CustomSshJConfig to enable advanced crypto features Addresses #1961. Previously due to preventing conflict with stock BouncyCastle on Android devices some tweaks were added to CustomSshJConfig. But with full adaptation of BouncyCastle over the stock one it should be safe to remove the tweaks and use stock features as much as possible. Tested on Fairphone 3 running LineageOS 16.0 (9.0), using ED25519 private key to authenticate against OpenSSH server 8.2p1 on Ubuntu 20.04. --- .../filesystem/ssh/CustomSshJConfig.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/app/src/main/java/com/amaze/filemanager/filesystem/ssh/CustomSshJConfig.java b/app/src/main/java/com/amaze/filemanager/filesystem/ssh/CustomSshJConfig.java index 86e95412c6..2b7297bbce 100644 --- a/app/src/main/java/com/amaze/filemanager/filesystem/ssh/CustomSshJConfig.java +++ b/app/src/main/java/com/amaze/filemanager/filesystem/ssh/CustomSshJConfig.java @@ -23,10 +23,6 @@ import java.security.Security; import net.schmizz.sshj.DefaultConfig; -import net.schmizz.sshj.signature.SignatureDSA; -import net.schmizz.sshj.signature.SignatureRSA; -import net.schmizz.sshj.transport.random.JCERandom; -import net.schmizz.sshj.transport.random.SingletonRandomFactory; /** * sshj {@link net.schmizz.sshj.Config} for our own use. @@ -44,14 +40,4 @@ public static void init() { Security.removeProvider("BC"); Security.insertProviderAt(new org.bouncycastle.jce.provider.BouncyCastleProvider(), 0); } - - // don't add ECDSA - protected void initSignatureFactories() { - setSignatureFactories(new SignatureRSA.Factory(), new SignatureDSA.Factory()); - } - - @Override - protected void initRandomFactory(boolean ignored) { - setRandomFactory(new SingletonRandomFactory(new JCERandom.Factory())); - } }