Blame SOURCES/jdk8076221-pr2809-disable_rc4_cipher_suites.patch

5a21c7
# HG changeset patch
5a21c7
# User xuelei
5a21c7
# Date 1453868482 0
5a21c7
#      Wed Jan 27 04:21:22 2016 +0000
5a21c7
# Node ID 8d589911411743fa38badf69c10aa067eaa996b7
5a21c7
# Parent  ceb95f0d38d7ab09762dd7ff33bb855f3088a6b5
5a21c7
8076221, PR2809: Disable RC4 cipher suites
5a21c7
Reviewed-by: wetmore
5a21c7
5a21c7
diff --git openjdk.orig/jdk/src/share/lib/security/java.security-linux openjdk/jdk/src/share/lib/security/java.security-linux
5a21c7
--- openjdk.orig/jdk/src/share/lib/security/java.security-linux
5a21c7
+++ openjdk/jdk/src/share/lib/security/java.security-linux
5a21c7
@@ -556,8 +556,8 @@
5a21c7
 #
5a21c7
 # Example:
5a21c7
 #   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
5a21c7
-jdk.tls.disabledAlgorithms=SSLv3, DES, MD5withRSA, DH keySize < 1024, \
5a21c7
-    EC keySize < 224, RC4_40, 3DES_EDE_CBC, anon, NULL
5a21c7
+jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \
5a21c7
+    EC keySize < 224, 3DES_EDE_CBC, anon, NULL
5a21c7
 
5a21c7
 # Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
5a21c7
 # processing in JSSE implementation.
5a21c7
diff --git openjdk.orig/jdk/src/share/lib/security/java.security-macosx openjdk/jdk/src/share/lib/security/java.security-macosx
5a21c7
--- openjdk.orig/jdk/src/share/lib/security/java.security-macosx
5a21c7
+++ openjdk/jdk/src/share/lib/security/java.security-macosx
5a21c7
@@ -561,8 +561,8 @@
5a21c7
 #
5a21c7
 # Example:
5a21c7
 #   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
5a21c7
-jdk.tls.disabledAlgorithms=SSLv3, DES, MD5withRSA, DH keySize < 1024, \
5a21c7
-    EC keySize < 224, RC4_40, 3DES_EDE_CBC, anon, NULL
5a21c7
+jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \
5a21c7
+    EC keySize < 224, 3DES_EDE_CBC, anon, NULL
5a21c7
 
5a21c7
 # Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
5a21c7
 # processing in JSSE implementation.
5a21c7
diff --git openjdk.orig/jdk/src/share/lib/security/java.security-solaris openjdk/jdk/src/share/lib/security/java.security-solaris
5a21c7
--- openjdk.orig/jdk/src/share/lib/security/java.security-solaris
5a21c7
+++ openjdk/jdk/src/share/lib/security/java.security-solaris
5a21c7
@@ -560,8 +560,8 @@
5a21c7
 #
5a21c7
 # Example:
5a21c7
 #   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
5a21c7
-jdk.tls.disabledAlgorithms=SSLv3, DES, MD5withRSA, DH keySize < 1024, \
5a21c7
-    EC keySize < 224, RC4_40, 3DES_EDE_CBC, anon, NULL
5a21c7
+jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \
5a21c7
+    EC keySize < 224, 3DES_EDE_CBC, anon, NULL
5a21c7
 
5a21c7
 # Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
5a21c7
 # processing in JSSE implementation.
5a21c7
diff --git openjdk.orig/jdk/src/share/lib/security/java.security-windows openjdk/jdk/src/share/lib/security/java.security-windows
5a21c7
--- openjdk.orig/jdk/src/share/lib/security/java.security-windows
5a21c7
+++ openjdk/jdk/src/share/lib/security/java.security-windows
5a21c7
@@ -561,8 +561,8 @@
5a21c7
 #
5a21c7
 # Example:
5a21c7
 #   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
5a21c7
-jdk.tls.disabledAlgorithms=SSLv3, DES, MD5withRSA, DH keySize < 1024, \
5a21c7
-    EC keySize < 224, RC4_40, 3DES_EDE_CBC, anon, NULL
5a21c7
+jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \
5a21c7
+    EC keySize < 224, 3DES_EDE_CBC, anon, NULL
5a21c7
 
