]> source.dussan.org Git - gitblit.git/commitdiff
upgrade to sshd 1.6.0, add eddsa dependency, upgrade jgit to 4.1.2
authorricardop <ricardo.pardini@me.com.br>
Wed, 3 Jan 2018 15:09:27 +0000 (16:09 +0100)
committerFlorian Zschocke <f.zschocke+git@gmail.com>
Sat, 8 Oct 2022 19:14:19 +0000 (21:14 +0200)
(cherry picked from commit d8fbdda2ab3fa48e92bdf37399d4b75c48409c5c@rpardini:master)

# Conflicts:
# .classpath
# build.moxie
# src/test/java/com/gitblit/tests/SshUnitTest.java

.classpath
build.moxie
gitblit.iml
src/main/java/com/gitblit/transport/ssh/FileKeyPairProvider.java
src/main/java/com/gitblit/transport/ssh/NonForwardingFilter.java
src/main/java/com/gitblit/transport/ssh/SshDaemon.java
src/main/java/com/gitblit/transport/ssh/WelcomeShell.java
src/test/java/com/gitblit/tests/LdapPublicKeyManagerTest.java

index a5da35ab18852823451d7e1a2b4187c258e7e848..e1929122a4fe5f98a88b6d02663be50004a92ce3 100644 (file)
@@ -54,7 +54,8 @@
        <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.2.0.jar" sourcepath="ext/src/sshd-core-1.2.0.jar" />
