Skip to content

Commit 3b6d3f7

Browse files
authored
feat: enable bouncy castle for sftp (#1227)
1 parent e7c5efa commit 3b6d3f7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/plugins/sftp/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626

2727
<framework src="commons-io:commons-io:2.11.0" />
2828
<framework src="com.sshtools:maverick-synergy-client:3.1.2" />
29+
<framework src="com.sshtools:maverick-bc:3.1.2" />
2930
</plugin>

src/plugins/sftp/src/com/foxdebug/sftp/Sftp.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.sshtools.common.sftp.SftpStatusException;
2020
import com.sshtools.common.ssh.SshException;
2121
import com.sshtools.common.ssh.components.SshKeyPair;
22+
import com.sshtools.common.ssh.components.jce.JCEProvider;
2223
import com.sshtools.common.util.FileUtils;
2324
import java.io.File;
2425
import java.io.IOException;
@@ -94,6 +95,7 @@ public void run() {
9495
int port = args.optInt(1);
9596
String username = args.optString(2);
9697
String password = args.optString(3);
98+
JCEProvider.enableBouncyCastle(true);
9799
Log.d(
98100
TAG,
99101
"Connecting to " + host + ":" + port + " as " + username
@@ -176,6 +178,8 @@ public void run() {
176178
ContentResolver contentResolver = context.getContentResolver();
177179
InputStream in = contentResolver.openInputStream(uri);
178180

181+
JCEProvider.enableBouncyCastle(true);
182+
179183
SshKeyPair keyPair = null;
180184
try {
181185
keyPair = SshKeyUtils.getPrivateKey(in, passphrase);

0 commit comments

Comments
 (0)