Shade mina-sshd 25/89825/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Apr 2020 12:25:30 +0000 (14:25 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 15 May 2020 09:23:31 +0000 (11:23 +0200)
Karaf is using a down-reved version of sshd, which unfortunately
has interplay with us providing a newer version. Shade apache-sshd
so that we can ship whatever version we want without worries about
overlap.

JIRA: NETCONF-677
Change-Id: I0b509b6482f2af207bc07328a9cdb720ebbf506f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c1999af65772cfa7d9a6789926c496c31637772f)

45 files changed:
artifacts/pom.xml
features/netconf/odl-netconf-netty-util/pom.xml
features/netconf/odl-netconf-netty-util/src/main/feature/feature.xml [deleted file]
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/AuthorizedKeysDecoder.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/CallHomeAuthorization.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/CallHomeSessionContext.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannel.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServerBuilder.java
netconf/callhome-protocol/src/test/java/org/opendaylight/netconf/callhome/protocol/CallHomeAuthorizationTest.java
netconf/callhome-protocol/src/test/java/org/opendaylight/netconf/callhome/protocol/CallHomeSessionContextTest.java
netconf/callhome-protocol/src/test/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannelTest.java
netconf/callhome-protocol/src/test/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServerTest.java
netconf/mdsal-netconf-ssh/pom.xml
netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfNorthboundSshServer.java
netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java
netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java
netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyServer.java
netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyServerConfiguration.java
netconf/mdsal-netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyServerConfigurationBuilder.java
netconf/mdsal-netconf-ssh/src/test/java/org/opendaylight/netconf/netty/SSHTest.java
netconf/mdsal-netconf-ssh/src/test/java/org/opendaylight/netconf/ssh/authentication/SSHServerTest.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientDispatcherImpl.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SshClientChannelInitializer.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/NetconfServerSessionNegotiatorTest.java
netconf/netconf-netty-util/pom.xml
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/authentication/AuthenticationHandler.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/authentication/LoginPasswordHandler.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/authentication/PublicKeyAuth.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerReader.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AuthenticationFailedException.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/ssh/authentication/LoginPasswordHandlerTest.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java
netconf/pom.xml
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/auth/DatastoreBackedPublicKeyAuth.java
netconf/shaded-sshd-jar/pom.xml [new file with mode: 0644]
netconf/shaded-sshd/pom.xml [new file with mode: 0644]
netconf/tools/netconf-testtool/pom.xml
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/NetconfDeviceSimulator.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/VirtualKeyPairProvider.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/ConfigurableClientDispatcher.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/config/Configuration.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/config/ConfigurationBuilder.java

index 9efcff855605c979722101a8d749c251a1f9048a..b6ee64f578ebbda754d9554949ddf67803b57b81 100644 (file)
                 <artifactId>shaded-exificient</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>shaded-sshd</artifactId>
+                <version>${project.version}</version>
+            </dependency>
 
             <!-- netconf features -->
             <dependency>
index 2c4bfdbac9791a0230d6ad122ac57de99375cec2..983e8f90beadc2542bc2e9b66da924fde57ead30 100644 (file)
             <type>xml</type>
             <scope>runtime</scope>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>odl-apache-sshd</artifactId>
-            <type>xml</type>
-            <classifier>features</classifier>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
             <artifactId>odl-netty-4</artifactId>
diff --git a/features/netconf/odl-netconf-netty-util/src/main/feature/feature.xml b/features/netconf/odl-netconf-netty-util/src/main/feature/feature.xml
deleted file mode 100644 (file)
index 2262605..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright (c) 2017 Cisco Systems, Inc. and others.  All rights reserved.
-  ~
-  ~ This program and the accompanying materials are made available under the
-  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
-  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
-  -->
-<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-netconf-${project.version}">
-    <feature name="odl-netconf-netty-util" version="${project.version}">
-        <feature version="[6,7)">odl-apache-sshd</feature>
-    </feature>
-</features>
index 7e07568a632e39042c3983686cf48d08ee59defb..bd3253e9d9e3a18f1d323b60b4817a5cbf377711 100644 (file)
@@ -26,12 +26,12 @@ import java.util.Arrays;
 import java.util.Base64;
 import java.util.HashMap;
 import java.util.Map;
-import org.apache.sshd.common.util.security.SecurityUtils;
 import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey;
 import org.bouncycastle.jce.ECNamedCurveTable;
 import org.bouncycastle.jce.ECPointUtil;
 import org.bouncycastle.jce.spec.ECNamedCurveParameterSpec;
 import org.bouncycastle.jce.spec.ECNamedCurveSpec;