5a21c7
 # Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
5a21c7
 # processing in JSSE implementation.
5a21c7
diff --git openjdk.orig/jdk/test/javax/net/ssl/ciphersuites/DisabledAlgorithms.java openjdk/jdk/test/javax/net/ssl/ciphersuites/DisabledAlgorithms.java
5a21c7
new file mode 100644
5a21c7
--- /dev/null
5a21c7
+++ openjdk/jdk/test/javax/net/ssl/ciphersuites/DisabledAlgorithms.java
5a21c7
@@ -0,0 +1,362 @@
5a21c7
+/*
5a21c7
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
5a21c7
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5a21c7
+ *
5a21c7
+ * This code is free software; you can redistribute it and/or modify it
5a21c7
+ * under the terms of the GNU General Public License version 2 only, as
5a21c7
+ * published by the Free Software Foundation.
5a21c7
+ *
5a21c7
+ * This code is distributed in the hope that it will be useful, but WITHOUT
5a21c7
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5a21c7
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5a21c7
+ * version 2 for more details (a copy is included in the LICENSE file that
5a21c7
+ * accompanied this code).
5a21c7
+ *
5a21c7
+ * You should have received a copy of the GNU General Public License version
5a21c7
+ * 2 along with this work; if not, write to the Free Software Foundation,
5a21c7
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5a21c7
+ *
5a21c7
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5a21c7
+ * or visit www.oracle.com if you need additional information or have any
5a21c7
+ * questions.
5a21c7
+ */
5a21c7
+
5a21c7
+import java.io.BufferedInputStream;
5a21c7
+import java.io.BufferedOutputStream;
5a21c7
+import java.io.IOException;
5a21c7
+import java.io.InputStream;
5a21c7
+import java.io.OutputStream;
5a21c7
+import java.security.NoSuchAlgorithmException;
5a21c7
+import java.security.Security;
5a21c7
+import java.util.concurrent.TimeUnit;
5a21c7
+import javax.net.ssl.SSLContext;
5a21c7
+import javax.net.ssl.SSLHandshakeException;
5a21c7
+import javax.net.ssl.SSLServerSocket;
5a21c7
+import javax.net.ssl.SSLServerSocketFactory;
5a21c7
+import javax.net.ssl.SSLSocket;
5a21c7
+import javax.net.ssl.SSLSocketFactory;
5a21c7
+
5a21c7
+/**
5a21c7
+ * @test
5a21c7
+ * @bug 8076221
5a21c7
+ * @summary Check if weak cipher suites are disabled
5a21c7
+ * @run main/othervm DisabledAlgorithms default
5a21c7
+ * @run main/othervm DisabledAlgorithms empty
5a21c7
+ */
5a21c7
+public class DisabledAlgorithms {
5a21c7
+
5a21c7
+    private static final String pathToStores =
5a21c7
+            "../../../../sun/security/ssl/etc";
5a21c7
+    private static final String keyStoreFile = "keystore";
5a21c7
+    private static final String trustStoreFile = "truststore";
5a21c7
+    private static final String passwd = "passphrase";
5a21c7
+
5a21c7
+    private static final String keyFilename =
5a21c7
+            System.getProperty("test.src", "./") + "/" + pathToStores +
5a21c7
+                "/" + keyStoreFile;
5a21c7
+
5a21c7
+    private static final String trustFilename =
5a21c7
+            System.getProperty("test.src", "./") + "/" + pathToStores +
5a21c7
+                "/" + trustStoreFile;
5a21c7
+
5a21c7
+    // supported RC4 cipher suites
5a21c7
+    // it does not contain KRB5 cipher suites because they need a KDC
5a21c7
+    private static final String[] rc4_ciphersuites = new String[] {
5a21c7
+        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
5a21c7
+        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
5a21c7
+        "SSL_RSA_WITH_RC4_128_SHA",
5a21c7
+        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
5a21c7
+        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
5a21c7
+        "SSL_RSA_WITH_RC4_128_MD5",
5a21c7
+        "TLS_ECDH_anon_WITH_RC4_128_SHA",
5a21c7
+        "SSL_DH_anon_WITH_RC4_128_MD5"
5a21c7
+    };
5a21c7
+
5a21c7
+    public static void main(String[] args) throws Exception {
5a21c7
+        if (args.length < 1) {
5a21c7
+            throw new RuntimeException("No parameters specified");
5a21c7
+        }
5a21c7
+
5a21c7
+        System.setProperty("javax.net.ssl.keyStore", keyFilename);
5a21c7
+        System.setProperty("javax.net.ssl.keyStorePassword", passwd);
5a21c7
+        System.setProperty("javax.net.ssl.trustStore", trustFilename);
5a21c7
+        System.setProperty("javax.net.ssl.trustStorePassword", passwd);
5a21c7
+
5a21c7
+        switch (args[0]) {
5a21c7
+            case "default":
5a21c7
+                // use default jdk.tls.disabledAlgorithms
5a21c7
+                System.out.println("jdk.tls.disabledAlgorithms = "
5a21c7
+                        + Security.getProperty("jdk.tls.disabledAlgorithms"));
5a21c7
+
5a21c7
+                // check if RC4 cipher suites can't be used by default
5a21c7
+                checkFailure(rc4_ciphersuites);
5a21c7
+                break;
5a21c7
+            case "empty":
5a21c7
+                // reset jdk.tls.disabledAlgorithms
5a21c7
+                Security.setProperty("jdk.tls.disabledAlgorithms", "");
5a21c7
+                System.out.println("jdk.tls.disabledAlgorithms = "
5a21c7
+                        + Security.getProperty("jdk.tls.disabledAlgorithms"));
5a21c7
+
5a21c7
+                // check if RC4 cipher suites can be used
5a21c7
+                // if jdk.tls.disabledAlgorithms is empty
5a21c7
+                checkSuccess(rc4_ciphersuites);
5a21c7
+                break;
5a21c7
+            default:
5a21c7
+                throw new RuntimeException("Wrong parameter: " + args[0]);
5a21c7
+        }
5a21c7
+    }
5a21c7
+
5a21c7
+    /*
5a21c7
+     * Checks if that specified cipher suites cannot be used.
5a21c7
+     */
5a21c7
+    private static void checkFailure(String[] ciphersuites) throws Exception {
5a21c7
+        try (SSLServer server = SSLServer.init(ciphersuites)) {
5a21c7
+            startNewThread(server);
5a21c7
+            while (!server.isRunning()) {
5a21c7
+                sleep();
5a21c7
+            }
5a21c7
+
5a21c7
+            int port = server.getPort();
5a21c7
+            for (String ciphersuite : ciphersuites) {
5a21c7
+                try (SSLClient client = SSLClient.init(port, ciphersuite)) {
5a21c7
+                    client.connect();
5a21c7
+                    throw new RuntimeException("Expected SSLHandshakeException "
5a21c7
+                            + "not thrown");
5a21c7
+                } catch (SSLHandshakeException e) {
5a21c7
+                    System.out.println("Expected exception on client side: "
5a21c7
+                            + e);
5a21c7
+                }
5a21c7
+            }
5a21c7
+
5a21c7
+            server.stop();
5a21c7
+            while (server.isRunning()) {
5a21c7
+                sleep();
5a21c7
+            }
5a21c7
+
5a21c7
+            if (!server.sslError()) {
5a21c7
+                throw new RuntimeException("Expected SSL exception "
5a21c7
+                        + "not thrown on server side");
5a21c7
+            }
5a21c7
+        }
5a21c7
+
5a21c7
+    }
5a21c7
+
5a21c7
+    /*
5a21c7
+     * Checks if specified cipher suites can be used.
5a21c7
+     */
5a21c7
+    private static void checkSuccess(String[] ciphersuites) throws Exception {
5a21c7
+        try (SSLServer server = SSLServer.init(ciphersuites)) {
5a21c7
+            startNewThread(server);
5a21c7
+            while (!server.isRunning()) {
5a21c7
+                sleep();
5a21c7
+            }
5a21c7
+
5a21c7
+            int port = server.getPort();
5a21c7
+            for (String ciphersuite : ciphersuites) {
5a21c7
+                try (SSLClient client = SSLClient.init(port, ciphersuite)) {
5a21c7
+                    client.connect();
5a21c7
+                    String negotiated = client.getNegotiatedCipherSuite();
5a21c7
+                    System.out.println("Negotiated cipher suite: "
5a21c7
+                            + negotiated);
5a21c7
+                    if (!negotiated.equals(ciphersuite)) {
5a21c7
+                        throw new RuntimeException("Unexpected cipher suite: "
5a21c7
+                                + negotiated);
5a21c7
+                    }
5a21c7
+                }
5a21c7
+            }
5a21c7
+
5a21c7
+            server.stop();
5a21c7
+            while (server.isRunning()) {
5a21c7
+                sleep();
5a21c7
+            }
5a21c7
+
5a21c7
+            if (server.error()) {
5a21c7
+                throw new RuntimeException("Unexpected error on server side");
5a21c7
+            }
5a21c7
+        }
5a21c7
+
5a21c7
+    }
5a21c7
+
5a21c7
+    private static Thread startNewThread(SSLServer server) {
5a21c7
+        Thread serverThread = new Thread(server, "SSL server thread");
5a21c7
+        serverThread.setDaemon(true);
5a21c7
+        serverThread.start();
5a21c7
+        return serverThread;
5a21c7
+    }
5a21c7
+
5a21c7
+    private static void sleep() {
5a21c7
+        try {
5a21c7
+            TimeUnit.MILLISECONDS.sleep(50);
5a21c7
+        } catch (InterruptedException e) {
5a21c7
+            // do nothing
5a21c7
+        }
5a21c7
+    }
5a21c7
+
5a21c7
+    static class SSLServer implements Runnable, AutoCloseable {
5a21c7
+
5a21c7
+        private final SSLServerSocket ssocket;
5a21c7
+        private volatile boolean stopped = false;
5a21c7
+        private volatile boolean running = false;
5a21c7
+        private volatile boolean sslError = false;
5a21c7
+        private volatile boolean otherError = false;
5a21c7
+
5a21c7
+        private SSLServer(SSLServerSocket ssocket) {
5a21c7
+            this.ssocket = ssocket;
5a21c7
+        }
5a21c7
+
5a21c7
+        @Override
5a21c7
+        public void run() {
5a21c7
+            System.out.println("Server: started");
5a21c7
+            running = true;
5a21c7
+            while (!stopped) {
5a21c7
+                try (SSLSocket socket = (SSLSocket) ssocket.accept()) {
5a21c7
+                    System.out.println("Server: accepted client connection");
5a21c7
+                    InputStream in = socket.getInputStream();
5a21c7
+                    OutputStream out = socket.getOutputStream();
5a21c7
+                    int b = in.read();
5a21c7
+                    if (b < 0) {
5a21c7
+                        throw new IOException("Unexpected EOF");
5a21c7
+                    }
5a21c7
+                    System.out.println("Server: send data: " + b);
5a21c7
+                    out.write(b);
5a21c7
+                    out.flush();
5a21c7
+                    socket.getSession().invalidate();
5a21c7
+                } catch (SSLHandshakeException e) {
5a21c7
+                    System.out.println("Server: run: " + e);
5a21c7
+                    sslError = true;
5a21c7
+                } catch (IOException e) {
5a21c7
+                    if (!stopped) {
5a21c7
+                        System.out.println("Server: run: " + e);
5a21c7
+                        e.printStackTrace();
5a21c7
+                        otherError = true;
5a21c7
+                    }
5a21c7
+                }
5a21c7
+            }
5a21c7
+
5a21c7
+            System.out.println("Server: finished");
5a21c7
+            running = false;
5a21c7
+        }
5a21c7
+
5a21c7
+        int getPort() {
5a21c7
+            return ssocket.getLocalPort();
5a21c7
+        }
5a21c7
+
5a21c7
+        String[] getEnabledCiperSuites() {
5a21c7
+            return ssocket.getEnabledCipherSuites();
5a21c7
+        }
5a21c7
+
5a21c7
+        boolean isRunning() {
5a21c7
+            return running;
5a21c7
+        }
5a21c7
+
5a21c7
+        boolean sslError() {
5a21c7
+            return sslError;
5a21c7
+        }
5a21c7
+
5a21c7
+        boolean error() {
5a21c7
+            return sslError || otherError;
5a21c7
+        }
5a21c7
+
5a21c7
+        void stop() {
5a21c7
+            stopped = true;
5a21c7
+            if (!ssocket.isClosed()) {
5a21c7
+                try {
5a21c7
+                    ssocket.close();
5a21c7
+                } catch (IOException e) {
5a21c7
+                    System.out.println("Server: close: " + e);
5a21c7
+                }
5a21c7
+            }
5a21c7
+        }
5a21c7
+
5a21c7
+        @Override
5a21c7
+        public void close() {
5a21c7
+            stop();
5a21c7
+        }
5a21c7
+
5a21c7
+        static SSLServer init(String[] ciphersuites)
5a21c7
+                throws IOException {
5a21c7
+            SSLServerSocketFactory ssf = (SSLServerSocketFactory)
5a21c7
+                    SSLServerSocketFactory.getDefault();
5a21c7
+            SSLServerSocket ssocket = (SSLServerSocket)
5a21c7
+                    ssf.createServerSocket(0);
5a21c7
+
5a21c7
+            if (ciphersuites != null) {
5a21c7
+                System.out.println("Server: enable cipher suites: "
5a21c7
+                        + java.util.Arrays.toString(ciphersuites));
5a21c7
+                ssocket.setEnabledCipherSuites(ciphersuites);
5a21c7
+            }
5a21c7
+
5a21c7
+            return new SSLServer(ssocket);
5a21c7
+        }
5a21c7
+    }
5a21c7
+
5a21c7
+    static class SSLClient implements AutoCloseable {
5a21c7
+
5a21c7
+        private final SSLSocket socket;
5a21c7
+
5a21c7
+        private SSLClient(SSLSocket socket) {
5a21c7
+            this.socket = socket;
5a21c7
+        }
5a21c7
+
5a21c7
+        void connect() throws IOException {
5a21c7
+            System.out.println("Client: connect to server");
5a21c7
+            try (
5a21c7
+                    BufferedInputStream bis = new BufferedInputStream(
5a21c7
+                            socket.getInputStream());
5a21c7
+                    BufferedOutputStream bos = new BufferedOutputStream(
5a21c7
+                            socket.getOutputStream())) {
5a21c7
+                bos.write('x');
5a21c7
+                bos.flush();
5a21c7
+
5a21c7
+                int read = bis.read();
5a21c7
+                if (read < 0) {
5a21c7
+                    throw new IOException("Client: couldn't read a response");
5a21c7
+                }
5a21c7
+                socket.getSession().invalidate();
5a21c7
+            }
5a21c7
+        }
5a21c7
+
5a21c7
+        String[] getEnabledCiperSuites() {
5a21c7
+            return socket.getEnabledCipherSuites();
5a21c7
+        }
5a21c7
+
5a21c7
+        String getNegotiatedCipherSuite() {
5a21c7
+            return socket.getSession().getCipherSuite();
5a21c7
+        }
5a21c7
+
5a21c7
+        @Override
5a21c7
+        public void close() throws Exception {
5a21c7
+            if (!socket.isClosed()) {
5a21c7
+                try {
5a21c7
+                    socket.close();
5a21c7
+                } catch (IOException e) {
5a21c7
+                    System.out.println("Client: close: " + e);
5a21c7
+                }
5a21c7
+            }
5a21c7
+        }
5a21c7
+
5a21c7
+        static SSLClient init(int port)
5a21c7
+                throws NoSuchAlgorithmException, IOException {
5a21c7
+            return init(port, null);
5a21c7
+        }
5a21c7
+
5a21c7
+        static SSLClient init(int port, String ciphersuite)
5a21c7
+                throws NoSuchAlgorithmException, IOException {
5a21c7
+            SSLContext context = SSLContext.getDefault();
5a21c7
+            SSLSocketFactory ssf = (SSLSocketFactory)
5a21c7
+                    context.getSocketFactory();
5a21c7
+            SSLSocket socket = (SSLSocket) ssf.createSocket("localhost", port);
5a21c7
+
5a21c7
+            if (ciphersuite != null) {
5a21c7
+                System.out.println("Client: enable cipher suite: "
5a21c7
+                        + ciphersuite);
5a21c7
+                socket.setEnabledCipherSuites(new String[] { ciphersuite });
5a21c7
+            }
5a21c7
+
5a21c7
+            return new SSLClient(socket);
5a21c7
+        }
5a21c7
+
5a21c7
+    }
5a21c7
+
5a21c7
+
5a21c7
+}
5a21c7
diff --git openjdk.orig/jdk/test/sun/security/krb5/auto/SSL.java openjdk/jdk/test/sun/security/krb5/auto/SSL.java
5a21c7
--- openjdk.orig/jdk/test/sun/security/krb5/auto/SSL.java
5a21c7
+++ openjdk/jdk/test/sun/security/krb5/auto/SSL.java
5a21c7
@@ -1,5 +1,5 @@
5a21c7
 /*
5a21c7
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
5a21c7
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
5a21c7
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5a21c7
  *
5a21c7
  * This code is free software; you can redistribute it and/or modify it
5a21c7
@@ -40,6 +40,7 @@
5a21c7
 import java.net.InetAddress;
5a21c7
 import javax.net.ssl.*;
5a21c7
 import java.security.Principal;
5a21c7
+import java.security.Security;
5a21c7
 import java.util.Date;
5a21c7
 import sun.security.jgss.GSSUtil;
5a21c7
 import sun.security.krb5.PrincipalName;
5a21c7
@@ -54,6 +55,9 @@
5a21c7
     private static volatile int port;
5a21c7
 
5a21c7
     public static void main(String[] args) throws Exception {
5a21c7
+        // reset the security property to make sure that the algorithms
5a21c7
+        // and keys used in this test are not disabled.
5a21c7
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
5a21c7
 
5a21c7
         krb5Cipher = args[0];
5a21c7
 
5a21c7
diff --git openjdk.orig/jdk/test/sun/security/ssl/CipherSuite/NoDesRC4CiphSuite.java openjdk/jdk/test/sun/security/ssl/CipherSuite/NoDesRC4CiphSuite.java
5a21c7
--- openjdk.orig/jdk/test/sun/security/ssl/CipherSuite/NoDesRC4CiphSuite.java
5a21c7
+++ openjdk/jdk/test/sun/security/ssl/CipherSuite/NoDesRC4CiphSuite.java
5a21c7
@@ -95,12 +95,9 @@
5a21c7
         allGood &= testEngOnlyDisabled(DES_CS_LIST_NAMES);
5a21c7
 
5a21c7
         // Disabled RC4 tests
5a21c7
-        /*
5a21c7
-          RC4 is not yet disabled, as 8076221 has not been backported
5a21c7
         allGood &= testDefaultCase(RC4_CS_LIST);
5a21c7
         allGood &= testEngAddDisabled(RC4_CS_LIST_NAMES, RC4_CS_LIST);
5a21c7
         allGood &= testEngOnlyDisabled(RC4_CS_LIST_NAMES);
5a21c7
-        */
5a21c7
 
