From: Robert Varga Date: Wed, 26 Aug 2020 18:30:07 +0000 (+0200) Subject: Revert "Revert "Upgrade mina-sshd to 2.4.0"" X-Git-Tag: v1.13.0~103 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=6cc04f8a72d33b24d78aeeaa65eb8fae8217c608;p=netconf.git Revert "Revert "Upgrade mina-sshd to 2.4.0"" This reverts commit f25f45ff27c8a7c7df780df609ec33f6662ea61e, re-bumping to 2.5.1. JIRA: NETCONF-716 Change-Id: I520d807c50a8107c0189745cf56e0fbc75871230 Signed-off-by: Robert Varga --- diff --git a/netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java b/netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java index ed557f0b62..d9ef852404 100644 --- a/netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java +++ b/netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java @@ -21,7 +21,6 @@ import java.io.OutputStream; import java.net.InetSocketAddress; import java.net.SocketAddress; import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader; -import org.opendaylight.netconf.shaded.sshd.common.NamedFactory; import org.opendaylight.netconf.shaded.sshd.common.io.IoInputStream; import org.opendaylight.netconf.shaded.sshd.common.io.IoOutputStream; import org.opendaylight.netconf.shaded.sshd.server.Environment; @@ -30,6 +29,7 @@ import org.opendaylight.netconf.shaded.sshd.server.channel.ChannelSession; import org.opendaylight.netconf.shaded.sshd.server.command.AsyncCommand; import org.opendaylight.netconf.shaded.sshd.server.command.Command; import org.opendaylight.netconf.shaded.sshd.server.session.ServerSession; +import org.opendaylight.netconf.shaded.sshd.server.subsystem.SubsystemFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -163,7 +163,7 @@ public class RemoteNetconfCommand implements AsyncCommand { return netconfHelloMessageAdditionalHeader.getAddress(); } - public static class NetconfCommandFactory implements NamedFactory { + public static class NetconfCommandFactory implements SubsystemFactory { public static final String NETCONF = "netconf"; @@ -182,7 +182,7 @@ public class RemoteNetconfCommand implements AsyncCommand { } @Override - public RemoteNetconfCommand create() { + public Command createSubsystem(final ChannelSession channel) { return new RemoteNetconfCommand(clientBootstrap, localAddress); } } diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NetconfSshClient.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NetconfSshClient.java index 7b5308a36f..d5d0d97aa9 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NetconfSshClient.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NetconfSshClient.java @@ -10,8 +10,6 @@ package org.opendaylight.netconf.nettyutil.handler.ssh.client; import com.google.common.annotations.Beta; import org.opendaylight.netconf.shaded.sshd.client.SshClient; import org.opendaylight.netconf.shaded.sshd.common.Factory; -import org.opendaylight.netconf.shaded.sshd.common.forward.PortForwardingEventListener; -import org.opendaylight.netconf.shaded.sshd.common.util.net.SshdSocketAddress; /** * An extension to {@link SshClient} which uses {@link NetconfSessionFactory} to create sessions (leading towards @@ -21,22 +19,6 @@ import org.opendaylight.netconf.shaded.sshd.common.util.net.SshdSocketAddress; public class NetconfSshClient extends SshClient { public static final Factory DEFAULT_NETCONF_SSH_CLIENT_FACTORY = NetconfSshClient::new; - /* - * This is a workaround for sshd-core's instantiation of Proxies. AbstractFactoryManager (which is our superclass) - * is calling Proxy.newProxyInstance() with getClass().getClassLoader(), i.e. our class loader. - * - * Since we are not using PortForwardingEventListener, our classloader does not see it (because we do not import - * that package), which leads to an instantiation failure. - * - * Having these dumb fields alleviates the problem, as it forces the packages to be imported by our bundle. - * - * FIXME: Remove this once we have an SSHD version with https://issues.apache.org/jira/browse/SSHD-975 fixed - */ - static final class Sshd975Workarounds { - static final PortForwardingEventListener PFEL = null; - static final SshdSocketAddress SSA = null; - } - @Override protected NetconfSessionFactory createSessionFactory() { return new NetconfSessionFactory(this); diff --git a/netconf/shaded-sshd-jar/pom.xml b/netconf/shaded-sshd-jar/pom.xml index 6593881495..8f5e116783 100644 --- a/netconf/shaded-sshd-jar/pom.xml +++ b/netconf/shaded-sshd-jar/pom.xml @@ -32,10 +32,12 @@ org.apache.sshd sshd-osgi + 2.5.1 org.apache.sshd sshd-netty + 2.5.1 net.i2p.crypto