diff --git a/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt b/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt index 9077be5d..8cfb0780 100644 --- a/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt +++ b/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt @@ -10,10 +10,8 @@ import android.content.Context import android.os.Build import android.util.Log import org.apache.sshd.common.file.nativefs.NativeFileSystemFactory -import org.apache.sshd.common.kex.BuiltinDHFactories import org.apache.sshd.common.keyprovider.AbstractKeyPairProvider import org.apache.sshd.common.session.SessionContext -import org.apache.sshd.common.signature.BuiltinSignatures import org.apache.sshd.common.util.io.PathUtils import org.apache.sshd.common.util.security.SecurityUtils.SECURITY_PROVIDER_REGISTRARS import org.apache.sshd.scp.server.ScpCommandFactory @@ -21,7 +19,6 @@ import org.apache.sshd.server.ServerBuilder import org.apache.sshd.server.SshServer import org.apache.sshd.server.auth.password.PasswordAuthenticator import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator -import org.apache.sshd.server.kex.DHGServer import org.apache.sshd.server.session.ServerSession import org.apache.sshd.server.subsystem.SubsystemFactory import org.apache.sshd.sftp.server.FileHandle @@ -70,26 +67,6 @@ internal class SimpleSftpServer { @Throws(GeneralSecurityException::class) fun initialize(context: Context?, device: Device) { val sshd = ServerBuilder.builder().apply { - signatureFactories( - listOf( - BuiltinSignatures.nistp256, - BuiltinSignatures.nistp384, - BuiltinSignatures.nistp521, - BuiltinSignatures.dsa, - SignatureRSASHA256.Factory, - BuiltinSignatures.rsa // Insecure SHA1, left for backwards compatibility - ) - ) - keyExchangeFactories(listOf( - BuiltinDHFactories.ecdhp256, // ecdh-sha2-nistp256 - BuiltinDHFactories.ecdhp384, // ecdh-sha2-nistp384 - BuiltinDHFactories.ecdhp521, // ecdh-sha2-nistp521 - DHG14_256Factory, // diffie-hellman-group14-sha256 - BuiltinDHFactories.dhg14, // Insecure diffie-hellman-group14-sha1, left for backwards-compatibility. - ).map { - DHGServer.newFactory(it) - }) - fileSystemFactory( if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { NativeFileSystemFactory()