diff options
author | Udo Walter | 2021-03-16 20:31:23 +0100 |
---|---|---|
committer | Udo Walter | 2021-03-16 20:31:23 +0100 |
commit | 5bb76109326829a821fd99deb8a40c196573a8bb (patch) | |
tree | 62de75b442221c29222fcf2d301952c03c054850 /src/main/java/org/openslx/taskmanager | |
parent | [RemoteExec/RemoteReboot] convert ssh key to a format supported by JSch (diff) | |
download | tmlite-bwlp-5bb76109326829a821fd99deb8a40c196573a8bb.tar.gz tmlite-bwlp-5bb76109326829a821fd99deb8a40c196573a8bb.tar.xz tmlite-bwlp-5bb76109326829a821fd99deb8a40c196573a8bb.zip |
[RemoteExec/RemoteReboot] switch to fork of JSch to support more key formats
Diffstat (limited to 'src/main/java/org/openslx/taskmanager')
-rw-r--r-- | src/main/java/org/openslx/taskmanager/tasks/RemoteExec.java | 13 | ||||
-rw-r--r-- | src/main/java/org/openslx/taskmanager/tasks/RemoteReboot.java | 15 |
2 files changed, 0 insertions, 28 deletions
diff --git a/src/main/java/org/openslx/taskmanager/tasks/RemoteExec.java b/src/main/java/org/openslx/taskmanager/tasks/RemoteExec.java index 8e88599..3bd0954 100644 --- a/src/main/java/org/openslx/taskmanager/tasks/RemoteExec.java +++ b/src/main/java/org/openslx/taskmanager/tasks/RemoteExec.java @@ -9,10 +9,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import com.sshtools.common.publickey.InvalidPassphraseException; -import com.sshtools.common.publickey.SshKeyUtils; -import com.sshtools.common.publickey.bc.OpenSSHPrivateKeyFileBC; -import com.sshtools.common.ssh.components.SshKeyPair; import org.openslx.satserver.util.Util; import org.openslx.taskmanager.api.AbstractTask; @@ -81,15 +77,6 @@ public class RemoteExec extends AbstractTask if ( status.error != null ) return false; - // Convert ssh key to old rsa format supported by JSch - try { - SshKeyPair key = SshKeyUtils.getPrivateKey(sshkey, ""); - sshkey = new String(new OpenSSHPrivateKeyFileBC(key, "").getFormattedKey(), - StandardCharsets.UTF_8); - } catch (IOException | InvalidPassphraseException e) { - e.printStackTrace(); - } - JSch.setConfig( "StrictHostKeyChecking", "no" ); sshClient = new JSch(); try { diff --git a/src/main/java/org/openslx/taskmanager/tasks/RemoteReboot.java b/src/main/java/org/openslx/taskmanager/tasks/RemoteReboot.java index 1913891..2776732 100644 --- a/src/main/java/org/openslx/taskmanager/tasks/RemoteReboot.java +++ b/src/main/java/org/openslx/taskmanager/tasks/RemoteReboot.java @@ -1,9 +1,7 @@ package org.openslx.taskmanager.tasks; -import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; -import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -15,10 +13,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import com.sshtools.common.publickey.InvalidPassphraseException; -import com.sshtools.common.publickey.SshKeyUtils; -import com.sshtools.common.publickey.bc.OpenSSHPrivateKeyFileBC; -import com.sshtools.common.ssh.components.SshKeyPair; import org.openslx.taskmanager.api.AbstractTask; import com.google.gson.annotations.Expose; @@ -87,15 +81,6 @@ public class RemoteReboot extends AbstractTask if ( status.error != null ) return false; - // Convert ssh key to old rsa format supported by JSch - try { - SshKeyPair key = SshKeyUtils.getPrivateKey(sshkey, ""); - sshkey = new String(new OpenSSHPrivateKeyFileBC(key, "").getFormattedKey(), - StandardCharsets.UTF_8); - } catch (IOException | InvalidPassphraseException e) { - e.printStackTrace(); - } - Date shutdownTime = new Date( System.currentTimeMillis() + minutes * 60 * 1000 ); SimpleDateFormat sdf = new SimpleDateFormat( "HH:mm" ); status.time = sdf.format( shutdownTime ); |