summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.ssh.apache.test
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2022-01-06 14:05:00 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2022-01-06 14:05:00 -0500
commitdf4fa808b3a872fda33418a931dcaf3ab8699f10 (patch)
tree1d37a7628c9e416cf62a8eb64330e021f8e2ac08 /org.eclipse.jgit.ssh.apache.test
parente4f6e0af4ac3f83418e98bbfeccb94493c870b83 (diff)
parent4c555f0742856bb21efcb2df53c7ceac921ffe80 (diff)
downloadjgit-df4fa808b3a872fda33418a931dcaf3ab8699f10.tar.gz
jgit-df4fa808b3a872fda33418a931dcaf3ab8699f10.zip
Merge changes Ia744cd4a,Id95350c7,I746b7fb7
* changes: sshd: backport upstream fix for SSHD-1231 [releng] bump japicmp base version and configure sshd bundles Merge branch 'stable-6.0'
Diffstat (limited to 'org.eclipse.jgit.ssh.apache.test')
-rw-r--r--org.eclipse.jgit.ssh.apache.test/build.properties3
-rw-r--r--org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java26
2 files changed, 27 insertions, 2 deletions
diff --git a/org.eclipse.jgit.ssh.apache.test/build.properties b/org.eclipse.jgit.ssh.apache.test/build.properties
index 406c5a768f..35d7145160 100644
--- a/org.eclipse.jgit.ssh.apache.test/build.properties
+++ b/org.eclipse.jgit.ssh.apache.test/build.properties
@@ -3,5 +3,4 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.properties
-additional.bundles = org.apache.log4j,\
- org.slf4j.binding.log4j12
+additional.bundles = org.slf4j.binding.simple
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 ccaf98ced0..3d7c7651c1 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
@@ -107,6 +107,32 @@ public class ApacheSshTest extends SshTestBase {
"IdentityFile " + privateKey1.getAbsolutePath());
}
+ /**
+ * Test for SSHD-1231. If authentication is attempted first with an RSA key,
+ * which is rejected, and then with some other key type (here ed25519),
+ * authentication fails in bug SSHD-1231.
+ *
+ * @throws Exception
+ * on errors
+ * @see <a href=
+ * "https://issues.apache.org/jira/browse/SSHD-1231">SSHD-1231</a>
+ */
+ @Test
+ public void testWrongKeyFirst() throws Exception {
+ File userKey = new File(getTemporaryDirectory(), "userkey");
+ copyTestResource("id_ed25519", userKey);
+ File publicKey = new File(getTemporaryDirectory(), "userkey.pub");
+ copyTestResource("id_ed25519.pub", publicKey);
+ server.setTestUserPublicKey(publicKey.toPath());
+ cloneWith("ssh://git/doesntmatter", defaultCloneDir, null, //
+ "Host git", //
+ "HostName localhost", //
+ "Port " + testPort, //
+ "User " + TEST_USER, //
+ "IdentityFile " + privateKey1.getAbsolutePath(), // RSA
+ "IdentityFile " + userKey.getAbsolutePath());
+ }
+
@Test
public void testHashedKnownHosts() throws Exception {
assertTrue("Failed to delete known_hosts", knownHosts.delete());