< prev index next >

test/jdk/javax/net/ssl/compatibility/JdkInfo.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 29,39 **** public class JdkInfo { public final String jdkPath; public final String version; ! public final boolean supportsECKey; public final boolean supportsSNI; public final boolean supportsALPN; public JdkInfo(String jdkPath) throws Throwable { this.jdkPath = jdkPath; --- 29,40 ---- public class JdkInfo { public final String jdkPath; public final String version; ! public final String supportedProtocols; ! public final String supportedCipherSuites; public final boolean supportsSNI; public final boolean supportsALPN; public JdkInfo(String jdkPath) throws Throwable { this.jdkPath = jdkPath;
*** 44,56 **** "Cannot determine the JDK attributes: " + jdkPath); } String[] attributes = Utils.split(output, Utils.PARAM_DELIMITER); version = attributes[0].replaceAll(".*=", ""); ! supportsECKey = Boolean.valueOf(attributes[1].replaceAll(".*=", "")); ! supportsSNI = Boolean.valueOf(attributes[2].replaceAll(".*=", "")); ! supportsALPN = Boolean.valueOf(attributes[3].replaceAll(".*=", "")); } // Determines the specific attributes for the specified JDK. private static String jdkAttributes(String jdkPath) throws Throwable { return ProcessUtils.java(jdkPath, null, JdkUtils.class).getOutput(); --- 45,58 ---- "Cannot determine the JDK attributes: " + jdkPath); } String[] attributes = Utils.split(output, Utils.PARAM_DELIMITER); version = attributes[0].replaceAll(".*=", ""); ! supportedProtocols = attributes[1].replaceAll(".*=", ""); ! supportedCipherSuites = attributes[2].replaceAll(".*=", ""); ! supportsSNI = Boolean.valueOf(attributes[3].replaceAll(".*=", "")); ! supportsALPN = Boolean.valueOf(attributes[4].replaceAll(".*=", "")); } // Determines the specific attributes for the specified JDK. private static String jdkAttributes(String jdkPath) throws Throwable { return ProcessUtils.java(jdkPath, null, JdkUtils.class).getOutput();
*** 81,92 **** return false; } return true; } public boolean supportsCipherSuite(CipherSuite cipherSuite) { ! JdkRelease jdkRelease = JdkRelease.getRelease(version); ! return cipherSuite.startJdk.sequence <= jdkRelease.sequence ! && (cipherSuite.endJdk == null ! || cipherSuite.endJdk.sequence >= jdkRelease.sequence); } } --- 83,95 ---- return false; } return true; } + public boolean supportsProtocol(Protocol protocol) { + return supportedProtocols.contains(protocol.name); + } + public boolean supportsCipherSuite(CipherSuite cipherSuite) { ! return supportedCipherSuites.contains(cipherSuite.name()); } }
< prev index next >