]> source.dussan.org Git - gitblit.git/commitdiff
Update SSHD dependency to version 1.2.0.
authorFlorian Zschocke <florian.zschocke@devolo.de>
Fri, 8 Nov 2019 18:19:54 +0000 (19:19 +0100)
committerFlorian Zschocke <florian.zschocke@devolo.de>
Sun, 10 Nov 2019 12:03:20 +0000 (13:03 +0100)
.classpath
build.moxie
gitblit.iml
src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java
src/main/java/com/gitblit/transport/ssh/NonForwardingFilter.java
src/main/java/com/gitblit/transport/ssh/SshDaemonClient.java
src/test/java/com/gitblit/tests/SshUnitTest.java

index de9f91727d8d414db2d75fa63e98225283fa42a1..72a6b6c327e4f20f491c63098f61315a0157b591 100644 (file)
@@ -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" />
index 9deb2fbd1387ec24f6912f06d21bb4fcce6b8c7c..5f5aa63e428305e2c608c3263816c9ec28b3e664 100644 (file)
@@ -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
index 07dc10a94a1ba22a2dd64d37d727ee926cffd6ad..44d79c53f748a738964fbc9940ddf2f213951986 100644 (file)
       </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>
index 45b692db91e180dfd09fa0703e02fdae9ca1cd5c..9b494027c3325fc5ceef05fdc4fa490b224cd561 100644 (file)
@@ -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;
index 29f7750dcfaff75136a708f872f97d423a50ba2c..f2176cb0a24e50b4b0a8126b281d61a74ec1a684 100644 (file)
@@ -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 {
index af25251b5b006706ca477e890b14530f617bae84..7024a9a9935f61138ede61fe5cc82d9a5dd34863 100644 (file)
@@ -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;
 
index dd354d85afe08c19339e9989b80a00749a7c184d..075ab43a2582647477166ba9b0154d464bbb8a70 100644 (file)
@@ -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);