Revert "Bug 5377: Support configuring cipher suites to use for SSLEngine" 22/35722/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 4 Mar 2016 01:54:51 +0000 (20:54 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 4 Mar 2016 01:56:03 +0000 (20:56 -0500)
This reverts commit eec0e13acce7785038a9f9404aca0dc44fdba334.

Change-Id: Ifd392d9055d0b5db46f4015eaf80452eef3363c7
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
12 files changed:
openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfiguration.java
openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfigurationImpl.java
openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfigurationImplTest.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpChannelInitializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/_switch/connection/provider/impl/rev140328/SwitchConnectionProviderModule.java
openflow-protocol-impl/src/main/yang/openflow-switch-connection-provider-impl.yang
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/PublishingChannelInitializerFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/PublishingChannelInitializerTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java
openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java

index f5a71a8c2c4113c1c8c967dba0fe5d29a069a8f0..6676dd02426796c316b17242c9f9a633a3b25e14 100644 (file)
@@ -8,8 +8,6 @@
 
 package org.opendaylight.openflowjava.protocol.api.connection;
 
-import java.util.List;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 
@@ -64,9 +62,4 @@ public interface TlsConfiguration {
      * @return password protecting specified truststore
      */
     String getTruststorePassword();
-
-    /**
-     * @return list of cipher suites for TLS connection
-     */
-    List<String> getCipherSuites();
 }
index 2a290140ba5abe2c6b64d56622b88eaf0e31ef23..78a6c6b8c1804b0132a719884bca80706961114a 100644 (file)
@@ -8,8 +8,6 @@
 
 package org.opendaylight.openflowjava.protocol.api.connection;
 
-import java.util.List;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 
@@ -25,7 +23,6 @@ public class TlsConfigurationImpl implements TlsConfiguration {
     private String keyStore;
     private PathType keystorePathType;
     private PathType truststorePathType;
-    private List<String> cipherSuites;
 
     /**
      * Default constructor
@@ -38,15 +35,13 @@ public class TlsConfigurationImpl implements TlsConfiguration {
      */
     public TlsConfigurationImpl(KeystoreType trustStoreType, String trustStore,
             PathType trustStorePathType, KeystoreType keyStoreType,
-            String keyStore, PathType keyStorePathType,
-            List<String> cipherSuites) {
+            String keyStore, PathType keyStorePathType) {
         this.trustStoreType = trustStoreType;
         this.trustStore = trustStore;
         this.truststorePathType = trustStorePathType;
         this.keyStoreType = keyStoreType;
         this.keyStore = keyStore;
         this.keystorePathType = keyStorePathType;
-        this.cipherSuites = cipherSuites;
     }
 
     @Override
@@ -93,9 +88,4 @@ public class TlsConfigurationImpl implements TlsConfiguration {
     public String getTruststorePassword() {
         return "opendaylight";
     }
-
-    @Override
-    public List<String> getCipherSuites() {
-        return cipherSuites;
-    }
 }
index be52a18890fee87dc2ac33ece16d42f8efad2ed2..f71d23022c8ea3e0d6b63980a3971f69df6d06e7 100644 (file)
@@ -10,14 +10,10 @@ package org.opendaylight.openflowjava.protocol.api.connection;
 
 import static org.junit.Assert.*;
 
-import java.util.List;
-
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 
-import com.google.common.collect.Lists;
-
 /**
  * @author michal.polkorab
  *
@@ -29,9 +25,8 @@ public class TlsConfigurationImplTest {
      */
     @Test
     public void test() {
-        List<String> cipherSuites = Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256");
         TlsConfigurationImpl config = new TlsConfigurationImpl(KeystoreType.JKS,
-                "user/dir", PathType.CLASSPATH, KeystoreType.PKCS12, "/var/lib", PathType.PATH, cipherSuites);
+                "user/dir", PathType.CLASSPATH, KeystoreType.PKCS12, "/var/lib", PathType.PATH);
         assertEquals("Wrong keystore location", "/var/lib", config.getTlsKeystore());
         assertEquals("Wrong truststore location", "user/dir", config.getTlsTruststore());
         assertEquals("Wrong keystore type", KeystoreType.PKCS12, config.getTlsKeystoreType());
@@ -41,6 +36,5 @@ public class TlsConfigurationImplTest {
         assertEquals("Wrong certificate password", "opendaylight", config.getCertificatePassword());
         assertEquals("Wrong keystore password", "opendaylight", config.getKeystorePassword());
         assertEquals("Wrong truststore password", "opendaylight", config.getTruststorePassword());
-        assertEquals("Wrong cipher suites", cipherSuites, config.getCipherSuites());
     }
 }
\ No newline at end of file
index 881f697adf85d0f8cdf50ec12844723688c9af46..18566eb29e086898d68fbfbfb9bbc957649b5719 100644 (file)
@@ -16,7 +16,6 @@ import io.netty.util.concurrent.Future;
 import io.netty.util.concurrent.GenericFutureListener;
 import java.net.InetAddress;
 import java.util.Iterator;
-import java.util.List;
 import java.util.concurrent.TimeUnit;
 import javax.net.ssl.SSLEngine;
 import org.opendaylight.openflowjava.protocol.impl.core.connection.ConnectionAdapterFactory;
@@ -85,13 +84,6 @@ public class TcpChannelInitializer extends ProtocolChannelInitializer<SocketChan
                 final SSLEngine engine = sslFactory.getServerContext().createSSLEngine();
                 engine.setNeedClientAuth(true);
                 engine.setUseClientMode(false);
-                List<String> suitesList = getTlsConfiguration().getCipherSuites();
-                if (suitesList != null && !suitesList.isEmpty()) {
-                    LOGGER.debug("Requested Cipher Suites are: {}", suitesList);
-                    String[] suites = suitesList.toArray(new String[suitesList.size()]);
-                    engine.setEnabledCipherSuites(suites);
-                    LOGGER.debug("Cipher suites enabled in SSLEngine are: {}", engine.getEnabledCipherSuites().toString());
-                }
                 final SslHandler ssl = new SslHandler(engine);
                 final Future<Channel> handshakeFuture = ssl.handshakeFuture();
                 final ConnectionFacade finalConnectionFacade = connectionFacade;
index 6ded9bfbb2cb33100225070873ecf4e76efc0a2f..6077c787017ae0e26376fea066764f7641c3cb0f 100644 (file)
@@ -12,8 +12,6 @@ package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflo
 import com.google.common.base.MoreObjects;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
-import java.util.List;
-
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
 import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration;
 import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration;
@@ -138,10 +136,6 @@ public final class SwitchConnectionProviderModule extends org.opendaylight.yang.
                     public String getTruststorePassword() {
                         return MoreObjects.firstNonNull(tlsConfig.getTruststorePassword(), null);
                     }
-                    @Override
-                    public List<String> getCipherSuites() {
-                        return tlsConfig.getCipherSuites();
-                    }
                 };
             }
             @Override
