diff options
author | Florian Zschocke <florian.zschocke@devolo.de> | 2019-11-08 19:19:54 +0100 |
---|---|---|
committer | Florian Zschocke <florian.zschocke@devolo.de> | 2019-11-10 13:03:20 +0100 |
commit | 15dda8f5c6238710626e1091d4c98fe457d55d4d (patch) | |
tree | e6846eaa4c91cce53cb06055d4c7424cfa5bc6a0 | |
parent | abb041d2035e36c23191cf3c71640839e7708f8d (diff) | |
download | gitblit-15dda8f5c6238710626e1091d4c98fe457d55d4d.tar.gz gitblit-15dda8f5c6238710626e1091d4c98fe457d55d4d.zip |
Update SSHD dependency to version 1.2.0.
-rw-r--r-- | .classpath | 2 | ||||
-rw-r--r-- | build.moxie | 2 | ||||
-rw-r--r-- | gitblit.iml | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java | 2 | ||||
-rw-r--r-- | src/main/java/com/gitblit/transport/ssh/NonForwardingFilter.java | 2 | ||||
-rw-r--r-- | src/main/java/com/gitblit/transport/ssh/SshDaemonClient.java | 2 | ||||
-rw-r--r-- | src/test/java/com/gitblit/tests/SshUnitTest.java | 16 |
7 files changed, 23 insertions, 9 deletions
@@ -54,7 +54,7 @@ <classpathentry kind="lib" path="ext/bcprov-jdk15on-1.57.jar" sourcepath="ext/src/bcprov-jdk15on-1.57.jar" /> <classpathentry kind="lib" path="ext/bcmail-jdk15on-1.57.jar" sourcepath="ext/src/bcmail-jdk15on-1.57.jar" /> <classpathentry kind="lib" path="ext/bcpkix-jdk15on-1.57.jar" sourcepath="ext/src/bcpkix-jdk15on-1.57.jar" /> - <classpathentry kind="lib" path="ext/sshd-core-1.1.0.jar" sourcepath="ext/src/sshd-core-1.1.0.jar" /> + <classpathentry kind="lib" path="ext/sshd-core-1.2.0.jar" sourcepath="ext/src/sshd-core-1.2.0.jar" /> <classpathentry kind="lib" path="ext/mina-core-2.0.21.jar" sourcepath="ext/src/mina-core-2.0.21.jar" /> <classpathentry kind="lib" path="ext/rome-0.9.jar" sourcepath="ext/src/rome-0.9.jar" /> <classpathentry kind="lib" path="ext/jdom-1.0.jar" sourcepath="ext/src/jdom-1.0.jar" /> diff --git a/build.moxie b/build.moxie index 9deb2fbd..5f5aa63e 100644 --- a/build.moxie +++ b/build.moxie @@ -112,7 +112,7 @@ properties: { bouncycastle.version : 1.57 selenium.version : 2.28.0 wikitext.version : 1.4 - sshd.version: 1.1.0 + sshd.version: 1.2.0 mina.version: 2.0.21 guice.version : 4.0 # Gitblit maintains a fork of guice-servlet diff --git a/gitblit.iml b/gitblit.iml index 07dc10a9..44d79c53 100644 --- a/gitblit.iml +++ b/gitblit.iml @@ -541,13 +541,13 @@ </library> </orderEntry> <orderEntry type="module-library"> - <library name="sshd-core-1.1.0.jar"> + <library name="sshd-core-1.2.0.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/sshd-core-1.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/sshd-core-1.2.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/sshd-core-1.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/sshd-core-1.2.0.jar!/" /> </SOURCES> </library> </orderEntry> diff --git a/src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java b/src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java index 45b692db..9b494027 100644 --- a/src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java +++ b/src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java @@ -26,9 +26,9 @@ import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.apache.sshd.common.config.keys.AuthorizedKeyEntry; import org.apache.sshd.common.config.keys.KeyUtils; import org.apache.sshd.common.util.GenericUtils; -import org.apache.sshd.server.config.keys.AuthorizedKeyEntry; import com.gitblit.IStoredSettings; import com.gitblit.Keys; diff --git a/src/main/java/com/gitblit/transport/ssh/NonForwardingFilter.java b/src/main/java/com/gitblit/transport/ssh/NonForwardingFilter.java index 29f7750d..f2176cb0 100644 --- a/src/main/java/com/gitblit/transport/ssh/NonForwardingFilter.java +++ b/src/main/java/com/gitblit/transport/ssh/NonForwardingFilter.java @@ -15,8 +15,8 @@ */ package com.gitblit.transport.ssh; -import org.apache.sshd.common.SshdSocketAddress; import org.apache.sshd.common.session.Session; +import org.apache.sshd.common.util.net.SshdSocketAddress; import org.apache.sshd.server.forward.ForwardingFilter; public class NonForwardingFilter implements ForwardingFilter { diff --git a/src/main/java/com/gitblit/transport/ssh/SshDaemonClient.java b/src/main/java/com/gitblit/transport/ssh/SshDaemonClient.java index af25251b..7024a9a9 100644 --- a/src/main/java/com/gitblit/transport/ssh/SshDaemonClient.java +++ b/src/main/java/com/gitblit/transport/ssh/SshDaemonClient.java @@ -17,7 +17,7 @@ package com.gitblit.transport.ssh; import java.net.SocketAddress; -import org.apache.sshd.common.session.Session.AttributeKey; +import org.apache.sshd.common.AttributeStore.AttributeKey; import com.gitblit.models.UserModel; diff --git a/src/test/java/com/gitblit/tests/SshUnitTest.java b/src/test/java/com/gitblit/tests/SshUnitTest.java index dd354d85..075ab43a 100644 --- a/src/test/java/com/gitblit/tests/SshUnitTest.java +++ b/src/test/java/com/gitblit/tests/SshUnitTest.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.SocketAddress; +import java.security.GeneralSecurityException; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PublicKey; @@ -29,9 +30,12 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.sshd.client.SshClient; import org.apache.sshd.client.channel.ClientChannel; +import org.apache.sshd.client.channel.ClientChannelEvent; +import org.apache.sshd.client.config.keys.ClientIdentityLoader; import org.apache.sshd.client.future.AuthFuture; import org.apache.sshd.client.keyverifier.ServerKeyVerifier; import org.apache.sshd.client.session.ClientSession; +import org.apache.sshd.common.config.keys.FilePasswordProvider; import org.apache.sshd.common.util.SecurityUtils; import org.junit.After; import org.junit.AfterClass; @@ -98,6 +102,16 @@ public abstract class SshUnitTest extends GitblitUnitTest { protected SshClient getClient() { SshClient client = SshClient.setUpDefaultClient(); + client.setClientIdentityLoader(new ClientIdentityLoader() { // Ignore the files under ~/.ssh + @Override + public boolean isValidLocation(String location) throws IOException { + return true; + } + @Override + public KeyPair loadClientIdentity(String location, FilePasswordProvider provider) throws IOException, GeneralSecurityException { + return null; + } + }); client.setServerKeyVerifier(new ServerKeyVerifier() { @Override public boolean verifyServerKey(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) { @@ -135,7 +149,7 @@ public abstract class SshUnitTest extends GitblitUnitTest { channel.setErr(err); channel.open(); - channel.waitFor(EnumSet.of(ClientChannel.ClientChannelEvent.CLOSED), 0); + channel.waitFor(EnumSet.of(ClientChannelEvent.CLOSED, ClientChannelEvent.EOF), 0); String result = out.toString().trim(); channel.close(false); |