5a21c7
         if (allGood) {
5a21c7
             System.err.println("All tests passed");
5a21c7
diff --git openjdk.orig/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/CipherSuiteOrder.java openjdk/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/CipherSuiteOrder.java
5a21c7
--- openjdk.orig/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/CipherSuiteOrder.java
5a21c7
+++ openjdk/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/CipherSuiteOrder.java
5a21c7
@@ -1,5 +1,5 @@
5a21c7
 /*
5a21c7
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
5a21c7
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
5a21c7
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5a21c7
  *
5a21c7
  * This code is free software; you can redistribute it and/or modify it
5a21c7
@@ -36,7 +36,7 @@
5a21c7
  */
5a21c7
 
5a21c7
 import java.io.*;
5a21c7
-import java.net.*;
5a21c7
+import java.security.Security;
5a21c7
 import javax.net.ssl.*;
5a21c7
 
5a21c7
 public class CipherSuiteOrder {
5a21c7
@@ -198,6 +198,10 @@
5a21c7
     volatile Exception clientException = null;
5a21c7
 
5a21c7
     public static void main(String[] args) throws Exception {
5a21c7
+        // reset the security property to make sure that the algorithms
5a21c7
+        // and keys used in this test are not disabled.
5a21c7
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
5a21c7
+
5a21c7
         String keyFilename =
5a21c7
             System.getProperty("test.src", "./") + "/" + pathToStores +
5a21c7
                 "/" + keyStoreFile;
5a21c7
diff --git openjdk.orig/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java openjdk/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java
5a21c7
--- openjdk.orig/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java
5a21c7
+++ openjdk/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java
5a21c7
@@ -103,10 +103,10 @@
5a21c7
 import java.security.Security;
5a21c7
 import java.security.KeyStore;
5a21c7
 import java.security.KeyFactory;
5a21c7
+import java.security.Security;
5a21c7
 import java.security.cert.Certificate;
5a21c7
 import java.security.cert.CertificateFactory;
5a21c7
 import java.security.spec.PKCS8EncodedKeySpec;
5a21c7
-import java.security.spec.*;
5a21c7
 import java.security.interfaces.*;
5a21c7
 import sun.misc.BASE64Decoder;
5a21c7
 
5a21c7
diff --git openjdk.orig/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/CheckStatus.java openjdk/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/CheckStatus.java
5a21c7
--- openjdk.orig/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/CheckStatus.java
5a21c7
+++ openjdk/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/CheckStatus.java
5a21c7
@@ -1,5 +1,5 @@
5a21c7
 /*
5a21c7
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
5a21c7
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
5a21c7
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5a21c7
  *
5a21c7
  * This code is free software; you can redistribute it and/or modify it
5a21c7
@@ -622,6 +622,9 @@
5a21c7
     }
5a21c7
 
5a21c7
     public static void main(String args[]) throws Exception {
5a21c7
+        // reset the security property to make sure that the algorithms
5a21c7
+        // and keys used in this test are not disabled.
5a21c7
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
5a21c7
 
5a21c7
         CheckStatus cs;
5a21c7
 
5a21c7
diff --git openjdk.orig/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/ConnectionTest.java openjdk/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/ConnectionTest.java
5a21c7
--- openjdk.orig/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/ConnectionTest.java
5a21c7
+++ openjdk/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/ConnectionTest.java
5a21c7
@@ -33,6 +33,8 @@
5a21c7
  * The code could certainly be tightened up a lot.
5a21c7
  *
5a21c7
  * @author Brad Wetmore
5a21c7
+ *
5a21c7
+ * @run main/othervm ConnectionTest
5a21c7
  */
5a21c7
 
5a21c7
 import javax.net.ssl.*;
5a21c7
@@ -672,6 +674,10 @@
5a21c7
     }
5a21c7
 
5a21c7
     public static void main(String args[]) throws Exception {
5a21c7
+        // reset the security property to make sure that the algorithms
5a21c7
+        // and keys used in this test are not disabled.
5a21c7
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
5a21c7
+
5a21c7
         ConnectionTest ct = new ConnectionTest();
5a21c7
         ct.test();
5a21c7
     }
5a21c7
diff --git openjdk.orig/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargeBufs.java openjdk/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargeBufs.java
5a21c7
--- openjdk.orig/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargeBufs.java
5a21c7
+++ openjdk/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargeBufs.java
5a21c7
@@ -180,6 +180,9 @@
5a21c7
     }
5a21c7
 
5a21c7
     public static void main(String args[]) throws Exception {
5a21c7
+        // reset the security property to make sure that the algorithms
5a21c7
+        // and keys used in this test are not disabled.
5a21c7
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
5a21c7
 
5a21c7
         LargeBufs test;
5a21c7
 
5a21c7
diff --git openjdk.orig/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java openjdk/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java
5a21c7
--- openjdk.orig/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java
5a21c7
+++ openjdk/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java
5a21c7
@@ -37,7 +37,7 @@
5a21c7
  */
5a21c7
 
5a21c7
 import java.io.*;
5a21c7
-import java.net.*;
5a21c7
+import java.security.Security;
5a21c7
 import javax.net.ssl.*;
5a21c7
 
5a21c7
 public class GenericStreamCipher {
5a21c7
@@ -165,6 +165,10 @@
5a21c7
     volatile Exception clientException = null;
5a21c7
 
5a21c7
     public static void main(String[] args) throws Exception {
5a21c7
+        // reset the security property to make sure that the algorithms
5a21c7
+        // and keys used in this test are not disabled.
5a21c7
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
5a21c7
+
5a21c7
         String keyFilename =
5a21c7
             System.getProperty("test.src", ".") + "/" + pathToStores +
5a21c7
                 "/" + keyStoreFile;