diff options
author | Florian Zschocke <florian.zschocke@devolo.de> | 2019-11-08 17:26:06 +0100 |
---|---|---|
committer | Florian Zschocke <florian.zschocke@devolo.de> | 2019-11-10 13:03:20 +0100 |
commit | abb041d2035e36c23191cf3c71640839e7708f8d (patch) | |
tree | 65eb5b90d79576acdeb320127fed732829a53044 /src/main/java | |
parent | c0e836dc8ec1b47de01ba2ae955715e76a48feaa (diff) | |
download | gitblit-abb041d2035e36c23191cf3c71640839e7708f8d.tar.gz gitblit-abb041d2035e36c23191cf3c71640839e7708f8d.zip |
Update SSHD dependency to version 1.1.0.
Diffstat (limited to 'src/main/java')
3 files changed, 9 insertions, 7 deletions
diff --git a/src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java b/src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java index c62c4dee..45b692db 100644 --- a/src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java +++ b/src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java @@ -212,7 +212,7 @@ public class LdapKeyManager extends IPublicKeyManager { List<SshKey> keyList = new ArrayList<>(authorizedKeys.size()); for (GbAuthorizedKeyEntry keyEntry : authorizedKeys) { try { - SshKey key = new SshKey(keyEntry.resolvePublicKey()); + SshKey key = new SshKey(keyEntry.resolvePublicKey(null)); key.setComment(keyEntry.getComment()); setKeyPermissions(key, keyEntry); keyList.add(key); diff --git a/src/main/java/com/gitblit/transport/ssh/SshDaemon.java b/src/main/java/com/gitblit/transport/ssh/SshDaemon.java index 5a053781..63fa51dd 100644 --- a/src/main/java/com/gitblit/transport/ssh/SshDaemon.java +++ b/src/main/java/com/gitblit/transport/ssh/SshDaemon.java @@ -31,7 +31,7 @@ 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.server.SshServer; -import org.apache.sshd.server.auth.CachingPublicKeyAuthenticator; +import org.apache.sshd.server.auth.pubkey.CachingPublicKeyAuthenticator; import org.bouncycastle.openssl.PEMWriter; import org.eclipse.jgit.internal.JGitText; import org.slf4j.Logger; @@ -158,7 +158,7 @@ public class SshDaemon { log.info("SSH: adding GSSAPI authentication method."); } - sshd.setSessionFactory(new SshServerSessionFactory()); + sshd.setSessionFactory(new SshServerSessionFactory(sshd)); sshd.setFileSystemFactory(new DisabledFilesystemFactory()); sshd.setTcpipForwardingFilter(new NonForwardingFilter()); sshd.setCommandFactory(new SshCommandFactory(gitblit, workQueue)); diff --git a/src/main/java/com/gitblit/transport/ssh/SshServerSessionFactory.java b/src/main/java/com/gitblit/transport/ssh/SshServerSessionFactory.java index bc67cec0..fb85781a 100644 --- a/src/main/java/com/gitblit/transport/ssh/SshServerSessionFactory.java +++ b/src/main/java/com/gitblit/transport/ssh/SshServerSessionFactory.java @@ -22,7 +22,8 @@ import org.apache.sshd.common.future.CloseFuture; import org.apache.sshd.common.future.SshFutureListener; import org.apache.sshd.common.io.IoSession; import org.apache.sshd.common.io.mina.MinaSession; -import org.apache.sshd.common.session.AbstractSession; +import org.apache.sshd.server.ServerFactoryManager; +import org.apache.sshd.server.session.ServerSessionImpl; import org.apache.sshd.server.session.SessionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,11 +37,12 @@ public class SshServerSessionFactory extends SessionFactory { private final Logger log = LoggerFactory.getLogger(getClass()); - public SshServerSessionFactory() { + public SshServerSessionFactory(ServerFactoryManager server) { + super(server); } @Override - protected AbstractSession createSession(final IoSession io) throws Exception { + protected ServerSessionImpl createSession(final IoSession io) throws Exception { log.info("creating ssh session from {}", io.getRemoteAddress()); if (io instanceof MinaSession) { @@ -66,7 +68,7 @@ public class SshServerSessionFactory extends SessionFactory { } @Override - protected AbstractSession doCreateSession(IoSession ioSession) throws Exception { + protected ServerSessionImpl doCreateSession(IoSession ioSession) throws Exception { return new SshServerSession(getServer(), ioSession); } } |