index 1610ff1badea324d976253423731eae6fecbf3fe..aead17584718b7698f4a9aeb83396a85d97783c8 100644 (file)
@@ -97,10 +97,6 @@ module openflow-switch-connection-provider-impl {
                     description "password protecting truststore";
                     type string;
                 }
-                leaf-list cipher-suites {
-                    description "combination of cryptographic algorithms used by TLS connection";
-                    type string;
-                }
             }
             container threads {
                 leaf boss-threads {
index 486972401b3d23d2356bc5897d0b1e5856a02f47..6001e7f84c52e36e03f28e6addef98b056ced20b 100644 (file)
@@ -22,8 +22,6 @@ import org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFa
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 
-import com.google.common.collect.Lists;
-
 /**
  *
  * @author jameshall
@@ -45,8 +43,7 @@ public class PublishingChannelInitializerFactoryTest {
         MockitoAnnotations.initMocks(this);
         factory = new ChannelInitializerFactory();
         tlsConfiguration = new TlsConfigurationImpl(KeystoreType.JKS, "/exemplary-ctlTrustStore",
-                PathType.CLASSPATH, KeystoreType.JKS, "/exemplary-ctlKeystore", PathType.CLASSPATH,
-                Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256"));
+                PathType.CLASSPATH, KeystoreType.JKS, "/exemplary-ctlKeystore", PathType.CLASSPATH);
         factory.setDeserializationFactory(deserializationFactory);
         factory.setSerializationFactory(serializationFactory);
         factory.setSwitchConnectionHandler(switchConnectionHandler);
index b855cc917ec3f11e48bcc5637577e9f6fb007b11..bcd2ebb9b1b36813bae8664ea1fd30d5e50d8da0 100644 (file)
@@ -39,8 +39,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.K
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.provider.impl.rev140328.Tls;
 
-import com.google.common.collect.Lists;
-
 /**
  *
  * @author james.hall
@@ -91,8 +89,7 @@ public class PublishingChannelInitializerTest {
         when(mockSocketCh.pipeline()).thenReturn(mockChPipeline) ;
 
         tlsConfiguration = new TlsConfigurationImpl(KeystoreType.JKS, "/selfSignedSwitch", PathType.CLASSPATH,
-                KeystoreType.JKS, "/selfSignedController", PathType.CLASSPATH,
-                Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256"));
+                KeystoreType.JKS, "/selfSignedController", PathType.CLASSPATH);
     }
 
 
index c73f6c638ba6ff771efa3e110f8cb53eedd4bea3..a52f44c673b2a82274a1fb253047f9b460447695 100644 (file)
@@ -20,8 +20,6 @@ import org.opendaylight.openflowjava.protocol.api.connection.TlsConfigurationImp
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 
-import com.google.common.collect.Lists;
-
 /**
  *
  * @author jameshall
@@ -38,8 +36,7 @@ public class SslContextFactoryTest {
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         tlsConfiguration = new TlsConfigurationImpl(KeystoreType.JKS, "/exemplary-ctlTrustStore",
-                PathType.CLASSPATH, KeystoreType.JKS, "/exemplary-ctlKeystore", PathType.CLASSPATH,
-                Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256")) ;
+                PathType.CLASSPATH, KeystoreType.JKS, "/exemplary-ctlKeystore", PathType.CLASSPATH) ;
         sslContextFactory = new SslContextFactory(tlsConfiguration);
     }
 
index e9b36307f188a4cc6d1f3ee159e4b83945838866..78b243256ca0f57299c02ed898b7930a4dc2c92e 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowjava.protocol.impl.core.connection;
 
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -94,8 +93,7 @@ public class SwitchConnectionProviderImpl02Test {
         if (protocol.equals(TransportProtocol.TLS)) {
             tlsConfiguration = new TlsConfigurationImpl(KeystoreType.JKS,
                     "/selfSignedSwitch", PathType.CLASSPATH, KeystoreType.JKS,
-                    "/selfSignedController", PathType.CLASSPATH,
-                    Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256")) ;
+                    "/selfSignedController", PathType.CLASSPATH) ;
         }
         config = new ConnectionConfigurationImpl(startupAddress, 0, tlsConfiguration, SWITCH_IDLE_TIMEOUT, true);
         config.setTransferProtocol(protocol);
index 491e18de5237718df257af844d20ae4248540296..3b53eed6e5d9c0c5365866a8524a7bfbb41318fd 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.openflowjava.protocol.impl.core.connection;
 
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -66,8 +65,7 @@ public class SwitchConnectionProviderImplTest {
         if (protocol.equals(TransportProtocol.TLS)) {
             tlsConfiguration = new TlsConfigurationImpl(KeystoreType.JKS,
                     "/selfSignedSwitch", PathType.CLASSPATH, KeystoreType.JKS,
-                    "/selfSignedController", PathType.CLASSPATH,
-                    Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256")) ;
+                    "/selfSignedController", PathType.CLASSPATH) ;
         }
         config = new ConnectionConfigurationImpl(startupAddress, 0, tlsConfiguration, SWITCH_IDLE_TIMEOUT, true);
         config.setTransferProtocol(protocol);
index 77e747a96279f793715e110399c08d9e07969e65..e10d12de10a9fa6fa981626c169f7b7630346b0b 100644 (file)
@@ -74,8 +74,7 @@ public class IntegrationTest {
         if (protocol.equals(TransportProtocol.TLS)) {
             tlsConfiguration = new TlsConfigurationImpl(KeystoreType.JKS,
                     "/selfSignedSwitch", PathType.CLASSPATH, KeystoreType.JKS,
-                    "/selfSignedController", PathType.CLASSPATH,
-                    new ArrayList<String>());
+                    "/selfSignedController", PathType.CLASSPATH) ;
         }
         connConfig = new ConnectionConfigurationImpl(startupAddress, 0, tlsConfiguration, SWITCH_IDLE_TIMEOUT, true);
         connConfig.setTransferProtocol(protocol);