+import org.opendaylight.netconf.shaded.sshd.common.util.security.SecurityUtils;
 
 /**
  * FIXME: This should be probably located at AAA library.
index 6bcabfe9179a6c4e79e1cbb62debabdba208600b..51f02601bec136c0ae240311d6873afa7f93cecd 100644 (file)
@@ -14,7 +14,7 @@ import java.security.KeyPair;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
-import org.apache.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
 
 /**
  * Authorization context for incoming call home sessions.
index 047342a6ab94e57cdfe814adb553e625c826271f..429386a15ecc2dc798c037398a05b10ce6bd3958 100644 (file)
@@ -19,16 +19,16 @@ import java.net.SocketAddress;
 import java.security.PublicKey;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import org.apache.sshd.client.channel.ClientChannel;
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.future.OpenFuture;
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.common.future.SshFutureListener;
-import org.apache.sshd.common.session.Session;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.netconf.client.NetconfClientSession;
 import org.opendaylight.netconf.client.NetconfClientSessionListener;
 import org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ClientChannel;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.future.OpenFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.common.future.SshFutureListener;
+import org.opendaylight.netconf.shaded.sshd.common.session.Session;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 72ba8b1698600374b19cd5574b5c2c8202c8c421..a01d6a732d80bfb5d6bc8a046ad76430ae3e8cc9 100644 (file)
@@ -20,11 +20,11 @@ import io.netty.channel.ChannelPromise;
 import io.netty.channel.DefaultChannelConfig;
 import io.netty.channel.EventLoop;
 import java.net.SocketAddress;
-import org.apache.sshd.client.channel.ClientChannel;
-import org.apache.sshd.client.session.ClientSession;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandlerReader;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandlerReader.ReadMsgHandler;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandlerWriter;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ClientChannel;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -66,7 +66,7 @@ class MinaSshNettyChannel extends AbstractServerChannel {
         return config;
     }
 
-    private static boolean notClosing(final org.apache.sshd.common.Closeable sshCloseable) {
+    private static boolean notClosing(final org.opendaylight.netconf.shaded.sshd.common.Closeable sshCloseable) {
         return !sshCloseable.isClosing() && !sshCloseable.isClosed();
     }
 
index 75b390f3beaf434e35e14e7b3c65863aece1e508..008d8f7c566b5637c002c18d3ade0859342a564c 100644 (file)
@@ -15,18 +15,18 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
 import java.security.PublicKey;
-import org.apache.sshd.client.SshClient;
-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.client.session.SessionFactory;
-import org.apache.sshd.common.future.SshFutureListener;
-import org.apache.sshd.common.io.IoAcceptor;
-import org.apache.sshd.common.io.IoServiceFactory;
-import org.apache.sshd.common.session.Session;
-import org.apache.sshd.common.session.SessionListener;
-import org.apache.sshd.netty.NettyIoServiceFactory;
 import org.opendaylight.netconf.callhome.protocol.CallHomeSessionContext.Factory;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.keyverifier.ServerKeyVerifier;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.client.session.SessionFactory;
+import org.opendaylight.netconf.shaded.sshd.common.future.SshFutureListener;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoAcceptor;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoServiceFactory;
+import org.opendaylight.netconf.shaded.sshd.common.session.Session;
+import org.opendaylight.netconf.shaded.sshd.common.session.SessionListener;
+import org.opendaylight.netconf.shaded.sshd.netty.NettyIoServiceFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index c915ade8a33a44ab5334ef9502690c634a9b6366..0b102ab1f5e2dc4e2be5f83f2f873980d70a2013 100644 (file)
@@ -13,9 +13,9 @@ import io.netty.util.HashedWheelTimer;
 import java.net.InetSocketAddress;
 import java.util.Optional;
 import java.util.concurrent.TimeUnit;
-import org.apache.sshd.client.SshClient;
 import org.opendaylight.netconf.callhome.protocol.CallHomeSessionContext.Factory;
 import org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
 import org.opendaylight.yangtools.concepts.Builder;
 
 public class NetconfCallHomeServerBuilder implements Builder<NetconfCallHomeServer> {
index fbf580edc73daa150ffe3bfda604d9e13e7b2193..c354140544b97be45d7172029e64f2eb37248fb7 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.callhome.protocol;
 
 import static org.junit.Assert.assertFalse;
@@ -20,9 +19,9 @@ import static org.mockito.Mockito.verify;
 import java.security.KeyPair;
 import java.security.PrivateKey;
 import java.security.PublicKey;
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.session.ClientSessionImpl;
 import org.junit.Test;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSessionImpl;
 
 public class CallHomeAuthorizationTest {
     @Test
index 5dc9bdeb0698d019cee44fec8d16560d2ac4ffc6..469d7d4d4c67f33109c1ed341d1641d474d2a81f 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.callhome.protocol;
 
 import static org.mockito.ArgumentMatchers.any;
@@ -24,26 +23,26 @@ import io.netty.channel.EventLoopGroup;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.security.PublicKey;
-import org.apache.sshd.client.channel.ChannelSubsystem;
-import org.apache.sshd.client.channel.ClientChannel;
-import org.apache.sshd.client.channel.ClientChannel.Streaming;
-import org.apache.sshd.client.future.OpenFuture;
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.session.ClientSessionImpl;
-import org.apache.sshd.common.AttributeRepository.AttributeKey;
-import org.apache.sshd.common.future.SshFutureListener;
-import org.apache.sshd.common.io.IoInputStream;
-import org.apache.sshd.common.io.IoOutputStream;
-import org.apache.sshd.common.io.IoReadFuture;
-import org.apache.sshd.common.io.IoSession;
-import org.apache.sshd.common.kex.KeyExchange;
-import org.apache.sshd.common.util.buffer.Buffer;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.netconf.client.NetconfClientSessionListener;
 import org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ChannelSubsystem;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ClientChannel;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ClientChannel.Streaming;
+import org.opendaylight.netconf.shaded.sshd.client.future.OpenFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSessionImpl;
+import org.opendaylight.netconf.shaded.sshd.common.AttributeRepository.AttributeKey;
+import org.opendaylight.netconf.shaded.sshd.common.future.SshFutureListener;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoInputStream;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoOutputStream;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoReadFuture;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoSession;
+import org.opendaylight.netconf.shaded.sshd.common.kex.KeyExchange;
+import org.opendaylight.netconf.shaded.sshd.common.util.buffer.Buffer;
 
 public class CallHomeSessionContextTest {
     private ClientSessionImpl mockSession;
index 805b921921cc963021bbcb9033c3ba807eee2c89..6eceed7c4ede6f6d88bc5b55124fc417e2b0f393 100644 (file)
@@ -21,16 +21,16 @@ import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelOutboundHandlerAdapter;
 import io.netty.channel.ChannelPromise;
 import java.io.IOException;
-import org.apache.sshd.client.channel.ClientChannel;
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.common.io.IoInputStream;
-import org.apache.sshd.common.io.IoOutputStream;
-import org.apache.sshd.common.io.IoReadFuture;
-import org.apache.sshd.common.io.IoWriteFuture;
-import org.apache.sshd.common.util.buffer.Buffer;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ClientChannel;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoInputStream;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoOutputStream;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoReadFuture;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoWriteFuture;
+import org.opendaylight.netconf.shaded.sshd.common.util.buffer.Buffer;
 
 public class MinaSshNettyChannelTest {
     private CallHomeSessionContext mockContext;
index e400f5e66f35ab6755919aae8f53b0a0d2206b89..a27ba05076d7382fe2237f1190fd2e6befd660ef 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.callhome.protocol;
 
 import static org.junit.Assert.assertFalse;
@@ -25,17 +24,6 @@ import java.net.SocketAddress;
 import java.security.PublicKey;
 import java.util.HashMap;
 import java.util.Map;
-import org.apache.sshd.client.SshClient;
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.session.ClientSessionImpl;
-import org.apache.sshd.common.future.SshFutureListener;
-import org.apache.sshd.common.io.IoAcceptor;
-import org.apache.sshd.common.io.IoHandler;
-import org.apache.sshd.common.io.IoServiceFactory;
-import org.apache.sshd.common.kex.KeyExchange;
-import org.apache.sshd.common.session.Session;
-import org.apache.sshd.common.session.SessionListener;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -44,6 +32,17 @@ import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSessionImpl;
+import org.opendaylight.netconf.shaded.sshd.common.future.SshFutureListener;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoAcceptor;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoHandler;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoServiceFactory;
+import org.opendaylight.netconf.shaded.sshd.common.kex.KeyExchange;
+import org.opendaylight.netconf.shaded.sshd.common.session.Session;
+import org.opendaylight.netconf.shaded.sshd.common.session.SessionListener;
 
 @RunWith(MockitoJUnitRunner.class)
 public class NetconfCallHomeServerTest {
index 53cc9dfbc8378ddc083c84437c78c2d82e9b470d..4b04d62f3ab9849b5be2048197b19ed8b4812b41 100644 (file)
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
     </dependency>
-
-    <dependency>
-      <groupId>net.i2p.crypto</groupId>
-      <artifactId>eddsa</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
 </project>
index fa5337c6c85c95b8d4f092924a9791d5d88e3e2f..915cd93c0ef66f50fcacf34e0c349ba2c3c8f95f 100644 (file)
@@ -15,9 +15,9 @@ import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.concurrent.Executors;
-import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
 import org.opendaylight.netconf.api.NetconfServerDispatcher;
 import org.opendaylight.netconf.auth.AuthProvider;
+import org.opendaylight.netconf.shaded.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IetfInetUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
index 31c9fa53aa9a85e4f6546eeba7e0bd262ecb07b1..ed557f0b627d254ca29622e4642f717c5c3bb64a 100644 (file)
@@ -20,16 +20,16 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
-import org.apache.sshd.common.NamedFactory;
-import org.apache.sshd.common.io.IoInputStream;
-import org.apache.sshd.common.io.IoOutputStream;
-import org.apache.sshd.server.Environment;
-import org.apache.sshd.server.ExitCallback;
-import org.apache.sshd.server.channel.ChannelSession;
-import org.apache.sshd.server.command.AsyncCommand;
-import org.apache.sshd.server.command.Command;
-import org.apache.sshd.server.session.ServerSession;
 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;
+import org.opendaylight.netconf.shaded.sshd.server.ExitCallback;
+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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 49f8b85242535108e9480acd841b8d7a1c777361..29f5a18d1a41fa627137f3806744175ae4c6e68d 100644 (file)
@@ -12,12 +12,12 @@ import io.netty.buffer.Unpooled;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelInboundHandlerAdapter;
 import java.nio.charset.StandardCharsets;
-import org.apache.sshd.common.io.IoInputStream;
-import org.apache.sshd.common.io.IoOutputStream;
-import org.apache.sshd.server.ExitCallback;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandlerReader;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandlerWriter;
+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.ExitCallback;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index e43c2f43d005762dfe294e7653bf8ddfabe35812..cf9cdb817a98efa49f5440fb0f5d3c474aa95cca 100644 (file)
@@ -19,23 +19,23 @@ import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-import org.apache.sshd.common.FactoryManager;
-import org.apache.sshd.common.NamedFactory;
-import org.apache.sshd.common.RuntimeSshException;
-import org.apache.sshd.common.cipher.BuiltinCiphers;
-import org.apache.sshd.common.cipher.Cipher;
-import org.apache.sshd.common.io.IoAcceptor;
-import org.apache.sshd.common.io.IoConnector;
-import org.apache.sshd.common.io.IoHandler;
-import org.apache.sshd.common.io.IoServiceEventListener;
-import org.apache.sshd.common.io.IoServiceFactory;
-import org.apache.sshd.common.io.IoServiceFactoryFactory;
-import org.apache.sshd.common.io.nio2.Nio2Acceptor;
-import org.apache.sshd.common.io.nio2.Nio2Connector;
-import org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory;
-import org.apache.sshd.common.util.closeable.AbstractCloseable;
-import org.apache.sshd.server.ServerFactoryManager;
-import org.apache.sshd.server.SshServer;
+import org.opendaylight.netconf.shaded.sshd.common.FactoryManager;
+import org.opendaylight.netconf.shaded.sshd.common.NamedFactory;
+import org.opendaylight.netconf.shaded.sshd.common.RuntimeSshException;
+import org.opendaylight.netconf.shaded.sshd.common.cipher.BuiltinCiphers;
+import org.opendaylight.netconf.shaded.sshd.common.cipher.Cipher;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoAcceptor;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoConnector;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoHandler;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoServiceEventListener;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoServiceFactory;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoServiceFactoryFactory;
+import org.opendaylight.netconf.shaded.sshd.common.io.nio2.Nio2Acceptor;
+import org.opendaylight.netconf.shaded.sshd.common.io.nio2.Nio2Connector;
+import org.opendaylight.netconf.shaded.sshd.common.io.nio2.Nio2ServiceFactoryFactory;
+import org.opendaylight.netconf.shaded.sshd.common.util.closeable.AbstractCloseable;
+import org.opendaylight.netconf.shaded.sshd.server.ServerFactoryManager;
+import org.opendaylight.netconf.shaded.sshd.server.SshServer;
 
 /**
  * Proxy SSH server that just delegates decrypted content to a delegate server within same VM.
index 12d56568064d1c44635972f262b0491819344407..e722019f07a5e6b59e7a9a158a8091761461498c 100644 (file)
@@ -13,9 +13,9 @@ import static java.util.Objects.requireNonNull;
 import io.netty.channel.local.LocalAddress;
 import java.net.InetSocketAddress;
 import java.util.Optional;
-import org.apache.sshd.common.keyprovider.KeyPairProvider;
-import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
 import org.opendaylight.netconf.auth.AuthProvider;
+import org.opendaylight.netconf.shaded.sshd.common.keyprovider.KeyPairProvider;
+import org.opendaylight.netconf.shaded.sshd.server.auth.pubkey.PublickeyAuthenticator;
 
 public final class SshProxyServerConfiguration {
     private final InetSocketAddress bindingAddress;
index 11706a823d29e58884dc9a78197933084499c264..a9c751febd4e454df835e805c13fa754d4407372 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.netconf.ssh;
 
 import io.netty.channel.local.LocalAddress;
 import java.net.InetSocketAddress;
-import org.apache.sshd.common.keyprovider.KeyPairProvider;
-import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
 import org.opendaylight.netconf.auth.AuthProvider;
+import org.opendaylight.netconf.shaded.sshd.common.keyprovider.KeyPairProvider;
+import org.opendaylight.netconf.shaded.sshd.server.auth.pubkey.PublickeyAuthenticator;
 
 public final class SshProxyServerConfigurationBuilder {
     private InetSocketAddress bindingAddress;
index a708f4f02f5decbffdaa4c9413ab0c84897aa054..dbc19dcfdade8797239a71571e27efdddcc2476d 100644 (file)
@@ -26,13 +26,13 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-import org.apache.sshd.common.util.security.SecurityUtils;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.netconf.netty.EchoClientHandler.State;
 import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.LoginPasswordHandler;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandler;
+import org.opendaylight.netconf.shaded.sshd.common.util.security.SecurityUtils;
 import org.opendaylight.netconf.ssh.SshProxyServer;
 import org.opendaylight.netconf.ssh.SshProxyServerConfigurationBuilder;
 import org.opendaylight.netconf.util.NetconfConfiguration;
index edcf19380d6e04d765e6599c6009d13ea32db172..9e87cfa4820f2d7fbfc5b2d5ff16127483dacb59 100644 (file)
@@ -21,15 +21,15 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-import org.apache.sshd.client.SshClient;
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.future.ConnectFuture;
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.common.util.security.SecurityUtils;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.future.ConnectFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.common.util.security.SecurityUtils;
 import org.opendaylight.netconf.ssh.SshProxyServer;
 import org.opendaylight.netconf.ssh.SshProxyServerConfigurationBuilder;
 import org.opendaylight.netconf.util.NetconfConfiguration;
@@ -39,9 +39,7 @@ import org.osgi.framework.ServiceReference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 public class SSHServerTest {
-
     private static final String USER = "netconf";
     private static final String PASSWORD = "netconf";
     private static final String HOST = "127.0.0.1";
index 321cb4ba44a20d9b6c71cd524aa71e553a6511fe..45986d8b899230dbeee8663276b29c509800c687 100644 (file)
@@ -13,11 +13,11 @@ import io.netty.util.concurrent.Future;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
-import org.apache.sshd.client.SshClient;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.netconf.nettyutil.AbstractNetconfDispatcher;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 3f8c35ce98d0b94164377ab2dbad70428023a7ea..93f6d006e868c5d06d3297885f489f37d11b3099 100644 (file)
@@ -9,11 +9,11 @@ package org.opendaylight.netconf.client;
 
 import io.netty.channel.Channel;
 import io.netty.util.concurrent.Promise;
-import org.apache.sshd.client.SshClient;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
 import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandler;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
 
 final class SshClientChannelInitializer extends AbstractChannelInitializer<NetconfClientSession> {
 
index 36a5d25a4c04d686f6d4587021147726d0b324e8..6e51922904da87020224d21a12f9f7f7c607f9d8 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.impl;
 
 import static org.junit.Assert.assertEquals;
@@ -13,11 +12,10 @@ import static org.junit.Assert.assertNotNull;
 
 import io.netty.channel.local.LocalAddress;
 import java.net.InetSocketAddress;
-import org.apache.sshd.common.util.net.SshdSocketAddress;
 import org.junit.Test;
+import org.opendaylight.netconf.shaded.sshd.common.util.net.SshdSocketAddress;
 
 public class NetconfServerSessionNegotiatorTest {
-
     @Test
     public void testGetInetSocketAddress() throws Exception {
 
index 9a75de1859851b1d03df5698a07a3ae1ae4bbe52..58e44b6eb69f8cbd48f36fa600e7e3a93780ebb8 100644 (file)
       <groupId>io.netty</groupId>
       <artifactId>netty-handler</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.sshd</groupId>
-      <artifactId>sshd-osgi</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.sshd</groupId>
-      <artifactId>sshd-netty</artifactId>
-    </dependency>
 
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>
       <artifactId>shaded-exificient</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>shaded-sshd</artifactId>
+    </dependency>
 
     <dependency>
       <groupId>org.slf4j</groupId>
index 72d9fb7fbc4b3d0bca8e7d5acea68c4bc348dccf..0004e85daa504d2e81cea1e25c36cf78db23a2e9 100644 (file)
@@ -9,7 +9,7 @@
 package org.opendaylight.netconf.nettyutil.handler.ssh.authentication;
 
 import java.io.IOException;
-import org.apache.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
 
 /**
  * Class providing authentication facility to SSH handler.
@@ -18,6 +18,6 @@ public abstract class AuthenticationHandler {
 
     public abstract String getUsername();
 
-    public abstract org.apache.sshd.client.future.AuthFuture authenticate(ClientSession session)
+    public abstract org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture authenticate(ClientSession session)
             throws IOException;
 }
index f824084c13d43bfec614d0c3f639b5aeb3856a21..880a55282dd10d0eb20c20e6ec829ba15637ec06 100644 (file)
@@ -9,8 +9,8 @@
 package org.opendaylight.netconf.nettyutil.handler.ssh.authentication;
 
 import java.io.IOException;
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
 
 /**
  * Class Providing username/password authentication option to
index 7bc7935cf257d0105be51a309c3042dd22eaecfe..fff34f3679a226315ff33569a1eb2ad83b39a133 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.netconf.nettyutil.handler.ssh.authentication;
 import com.google.common.base.Strings;
 import java.io.IOException;
 import java.security.KeyPair;
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.session.ClientSession;
 import org.opendaylight.aaa.encrypt.PKIUtil;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index f99534547ed432182e5570adc07291f380cd828c..5132df6e7145f8a5ca9c689a17e6505c2c027420 100644 (file)
@@ -18,13 +18,13 @@ import java.io.IOException;
 import java.net.SocketAddress;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.sshd.client.SshClient;
-import org.apache.sshd.client.channel.ClientChannel;
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.future.ConnectFuture;
-import org.apache.sshd.client.session.ClientSession;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ClientChannel;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.future.ConnectFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index da5bb7482815c77c5d4452cd716ad383de434437..e6ba03155580090ad5e6fa336cbf2b287238ca69 100644 (file)
@@ -10,11 +10,11 @@ package org.opendaylight.netconf.nettyutil.handler.ssh.client;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.apache.sshd.common.future.SshFutureListener;
-import org.apache.sshd.common.io.IoInputStream;
-import org.apache.sshd.common.io.IoReadFuture;
-import org.apache.sshd.common.util.buffer.Buffer;
-import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
+import org.opendaylight.netconf.shaded.sshd.common.future.SshFutureListener;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoInputStream;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoReadFuture;
+import org.opendaylight.netconf.shaded.sshd.common.util.buffer.Buffer;
+import org.opendaylight.netconf.shaded.sshd.common.util.buffer.ByteArrayBuffer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index e05408551f065bdb151e0306e6c51f3100734377..5f06dd8e6f8a1ddee662f093f56a895907416457 100644 (file)
@@ -17,11 +17,11 @@ import java.nio.charset.StandardCharsets;
 import java.util.Deque;
 import java.util.LinkedList;
 import java.util.Queue;
-import org.apache.sshd.common.io.IoOutputStream;
-import org.apache.sshd.common.io.WritePendingException;
-import org.apache.sshd.common.util.buffer.Buffer;
-import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
 import org.checkerframework.checker.lock.qual.GuardedBy;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoOutputStream;
+import org.opendaylight.netconf.shaded.sshd.common.io.WritePendingException;
+import org.opendaylight.netconf.shaded.sshd.common.util.buffer.Buffer;
+import org.opendaylight.netconf.shaded.sshd.common.util.buffer.ByteArrayBuffer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 07f391bdde9226f716ff660b8822fa6f97de9312..71509a1003452e3568fd37da87d5dbe1faf330c3 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.netconf.nettyutil.handler.ssh.client;
 import static java.util.Objects.requireNonNull;
 
 import com.google.common.annotations.Beta;
-import org.apache.sshd.common.SshException;
+import org.opendaylight.netconf.shaded.sshd.common.SshException;
 
 /**
  * Exception reported when endpoint authentication fails.
index d2ce899e0ac4306849c64a65bc5bea4f8da11d7e..b82434c0d88882a4e4766fb998eaca6c7416ba3d 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.nettyutil.handler.ssh.authentication;
 
 import static org.junit.Assert.assertEquals;
@@ -14,12 +13,11 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.session.ClientSession;
 import org.junit.Test;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
 
 public class LoginPasswordHandlerTest {
-
     @Test
     public void testLoginPassword() throws Exception {
         final LoginPasswordHandler loginPasswordHandler = new LoginPasswordHandler("user", "pwd");
@@ -33,4 +31,4 @@ public class LoginPasswordHandlerTest {
         verify(session).addPasswordIdentity("pwd");
         verify(session).auth();
     }
-}
\ No newline at end of file
+}
index 9f8ec61da82707c29231ffe372d48b075a4a892b..ca6f35d3080a286003462049919cc09b56c751fa 100644 (file)
@@ -38,22 +38,6 @@ import io.netty.channel.EventLoop;
 import java.io.IOException;
 import java.net.SocketAddress;
 import java.util.concurrent.TimeUnit;
-import org.apache.sshd.client.SshClient;
-import org.apache.sshd.client.channel.ChannelSubsystem;
-import org.apache.sshd.client.channel.ClientChannel;
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.future.ConnectFuture;
-import org.apache.sshd.client.future.OpenFuture;
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.common.future.CloseFuture;
-import org.apache.sshd.common.future.SshFuture;
-import org.apache.sshd.common.future.SshFutureListener;
-import org.apache.sshd.common.io.IoInputStream;
-import org.apache.sshd.common.io.IoOutputStream;
-import org.apache.sshd.common.io.IoReadFuture;
-import org.apache.sshd.common.io.IoWriteFuture;
-import org.apache.sshd.common.util.buffer.Buffer;
-import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -61,6 +45,23 @@ import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ChannelSubsystem;
+import org.opendaylight.netconf.shaded.sshd.client.channel.ClientChannel;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.future.ConnectFuture;
+import org.opendaylight.netconf.shaded.sshd.client.future.OpenFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
+import org.opendaylight.netconf.shaded.sshd.common.future.CloseFuture;
+import org.opendaylight.netconf.shaded.sshd.common.future.SshFuture;
+import org.opendaylight.netconf.shaded.sshd.common.future.SshFutureListener;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoInputStream;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoOutputStream;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoReadFuture;
+import org.opendaylight.netconf.shaded.sshd.common.io.IoWriteFuture;
+import org.opendaylight.netconf.shaded.sshd.common.io.WritePendingException;
+import org.opendaylight.netconf.shaded.sshd.common.util.buffer.Buffer;
+import org.opendaylight.netconf.shaded.sshd.common.util.buffer.ByteArrayBuffer;
 
 public class AsyncSshHandlerTest {
 
@@ -354,7 +355,7 @@ public class AsyncSshHandlerTest {
 
         final ChannelPromise secondWritePromise = getMockedPromise();
         // now make write throw pending exception
-        doThrow(org.apache.sshd.common.io.WritePendingException.class).when(asyncIn).writePacket(any(Buffer.class));
+        doThrow(WritePendingException.class).when(asyncIn).writePacket(any(Buffer.class));
         asyncSshHandler.write(ctx, Unpooled.copiedBuffer(new byte[]{0, 1, 2, 3, 4, 5}), secondWritePromise);
 
         doReturn(ioWriteFuture).when(asyncIn).writePacket(any(Buffer.class));
@@ -399,7 +400,7 @@ public class AsyncSshHandlerTest {
 
         final ChannelPromise secondWritePromise = getMockedPromise();
         // now make write throw pending exception
-        doThrow(org.apache.sshd.common.io.WritePendingException.class).when(asyncIn).writePacket(any(Buffer.class));
+        doThrow(WritePendingException.class).when(asyncIn).writePacket(any(Buffer.class));
         for (int i = 0; i < 1001; i++) {
             asyncSshHandler.write(ctx, Unpooled.copiedBuffer(new byte[]{0, 1, 2, 3, 4, 5}), secondWritePromise);
         }
index d4d8b5d01a84b588f5e7ff248f7169f0d171e8c0..8cbbed1a4cb75e97c9573b255c89ef2c00580c06 100644 (file)
@@ -62,5 +62,7 @@
 
     <module>shaded-exificient-jar</module>
     <module>shaded-exificient</module>
+    <module>shaded-sshd-jar</module>
+    <module>shaded-sshd</module>
   </modules>
 </project>
index 454b6b3f38a3de3a2addfdccfca1263e7ab655f3..0e1610dbcac965bd64f372f88d1f153fc85fa8ff 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.sal.connect.netconf.auth;
 
 import com.google.common.base.Strings;
@@ -13,12 +12,12 @@ import java.io.IOException;
 import java.io.StringReader;
 import java.security.KeyPair;
 import java.util.Optional;
-import org.apache.sshd.client.future.AuthFuture;
-import org.apache.sshd.client.session.ClientSession;
 import org.opendaylight.aaa.encrypt.AAAEncryptionService;
 import org.opendaylight.aaa.encrypt.PKIUtil;
 import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.sal.connect.netconf.sal.NetconfKeystoreAdapter;
+import org.opendaylight.netconf.shaded.sshd.client.future.AuthFuture;
+import org.opendaylight.netconf.shaded.sshd.client.session.ClientSession;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.keystore.rev171017.keystore.entry.KeyCredential;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/netconf/shaded-sshd-jar/pom.xml b/netconf/shaded-sshd-jar/pom.xml
new file mode 100644 (file)
index 0000000..77e03f5
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>odlparent</artifactId>
+        <version>6.0.6</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.opendaylight.netconf</groupId>
+    <artifactId>shaded-sshd-jar</artifactId>
+    <packaging>jar</packaging>
+    <version>1.8.2-SNAPSHOT</version>
+    <name>${project.artifactId}</name>
+
+    <properties>
+        <!-- We do not want to leak this artifact -->
+        <maven.deploy.skip>true</maven.deploy.skip>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.sshd</groupId>
+            <artifactId>sshd-osgi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sshd</groupId>
+            <artifactId>sshd-netty</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>net.i2p.crypto</groupId>
+            <artifactId>eddsa</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <createDependencyReducedPom>false</createDependencyReducedPom>
+                            <shadeSourcesContent>true</shadeSourcesContent>
+                            <createSourcesJar>true</createSourcesJar>
+                            <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+                            <artifactSet>
+                                <includes>
+                                    <include>org.apache.sshd</include>
+                                    <include>net.i2p.crypto</include>
+                                </includes>
+                            </artifactSet>
+                            <filters>
+                                <filter>
+                                    <artifact>*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/MANIFEST.MF</exclude>
+                                        <exclude>META-INF/services/**</exclude>
+                                    </excludes>
+                                </filter>
+                                <filter>
+                                    <artifact>org.apache.sshd:sshd-netty</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/DEPENDENCIES</exclude>
+                                        <exclude>META-INF/LICENSE</exclude>
+                                        <exclude>META-INF/NOTICE</exclude>
+                                        <exclude>META-INF/services/**</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                            <relocations>
+                                <relocation>
+                                    <pattern>org.apache.sshd</pattern>
+                                    <shadedPattern>org.opendaylight.netconf.shaded.sshd</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>net.i2p.crypto.eddsa</pattern>
+                                    <shadedPattern>org.opendaylight.netconf.shaded.eddsa</shadedPattern>
+                                </relocation>
+                            </relocations>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/netconf/shaded-sshd/pom.xml b/netconf/shaded-sshd/pom.xml
new file mode 100644 (file)
index 0000000..96f0541
--- /dev/null
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>bundle-parent</artifactId>
+        <version>6.0.6</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.opendaylight.netconf</groupId>
+    <artifactId>shaded-sshd</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.8.2-SNAPSHOT</version>
+    <name>${project.artifactId}</name>
+
+    <properties>
+        <!-- We are just juggling classes here -->
+        <odlparent.modernizer.skip>true</odlparent.modernizer.skip>
+        <odlparent.spotbugs.skip>true</odlparent.spotbugs.skip>
+
+        <!-- We do not want to generate javadoc -->
+        <maven.javadoc.skip>true</maven.javadoc.skip>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.netconf</groupId>
+            <artifactId>shaded-sshd-jar</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.opendaylight.netconf</groupId>
+                                    <artifactId>shaded-sshd-jar</artifactId>
+                                    <version>${project.version}</version>
+                                </artifactItem>
+                            </artifactItems>
+                            <overWriteReleases>false</overWriteReleases>
+                            <overWriteSnapshots>true</overWriteSnapshots>
+                            <outputDirectory>${project.build.directory}/classes</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>unpack-sources</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <classifier>sources</classifier>
+                            <includeArtifactIds>shaded-sshd-jar</includeArtifactIds>
+                            <outputDirectory>${project.build.directory}/shaded-sources</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>prepare-package</phase>
+                        <goals>
+                           <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>${project.build.directory}/shaded-sources</sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Import-Package>
+                            org.apache.tomcat.jni;resolution:=optional,
+                            org.bouncycastle.crypto.prng;version="[1.61,2)";resolution:=optional,
+                            org.bouncycastle.openssl;version="[1.61,2)";resolution:=optional,
+                            org.bouncycastle.openssl.jcajce;version="[1.61,2)";resolution:=optional,
+                            *
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
index 986fd4999b5902ea4f6ff0f812049a7d7c5c448e..e3b2befd8c60d4b5e90f13b55d6431d9efc69ba7 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>mdsal-netconf-ssh</artifactId>
         </dependency>
-        <dependency>
-            <groupId>net.i2p.crypto</groupId>
-            <artifactId>eddsa</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.apache.karaf.features</groupId>
             <artifactId>org.apache.karaf.features.core</artifactId>
index 46ac8a5e7cd53a59de7494e8f246d00804d8ece6..dcc23d277dcfc9bb751bc0d1d4f6b5cfd62f5d0b 100644 (file)
@@ -34,8 +34,6 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
-import org.apache.sshd.common.keyprovider.KeyPairProvider;
-import org.apache.sshd.common.util.threads.ThreadUtils;
 import org.opendaylight.netconf.api.capability.BasicCapability;
 import org.opendaylight.netconf.api.capability.Capability;
 import org.opendaylight.netconf.api.capability.YangModuleCapability;
@@ -46,6 +44,8 @@ import org.opendaylight.netconf.impl.ServerChannelInitializer;
 import org.opendaylight.netconf.impl.SessionIdProvider;
 import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.shaded.sshd.common.keyprovider.KeyPairProvider;
+import org.opendaylight.netconf.shaded.sshd.common.util.threads.ThreadUtils;
 import org.opendaylight.netconf.ssh.SshProxyServer;
 import org.opendaylight.netconf.ssh.SshProxyServerConfiguration;
 import org.opendaylight.netconf.ssh.SshProxyServerConfigurationBuilder;
index 1b0aab98d7b20a1804303d321a07ee8d02fcc4d9..6c41cec6a59123475d9bef056248def3e71a985c 100644 (file)
@@ -12,11 +12,11 @@ import java.security.KeyPair;
 import java.security.KeyPairGenerator;
 import java.security.spec.AlgorithmParameterSpec;
 import java.util.Collections;
-import org.apache.sshd.common.cipher.ECCurves;
-import org.apache.sshd.common.config.keys.KeyUtils;
-import org.apache.sshd.common.keyprovider.KeyPairProvider;
-import org.apache.sshd.common.session.SessionContext;
-import org.apache.sshd.common.util.security.SecurityUtils;
+import org.opendaylight.netconf.shaded.sshd.common.cipher.ECCurves;
+import org.opendaylight.netconf.shaded.sshd.common.config.keys.KeyUtils;
+import org.opendaylight.netconf.shaded.sshd.common.keyprovider.KeyPairProvider;
+import org.opendaylight.netconf.shaded.sshd.common.session.SessionContext;
+import org.opendaylight.netconf.shaded.sshd.common.util.security.SecurityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 22a70e5fb1c90fbc73d582727e27c68950cd4c7a..6df6fb4427686e9c86846553c939530c252f6b89 100644 (file)
@@ -5,17 +5,16 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.test.tool.client.stress;
 
 import io.netty.channel.EventLoopGroup;
 import io.netty.util.Timer;
 import java.util.Set;
-import org.apache.sshd.client.SshClient;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.netconf.client.NetconfClientDispatcherImpl;
 import org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory;
 import org.opendaylight.netconf.client.conf.NetconfClientConfiguration;
+import org.opendaylight.netconf.shaded.sshd.client.SshClient;
 
 public final class ConfigurableClientDispatcher extends NetconfClientDispatcherImpl {
 
index a38aa89e8fec95d2ad1511dfca6f0f1960aad907..a26a8b589790b37eeea01f7578316bb3773c9a34 100644 (file)
@@ -11,9 +11,9 @@ import com.google.common.collect.ImmutableSet;
 import java.io.File;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.auth.AuthProvider;
+import org.opendaylight.netconf.shaded.sshd.server.auth.pubkey.PublickeyAuthenticator;
 import org.opendaylight.netconf.test.tool.operations.OperationsCreator;
 import org.opendaylight.netconf.test.tool.rpchandler.RpcHandler;
 import org.opendaylight.netconf.test.tool.rpchandler.RpcHandlerDefault;
index 0a705b373310bbee03f65bdd39bd5f5273f152aa..46c3e891a127c6edd7872e176f162564e83e13b6 100644 (file)
@@ -9,8 +9,8 @@ package org.opendaylight.netconf.test.tool.config;
 
 import java.io.File;
 import java.util.Set;
-import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
 import org.opendaylight.netconf.auth.AuthProvider;
+import org.opendaylight.netconf.shaded.sshd.server.auth.pubkey.PublickeyAuthenticator;
 import org.opendaylight.netconf.test.tool.TesttoolParameters;
 import org.opendaylight.netconf.test.tool.operations.OperationsCreator;
 import org.opendaylight.netconf.test.tool.rpchandler.RpcHandler;