From db627c417779691d7fe5fa925ea63f53babbae01 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Mon, 19 Nov 2018 23:11:13 +0100 Subject: Apache MINA sshd client: enable support for ed25519 keys Include the net.i2p.crypto.eddsa bundle via a hard dependency. Add tests for dealing with ed25519 host keys and user key files. Manual tests: fetching from git.eclipse.org with an ed25519 user key, and pushing this change itself using the same ed25519 key. Note that sshd 2.0.0 does not yet support encrypted ed25519 private keys. Bug: 541272 Change-Id: I7072f4014d9eca755b4a2412e19c086235e5eae9 Signed-off-by: Thomas Wolf --- .../eclipse/jgit/transport/sshd/ApacheSshTest.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'org.eclipse.jgit.ssh.apache.test/tst') diff --git a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java index 69a9165aa7..ee58083a5a 100644 --- a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java +++ b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java @@ -53,6 +53,7 @@ import org.eclipse.jgit.transport.SshSessionFactory; import org.eclipse.jgit.transport.ssh.SshTestBase; import org.eclipse.jgit.transport.sshd.SshdSessionFactory; import org.eclipse.jgit.util.FS; +import org.junit.Test; import org.junit.experimental.theories.Theories; import org.junit.runner.RunWith; @@ -81,4 +82,24 @@ public class ApacheSshTest extends SshTestBase { } } + // Using an ed25519 (unencrypted) user key is tested in the super class in + // testSshKeys(). sshd 2.0.0 cannot yet read encrypted ed25519 keys. + + @Test + public void testEd25519HostKey() throws Exception { + File newHostKey = new File(getTemporaryDirectory(), "newhostkey"); + copyTestResource("id_ed25519", newHostKey); + server.addHostKey(newHostKey.toPath(), true); + File newHostKeyPub = new File(getTemporaryDirectory(), + "newhostkey.pub"); + copyTestResource("id_ed25519.pub", newHostKeyPub); + createKnownHostsFile(knownHosts, "localhost", testPort, newHostKeyPub); + cloneWith("ssh://git/doesntmatter", defaultCloneDir, null, // + "Host git", // + "HostName localhost", // + "Port " + testPort, // + "User " + TEST_USER, // + "IdentityFile " + privateKey1.getAbsolutePath()); + } + } -- cgit v1.2.3