+       <classpathentry kind="lib" path="ext/eddsa-0.2.0.jar" sourcepath="ext/src/eddsa-0.2.0.jar" />
+       <classpathentry kind="lib" path="ext/sshd-core-1.6.0.jar" sourcepath="ext/src/sshd-core-1.6.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 07926ab549651aebdbb7c5255c606315c739263f..8857dca8fc2e0b0c3d48b81477f36665e30ee507 100644 (file)
@@ -114,7 +114,7 @@ properties: {
   bouncycastle.version : 1.57
   selenium.version : 2.28.0
   wikitext.version : 1.4
-  sshd.version: 1.2.0
+  sshd.version: 1.6.0
   mina.version: 2.0.21
   guice.version : 4.0
   # Gitblit maintains a fork of guice-servlet
@@ -163,6 +163,7 @@ dependencies:
 - compile 'org.bouncycastle:bcprov-jdk15on:${bouncycastle.version}' :war
 - compile 'org.bouncycastle:bcmail-jdk15on:${bouncycastle.version}' :war
 - compile 'org.bouncycastle:bcpkix-jdk15on:${bouncycastle.version}' :war
+- compile 'net.i2p.crypto:eddsa:0.2.0' :war !org.easymock
 - compile 'org.apache.sshd:sshd-core:${sshd.version}' :war !org.easymock
 - compile 'org.apache.mina:mina-core:${mina.version}' :war !org.easymock
 - compile 'rome:rome:0.9' :war :manager :api
index 48f3819b1d73d5f1517a8c134915b6cc7814e7d9..5d54b4317a4514b771a4db006bd97fe70325389a 100644 (file)
       </library>
     </orderEntry>
     <orderEntry type="module-library">
-      <library name="sshd-core-1.2.0.jar">
+      <library name="eddsa-0.2.0.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/ext/sshd-core-1.2.0.jar!/" />
+          <root url="jar://$MODULE_DIR$/ext/eddsa-0.2.0.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES>
-          <root url="jar://$MODULE_DIR$/ext/src/sshd-core-1.2.0.jar!/" />
+          <root url="jar://$MODULE_DIR$/ext/src/eddsa-0.2.0.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="sshd-core-1.6.0.jar">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/ext/sshd-core-1.6.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/ext/src/sshd-core-1.6.0.jar!/" />
         </SOURCES>
       </library>
     </orderEntry>
index db0741e0309f9fd55e6cfc759e748d39e7f5e00d..cc91bb8c1f2902abed607c7dade6b04b0a44c49c 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 
 import org.apache.sshd.common.keyprovider.AbstractKeyPairProvider;
-import org.apache.sshd.common.util.SecurityUtils;
+import org.apache.sshd.common.util.security.SecurityUtils;
 import org.bouncycastle.openssl.PEMDecryptorProvider;
 import org.bouncycastle.openssl.PEMEncryptedKeyPair;
 import org.bouncycastle.openssl.PEMKeyPair;
index f2176cb0a24e50b4b0a8126b281d61a74ec1a684..3164ad7956685bd0e57718fed9fbf809a1ae07af 100644 (file)
@@ -21,23 +21,23 @@ import org.apache.sshd.server.forward.ForwardingFilter;
 
 public class NonForwardingFilter implements ForwardingFilter {
 
-       @Override
-       public boolean canConnect(Type type, SshdSocketAddress address, Session session) {
-               return false;
-       }
+    @Override
+    public boolean canConnect(Type type, SshdSocketAddress address, Session session) {
+        return false;
+    }
 
-       @Override
-       public boolean canForwardAgent(Session session) {
-               return false;
-       }
+    @Override
+    public boolean canForwardAgent(Session session, String requestType) {
+        return false;
+    }
 
-       @Override
-       public boolean canForwardX11(Session session) {
-               return false;
-       }
+    @Override
+    public boolean canForwardX11(Session session, String requestType) {
+        return false;
+    }
 
-       @Override
-       public boolean canListen(SshdSocketAddress address, Session session) {
-               return false;
-       }
+    @Override
+    public boolean canListen(SshdSocketAddress address, Session session) {
+        return false;
+    }
 }
index 63fa51dd04439747c9775e6d4530abfe331477c3..405c794e1acb03c67442a1ef95c70f518a3053ca 100644 (file)
@@ -29,7 +29,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.sshd.common.io.IoServiceFactoryFactory;
 import org.apache.sshd.common.io.mina.MinaServiceFactoryFactory;
 import org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory;
-import org.apache.sshd.common.util.SecurityUtils;
+import org.apache.sshd.common.util.security.SecurityUtils;
+import org.apache.sshd.common.util.security.bouncycastle.BouncyCastleSecurityProviderRegistrar;
+import org.apache.sshd.common.util.security.eddsa.EdDSASecurityProviderRegistrar;
 import org.apache.sshd.server.SshServer;
 import org.apache.sshd.server.auth.pubkey.CachingPublicKeyAuthenticator;
 import org.bouncycastle.openssl.PEMWriter;
@@ -92,9 +94,11 @@ public class SshDaemon {
                IStoredSettings settings = gitblit.getSettings();
 
                // Ensure that Bouncy Castle is our JCE provider
-               SecurityUtils.setRegisterBouncyCastle(true);
+               SecurityUtils.registerSecurityProvider(new BouncyCastleSecurityProviderRegistrar());
+               // Add support for ED25519_SHA512
+               SecurityUtils.registerSecurityProvider(new EdDSASecurityProviderRegistrar());
                if (SecurityUtils.isBouncyCastleRegistered()) {
-                       log.debug("BouncyCastle is registered as a JCE provider");
+                       log.info("BouncyCastle is registered as a JCE provider");
                }
 
                // Generate host RSA and DSA keypairs and create the host keypair provider
index 7c407d3659c0a61dcffbdfcb9b355facbbff564c..7ea0f2480d4eb1491c86312f8fe4a740b81108ac 100644 (file)
@@ -57,6 +57,11 @@ public class WelcomeShell implements Factory<Command> {
                return new SendMessage(gitblit);
        }
 
+       @Override
+       public Command get() {
+               return create();
+       }
+
        private static class SendMessage implements Command, SessionAware {
 
                private final IPublicKeyManager km;
index c426254f11bc70607969023ddaca633df9ac4775..1ec6671ad7eb33947c8d5af7313dadb4edf1d747 100644 (file)
@@ -28,7 +28,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.sshd.common.util.SecurityUtils;
+import org.apache.sshd.common.util.security.SecurityUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;