8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
Summary: Added Provider constructor which uses version String and use sun.security.util.PROVIDER_VER
Reviewed-by: weijun
--- a/jdk/src/java.base/macosx/classes/apple/security/AppleProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/macosx/classes/apple/security/AppleProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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
@@ -26,6 +26,7 @@
package apple.security;
import java.security.*;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* The Apple Security Provider.
@@ -74,7 +75,7 @@
public AppleProvider() {
/* We are the Apple provider */
- super("Apple", 9.0d, info);
+ super("Apple", PROVIDER_VER, info);
final Provider p = this;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -28,6 +28,7 @@
import java.security.AccessController;
import java.security.Provider;
import java.security.SecureRandom;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
@@ -104,7 +105,7 @@
public SunJCE() {
/* We are the "SunJCE" provider */
- super("SunJCE", 9.0d, info);
+ super("SunJCE", PROVIDER_VER, info);
final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" +
"|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" +
--- a/jdk/src/java.base/share/classes/java/security/AuthProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/security/AuthProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -50,9 +50,24 @@
* @param name the provider name.
* @param version the provider version number.
* @param info a description of the provider and its services.
+ * @deprecated use {@link #AuthProvider(String, String, String)} instead.
*/
+ @Deprecated(since="9")
protected AuthProvider(String name, double version, String info) {
- super(name, version, info);
+ super(name, Double.toString(version), info);
+ }
+
+ /**
+ * Constructs a provider with the specified name, version string,
+ * and information.
+ *
+ * @param name the provider name.
+ * @param versionStr the provider version string.
+ * @param info a description of the provider and its services.
+ * @since 9
+ */
+ protected AuthProvider(String name, String versionStr, String info) {
+ super(name, versionStr, info);
}
/**
--- a/jdk/src/java.base/share/classes/java/security/Provider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/security/Provider.java Fri Aug 19 06:27:54 2016 +0000
@@ -67,14 +67,14 @@
* <tr><td>{@code Provider.id name}</td>
* <td>{@code String.valueOf(provider.getName())}</td>
* <tr><td>{@code Provider.id version}</td>
- * <td>{@code String.valueOf(provider.getVersion())}</td>
+ * <td>{@code String.valueOf(provider.getVersionStr())}</td>
* <tr><td>{@code Provider.id info}</td>
<td>{@code String.valueOf(provider.getInfo())}</td>
* <tr><td>{@code Provider.id className}</td>
* <td>{@code provider.getClass().getName()}</td>
* </table>
*
- * <p>Each provider has a name and a version number. A provider normally
+ * <p>Each provider has a name and a version string. A provider normally
* identifies itself with a file named {@code java.security.Provider}
* in the resource directory {@code META-INF/services}.
* Security providers are looked up via the {@link ServiceLoader} mechanism
@@ -102,11 +102,10 @@
public abstract class Provider extends Properties {
// Declare serialVersionUID to be compatible with JDK1.1
- static final long serialVersionUID = -4298000515446427739L;
+ private static final long serialVersionUID = -4298000515446427739L;
private static final sun.security.util.Debug debug =
- sun.security.util.Debug.getInstance
- ("provider", "Provider");
+ sun.security.util.Debug.getInstance("provider", "Provider");
/**
* The provider name.
@@ -129,6 +128,12 @@
*/
private double version;
+ /**
+ * The provider version string.
+ *
+ * @serial
+ */
+ private String versionStr;
private transient Set<Map.Entry<Object,Object>> entrySet = null;
private transient int entrySetCallCount = 0;
@@ -174,19 +179,83 @@
}
}
+ private static double parseVersionStr(String s) {
+ try {
+ int firstDotIdx = s.indexOf('.');
+ int nextDotIdx = s.indexOf('.', firstDotIdx + 1);
+ if (nextDotIdx != -1) {
+ s = s.substring(0, nextDotIdx);
+ }
+ int endIdx = s.indexOf('-');
+ if (endIdx > 0) {
+ s = s.substring(0, endIdx);
+ }
+ endIdx = s.indexOf('+');
+ if (endIdx > 0) {
+ s = s.substring(0, endIdx);
+ }
+ return Double.parseDouble(s);
+ } catch (NullPointerException | NumberFormatException e) {
+ return 0d;
+ }
+ }
+
/**
* Constructs a provider with the specified name, version number,
- * and information.
+ * and information. Calling this constructor is equivalent to call the
+ * {@link #Provider(String, String, String)} with {@code name}
+ * name, {@code Double.toString(version)}, and {@code info}.
*
* @param name the provider name.
*
* @param version the provider version number.
*
* @param info a description of the provider and its services.
+ *
+ * @deprecated use {@link #Provider(String, String, String)} instead.
*/
+ @Deprecated(since="9")
protected Provider(String name, double version, String info) {
this.name = name;
this.version = version;
+ this.versionStr = Double.toString(version);
+ this.info = info;
+ putId();
+ initialized = true;
+ }
+
+ /**
+ * Constructs a provider with the specified name, version string,
+ * and information.
+ *
+ * <p>The version string contains a version number optionally followed
+ * by other information separated by one of the characters of '+', '-'.
+ *
+ * The format for the version number is:
+ *
+ * <blockquote><pre>
+ * ^[0-9]+(\.[0-9]+)*
+ * </pre></blockquote>
+ *
+ * <p>In order to return the version number in a double, when there are
+ * more than two components (separated by '.' as defined above), only
+ * the first two components are retained. The resulting string is then
+ * passed to {@link Double#valueOf(String)} to generate version number,
+ * i.e. {@link #getVersion}.
+ * <p>If the conversion failed, value 0 will be used.
+ *
+ * @param name the provider name.
+ *
+ * @param versionStr the provider version string.
+ *
+ * @param info a description of the provider and its services.
+ *
+ * @since 9
+ */
+ protected Provider(String name, String versionStr, String info) {
+ this.name = name;
+ this.versionStr = versionStr;
+ this.version = parseVersionStr(versionStr);
this.info = info;
putId();
initialized = true;
@@ -250,12 +319,26 @@
* Returns the version number for this provider.
*
* @return the version number for this provider.
+ *
+ * @deprecated use {@link #getVersionStr} instead.
*/
+ @Deprecated(since="9")
public double getVersion() {
return version;
}
/**
+ * Returns the version string for this provider.
+ *
+ * @return the version string for this provider.
+ *
+ * @since 9
+ */
+ public String getVersionStr() {
+ return versionStr;
+ }
+
+ /**
* Returns a human-readable description of the provider and its
* services. This may return an HTML page, with relevant links.
*
@@ -266,14 +349,14 @@
}
/**
- * Returns a string with the name and the version number
+ * Returns a string with the name and the version string
* of this provider.
*
- * @return the string with the name and the version number
+ * @return the string with the name and the version string
* for this provider.
*/
public String toString() {
- return name + " version " + version;
+ return name + " version " + versionStr;
}
/*
@@ -787,11 +870,21 @@
private void putId() {
// note: name and info may be null
super.put("Provider.id name", String.valueOf(name));
- super.put("Provider.id version", String.valueOf(version));
+ super.put("Provider.id version", String.valueOf(versionStr));
super.put("Provider.id info", String.valueOf(info));
super.put("Provider.id className", this.getClass().getName());
}
+ /**
+ * Reads the {@code ObjectInputStream} for the default serializable fields.
+ * If the serialized field {@code versionStr} is found in the STREAM FIELDS,
+ * its String value will be used to populate both the version string and
+ * version number. If {@code versionStr} is not found, but {@code version}
+ * is, then its double value will be used to populate both fields.
+ *
+ * @param in the {@code ObjectInputStream} to read
+ * @serial
+ */
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
Map<Object,Object> copy = new HashMap<>();
@@ -800,6 +893,13 @@
}
defaults = null;
in.defaultReadObject();
+ if (this.versionStr == null) {
+ // set versionStr based on version when not found in serialized bytes
+ this.versionStr = Double.toString(this.version);
+ } else {
+ // otherwise, set version based on versionStr
+ this.version = parseVersionStr(this.versionStr);
+ }
implClear();
initialized = true;
putAll(copy);
@@ -1913,7 +2013,5 @@
return provider.getName() + ": " + type + "." + algorithm
+ " -> " + className + aString + attrs + "\r\n";
}
-
}
-
}
--- a/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java Fri Aug 19 06:27:54 2016 +0000
@@ -76,7 +76,7 @@
// dummy provider object to use during initialization
// used to avoid explicit null checks in various places
private static final Provider EMPTY_PROVIDER =
- new Provider("##Empty##", 1.0d, "initialization in progress") {
+ new Provider("##Empty##", "1.0", "initialization in progress") {
private static final long serialVersionUID = 1151354171352296389L;
// override getService() to return null slightly faster
public Service getService(String type, String algorithm) {
--- a/jdk/src/java.base/share/classes/sun/security/provider/MD4.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/MD4.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -28,6 +28,7 @@
import java.security.*;
import static sun.security.provider.ByteArrayAccess.*;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* The MD4 class is used to compute an MD4 message digest over a given
@@ -65,7 +66,8 @@
private static final Provider md4Provider;
static {
- md4Provider = new Provider("MD4Provider", 9.0d, "MD4 MessageDigest") {
+ md4Provider = new Provider("MD4Provider", PROVIDER_VER,
+ "MD4 MessageDigest") {
private static final long serialVersionUID = -8850464997518327965L;
};
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/src/java.base/share/classes/sun/security/provider/Sun.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/Sun.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, 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
@@ -29,6 +29,8 @@
import java.security.*;
import sun.security.action.PutAllAction;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
+
/**
* The SUN Security Provider.
@@ -47,7 +49,7 @@
public Sun() {
/* We are the SUN provider */
- super("SUN", 9.0d, INFO);
+ super("SUN", PROVIDER_VER, INFO);
// if there is no security manager installed, put directly into
// the provider. Otherwise, create a temporary map and use a
--- a/jdk/src/java.base/share/classes/sun/security/provider/VerificationProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/VerificationProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, 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
@@ -31,6 +31,8 @@
import sun.security.action.PutAllAction;
import sun.security.rsa.SunRsaSignEntries;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
+
/**
* Provider used for verification of signed JAR files *if* the Sun and
@@ -61,7 +63,7 @@
}
public VerificationProvider() {
- super("SunJarVerification", 9.0d, "Jar Verification Provider");
+ super("SunJarVerification", PROVIDER_VER, "Jar Verification Provider");
// register all algorithms normally registered by the Sun and SunRsaSign
// providers, but only if they are missing
if (ACTIVE == false) {
--- a/jdk/src/java.base/share/classes/sun/security/rsa/SunRsaSign.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/rsa/SunRsaSign.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -30,6 +30,7 @@
import java.security.*;
import sun.security.action.PutAllAction;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* Provider class for the RSA signature provider. Supports RSA keyfactory,
@@ -43,7 +44,7 @@
private static final long serialVersionUID = 866040293550393045L;
public SunRsaSign() {
- super("SunRsaSign", 9.0d, "Sun RSA signature provider");
+ super("SunRsaSign", PROVIDER_VER, "Sun RSA signature provider");
// if there is no security manager installed, put directly into
// the provider. Otherwise, create a temporary map and use a
--- a/jdk/src/java.base/share/classes/sun/security/ssl/JsseJce.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/JsseJce.java Fri Aug 19 06:27:54 2016 +0000
@@ -44,6 +44,7 @@
import sun.security.util.ECUtil;
import static sun.security.ssl.SunJSSE.cryptoProvider;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* This class contains a few static methods for interaction with the JCA/JCE
@@ -90,7 +91,7 @@
private static final long serialVersionUID = -3284138292032213752L;
SunCertificates(final Provider p) {
- super("SunCertificates", 9.0d, "SunJSSE internal");
+ super("SunCertificates", PROVIDER_VER, "SunJSSE internal");
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SunJSSE.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SunJSSE.java Fri Aug 19 06:27:54 2016 +0000
@@ -27,6 +27,7 @@
package sun.security.ssl;
import java.security.*;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* The JSSE provider.
@@ -104,7 +105,7 @@
// standard constructor
protected SunJSSE() {
- super("SunJSSE", 9.0d, info);
+ super("SunJSSE", PROVIDER_VER, info);
subclassCheck();
if (Boolean.TRUE.equals(fips)) {
throw new ProviderException
@@ -132,7 +133,7 @@
private SunJSSE(java.security.Provider cryptoProvider,
String providerName) {
- super("SunJSSE", 9.0d, fipsInfo + providerName + ")");
+ super("SunJSSE", PROVIDER_VER, fipsInfo + providerName + ")");
subclassCheck();
if (cryptoProvider == null) {
// Calling Security.getProvider() will cause other providers to be
--- a/jdk/src/java.base/share/classes/sun/security/util/SecurityConstants.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/util/SecurityConstants.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -33,6 +33,7 @@
import java.security.BasicPermission;
import java.security.SecurityPermission;
import java.security.AllPermission;
+import sun.security.action.GetPropertyAction;
/**
* Permission constants and string constants used to create permissions
@@ -145,4 +146,7 @@
// java.lang.SecurityManager
public static final SocketPermission LOCAL_LISTEN_PERMISSION =
new SocketPermission("localhost:0", SOCKET_LISTEN_ACTION);
+
+ public static final String PROVIDER_VER =
+ GetPropertyAction.privilegedGetProperty("java.specification.version");
}
--- a/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/JdkLDAP.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/JdkLDAP.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -29,6 +29,7 @@
import java.util.List;
import java.security.*;
import java.security.cert.CertStoreParameters;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* Provider class for the JdkLDAP provider.
@@ -69,7 +70,7 @@
}
public JdkLDAP() {
- super("JdkLDAP", 9.0d, "JdkLDAP Provider (implements LDAP CertStore)");
+ super("JdkLDAP", PROVIDER_VER, "JdkLDAP Provider (implements LDAP CertStore)");
final Provider p = this;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/SunProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/SunProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -33,6 +33,7 @@
import java.security.ProviderException;
import sun.security.jgss.krb5.Krb5MechFactory;
import sun.security.jgss.spnego.SpNegoMechFactory;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* Defines the Sun JGSS provider.
@@ -99,7 +100,7 @@
public SunProvider() {
/* We are the Sun JGSS provider */
- super("SunJGSS", 9.0d, INFO);
+ super("SunJGSS", PROVIDER_VER, INFO);
final Provider p = this;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -31,6 +31,7 @@
import java.security.PrivilegedAction;
import org.ietf.jgss.Oid;
import sun.security.action.PutAllAction;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* Defines the Sun NativeGSS provider for plugging in the
@@ -120,7 +121,7 @@
public SunNativeProvider() {
/* We are the Sun NativeGSS provider */
- super(NAME, 9.0d, INFO);
+ super(NAME, PROVIDER_VER, INFO);
if (MECH_MAP != null) {
AccessController.doPrivileged(new PutAllAction(this, MECH_MAP));
--- a/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/Provider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/Provider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -29,6 +29,7 @@
import java.security.NoSuchAlgorithmException;
import java.security.InvalidParameterException;
import java.security.ProviderException;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* The SASL provider.
@@ -98,7 +99,7 @@
}
public Provider() {
- super("SunSASL", 9.0d, info);
+ super("SunSASL", PROVIDER_VER, info);
final Provider p = this;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java Fri Aug 19 06:27:54 2016 +0000
@@ -134,7 +134,7 @@
private static final long serialVersionUID = 2745808869881593918L;
final static Provider INSTANCE = new NoneProvider();
private NoneProvider() {
- super("None", 1.0d, "none");
+ super("None", "1.0", "none");
}
}
--- a/jdk/src/java.smartcardio/share/classes/sun/security/smartcardio/SunPCSC.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.smartcardio/share/classes/sun/security/smartcardio/SunPCSC.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -28,6 +28,7 @@
import java.security.*;
import javax.smartcardio.*;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* Provider object for PC/SC.
@@ -65,7 +66,7 @@
}
public SunPCSC() {
- super("SunPCSC", 9.0d, "Sun PC/SC provider");
+ super("SunPCSC", PROVIDER_VER, "Sun PC/SC provider");
final Provider p = this;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java Fri Aug 19 06:27:54 2016 +0000
@@ -28,7 +28,7 @@
* ===========================================================================
*/
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
*/
/*
* $Id: XMLDSigRI.java 1400021 2012-10-19 10:16:04Z coheigea $
@@ -59,6 +59,13 @@
"C14N 1.0, C14N 1.1, Exclusive C14N, Base64, Enveloped, XPath, " +
"XPath2, XSLT TransformServices)";
+ private static final String VER =
+ AccessController.doPrivileged(new PrivilegedAction<>() {
+ public String run() {
+ return System.getProperty("java.specification.version");
+ }
+ });
+
private static final class ProviderService extends Provider.Service {
ProviderService(Provider p, String type, String algo, String cn) {
@@ -129,7 +136,7 @@
public XMLDSigRI() {
/* We are the XMLDSig provider */
- super("XMLDSig", 9.0d, INFO);
+ super("XMLDSig", VER, INFO);
final Provider p = this;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2016, 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
@@ -31,6 +31,7 @@
import sun.security.util.CurveDB;
import sun.security.util.NamedCurve;
import sun.security.util.ECParameters;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* Provider class for the Elliptic Curve provider.
@@ -142,7 +143,8 @@
}
public SunEC() {
- super("SunEC", 9.0d, "Sun Elliptic Curve provider (EC, ECDSA, ECDH)");
+ super("SunEC", PROVIDER_VER,
+ "Sun Elliptic Curve provider (EC, ECDSA, ECDH)");
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
putEntries(useFullImplementation);
--- a/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java Fri Aug 19 06:27:54 2016 +0000
@@ -33,6 +33,7 @@
import java.security.ProviderException;
import java.util.HashMap;
import java.util.Arrays;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
/**
* A Cryptographic Service Provider for the Microsoft Crypto API.
@@ -124,7 +125,7 @@
}
public SunMSCAPI() {
- super("SunMSCAPI", 9.0d, INFO);
+ super("SunMSCAPI", PROVIDER_VER, INFO);
final Provider p = this;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java Fri Aug 19 06:27:54 2016 +0000
@@ -44,6 +44,7 @@
import sun.security.util.Debug;
import sun.security.util.ResourcesMgr;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
import sun.security.pkcs11.Secmod.*;
@@ -89,7 +90,8 @@
}
public SunPKCS11() {
- super("SunPKCS11", 9.0d, "Unconfigured and unusable PKCS11 provider");
+ super("SunPKCS11", PROVIDER_VER,
+ "Unconfigured and unusable PKCS11 provider");
p11 = null;
config = null;
slotID = 0;
@@ -132,7 +134,7 @@
// Used by Secmod
SunPKCS11(Config c) {
- super("SunPKCS11-" + c.getName(), 9.0d, c.getDescription());
+ super("SunPKCS11-" + c.getName(), PROVIDER_VER, c.getDescription());
this.config = c;
if (debug != null) {
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -30,6 +30,8 @@
import java.lang.reflect.Constructor;
import java.util.*;
import java.security.*;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
+
/**
* OracleUcrypto provider main class.
@@ -196,7 +198,7 @@
}
public UcryptoProvider() {
- super("OracleUcrypto", 9.0d, "Provider using Oracle Ucrypto API");
+ super("OracleUcrypto", PROVIDER_VER, "Provider using Oracle Ucrypto API");
AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() {
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/JdkSASL.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/JdkSASL.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -30,6 +30,8 @@
import java.security.NoSuchAlgorithmException;
import java.security.InvalidParameterException;
import java.security.ProviderException;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
+
/**
* The JdkSASL provider class -
@@ -73,7 +75,7 @@
}
public JdkSASL() {
- super("JdkSASL", 9.0d, info);
+ super("JdkSASL", PROVIDER_VER, info);
final Provider p = this;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/jdk/test/com/sun/net/ssl/SSLSecurity/ProviderTest.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/com/sun/net/ssl/SSLSecurity/ProviderTest.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4667976
+ * @bug 4667976 8130181
* @modules java.base/com.sun.net.ssl
* @compile JavaxSSLContextImpl.java ComSSLContextImpl.java
* JavaxTrustManagerFactoryImpl.java ComTrustManagerFactoryImpl.java
@@ -85,7 +85,7 @@
public MyProvider()
{
- super("BRAD", 1.0, info);
+ super("BRAD", "1.0", info);
AccessController.doPrivileged(new java.security.PrivilegedAction() {
public Object run() {
--- a/jdk/test/java/security/KeyFactory/Failover.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/KeyFactory/Failover.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4894125 7054918
+ * @bug 4894125 7054918 8130181
* @library ../testlibrary
* @summary test that failover for KeyFactory works
* @author Andreas Sterbenz
@@ -96,14 +96,14 @@
private static class ProviderPass extends Provider {
ProviderPass() {
- super("Pass", 1.0d, "Pass");
+ super("Pass", "1.0", "Pass");
put("KeyFactory.FOO" , "Failover$KeyFactoryPass");
}
}
private static class ProviderFail extends Provider {
ProviderFail() {
- super("Fail", 1.0d, "Fail");
+ super("Fail", "1.0", "Fail");
put("KeyFactory.FOO" , "Failover$KeyFactoryFail");
put("KeyFactory.DSA" , "Failover$KeyFactoryFail");
}
--- a/jdk/test/java/security/KeyPairGenerator/Failover.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/KeyPairGenerator/Failover.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4894125 7054918
+ * @bug 4894125 7054918 8130181
* @library ../testlibrary
* @summary test that failover for KeyPairGenerator works
* @author Andreas Sterbenz
@@ -110,14 +110,14 @@
private static class ProviderPass extends Provider {
ProviderPass() {
- super("Pass", 1.0d, "Pass");
+ super("Pass", "1.0", "Pass");
put("KeyPairGenerator.FOO" , "Failover$KeyPairGeneratorPass");
}
}
private static class ProviderFail extends Provider {
ProviderFail() {
- super("Fail", 1.0d, "Fail");
+ super("Fail", "1.0", "Fail");
put("KeyPairGenerator.FOO" , "Failover$KeyPairGeneratorFail");
put("KeyPairGenerator.DSA" , "Failover$KeyPairGeneratorFail");
put("KeyPairGenerator.RSA" , "Failover$KeyPairGeneratorFail");
--- a/jdk/test/java/security/KeyStore/EntryMethods.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/KeyStore/EntryMethods.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test 1.5, 03/06/24
- * @bug 4850376 8130850
+ * @bug 4850376 8130850 8130181
* @summary Provide generic storage KeyStore storage facilities
*/
@@ -65,7 +65,7 @@
public static class FooEntry implements KeyStore.Entry { }
public EntryMethods() throws Exception {
- super("EntryMethods", 0.0, "EntryMethods");
+ super("EntryMethods", "0.0", "EntryMethods");
pre15fis = new FileInputStream
(System.getProperty("test.src") + "/EntryMethods.pre15.keystore");
--- a/jdk/test/java/security/KeyStore/KeyStoreBuilder.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/KeyStore/KeyStoreBuilder.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4938922 4961104 5071293 6236533
+ * @bug 4938922 4961104 5071293 6236533 8130181
* @summary verify that the KeyStore.Builder API works
* @author Andreas Sterbenz
*/
@@ -219,7 +219,7 @@
private static class MyProvider extends Provider {
MyProvider() {
- super("My", 1.0d, null);
+ super("My", "1.0", null);
put("KeyStore.My", "KeyStoreBuilder$MyKeyStoreSpi");
}
}
--- a/jdk/test/java/security/Policy/GetInstance/GetInstanceProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Policy/GetInstance/GetInstanceProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -27,7 +27,7 @@
public GetInstanceProvider() {
super("GetInstanceProvider",
- 1,
+ "1",
"GetInstanceProvider: Policy.GetInstancePolicySpi");
AccessController.doPrivileged(new PrivilegedAction() {
--- a/jdk/test/java/security/Provider/CaseSensitiveServices.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/CaseSensitiveServices.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 5097015
+ * @bug 5097015 8130181
* @summary make sure we correctly treat Provider string entries as case insensitive
* @author Andreas Sterbenz
*/
@@ -33,7 +33,7 @@
public class CaseSensitiveServices extends Provider {
CaseSensitiveServices() {
- super("Foo", 1.0d, null);
+ super("Foo", "1.0", null);
put("MessageDigest.Foo", "com.Foo");
put("mESSAGEdIGEST.fOO xYz", "aBc");
put("ALg.aliaS.MESSAGEdigest.Fu", "FoO");
--- a/jdk/test/java/security/Provider/ChangeProviders.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/ChangeProviders.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4856968 7054918
+ * @bug 4856968 7054918 8130181
* @library ../testlibrary
* @summary make sure add/insert/removeProvider() work correctly
* @author Andreas Sterbenz
@@ -36,7 +36,7 @@
public class ChangeProviders extends Provider {
private ChangeProviders() {
- super("Foo", 47.23d, "none");
+ super("Foo", "47.23", "none");
}
private static int plen() {
--- a/jdk/test/java/security/Provider/Equals.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/Equals.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4918769
+ * @bug 4918769 8130181
* @summary make sure Provider.equals() behaves as expected with the id attributes
* @author Andreas Sterbenz
*/
@@ -33,9 +33,9 @@
public class Equals {
public static void main(String[] args) throws Exception {
- Provider p1 = new P1("foo", 1.0d, "foo");
- Provider p1b = new P1("foo", 1.0d, "foo");
- Provider p2 = new P2("foo", 1.0d, "foo");
+ Provider p1 = new P1("foo", "1.0", "foo");
+ Provider p1b = new P1("foo", "1.0", "foo");
+ Provider p2 = new P2("foo", "1.0", "foo");
System.out.println(p1.entrySet());
if (p1.equals(p2)) {
throw new Exception("Objects are equal");
@@ -55,13 +55,13 @@
}
private static class P1 extends Provider {
- P1(String name, double version, String info) {
+ P1(String name, String version, String info) {
super(name, version, info);
}
}
private static class P2 extends Provider {
- P2(String name, double version, String info) {
+ P2(String name, String version, String info) {
super(name, version, info);
}
}
--- a/jdk/test/java/security/Provider/GetInstance.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/GetInstance.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4856968 7054918
+ * @bug 4856968 7054918 8130181
* @library ../testlibrary
* @summary make sure getInstance() works correctly, including failover
* and delayed provider selection for Signatures
@@ -137,7 +137,7 @@
public static class FooProvider extends Provider {
FooProvider() {
- super("foo", 1.0d, "none");
+ super("foo", "1.0", "none");
put("MessageDigest.foo", "GetInstance$FooDigest");
put("CertStore.foo", "GetInstance$FooStore");
put("Signature.foo", "GetInstance$FooSignatureSpi");
@@ -151,7 +151,7 @@
public static class BarProvider extends Provider {
BarProvider() {
- super("bar", 1.0d, "none");
+ super("bar", "1.0", "none");
// all entries invalid for failover
put("MessageDigest.bar", "GetInstance$FooKey");
put("Signature.bar", "GetInstance$FooKey");
@@ -164,7 +164,7 @@
public static class BazProvider extends Provider {
BazProvider() {
- super("baz", 1.0d, "none");
+ super("baz", "1.0", "none");
put("MessageDigest.bar", "GetInstance$FooDigest");
put("CertStore.bar", "GetInstance$FooStore");
put("Signature.bar", "GetInstance$FooSignatureSpi");
--- a/jdk/test/java/security/Provider/ProviderInfoCheck.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/ProviderInfoCheck.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6455351
+ * @bug 6455351 8130181
* @summary Make sure the Provider.info entries have the correct values
* after going through serialization/deserialization.
* @author Valerie Peng
@@ -68,18 +68,17 @@
if (!p.getClass().getName().equalsIgnoreCase(value)) {
throw new Exception("Test Failed: incorrect className!");
}
- double dvalue =
- Double.parseDouble((String) p.get("Provider.id version"));
- if ((SampleProvider.VERSION != dvalue) ||
- p.getVersion() != dvalue) {
- throw new Exception("Test Failed: incorrect version!");
+ value = (String) p.get("Provider.id version");
+ if (!SampleProvider.VERSION.equalsIgnoreCase(value) ||
+ p.getVersionStr() != value) {
+ throw new Exception("Test Failed: incorrect versionStr!");
}
System.out.println("Test Passed");
}
private static class SampleProvider extends Provider {
static String NAME = "Sample";
- static double VERSION = 1.1d;
+ static String VERSION = "1.1";
static String INFO = "Good for nothing";
SampleProvider() {
super(NAME, VERSION, INFO);
--- a/jdk/test/java/security/Provider/RemoveProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/RemoveProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4190873 7054918
+ * @bug 4190873 7054918 8130181
* @library ../testlibrary
* @summary Make sure provider instance can be removed from list of registered
* providers, and "entrySet", "keySet", and "values" methods don't loop
@@ -46,11 +46,11 @@
public static void main0(String[] args) throws Exception {
// Add provider 1
- Provider p1 = new MyProvider("name1",1,"");
+ Provider p1 = new MyProvider("name1","1","");
Security.addProvider(p1);
// Add provider 2
- Provider p2 = new MyProvider("name2",1,"");
+ Provider p2 = new MyProvider("name2","1","");
Security.addProvider(p2);
// List all providers
@@ -183,7 +183,7 @@
}
class MyProvider extends Provider {
- public MyProvider(String name, double version, String info) {
+ public MyProvider(String name, String version, String info) {
super(name, version, info);
put("Signature", name+".signature");
put("Digest", name+".digest");
--- a/jdk/test/java/security/Provider/SupportsParameter.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/SupportsParameter.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4911081
+ * @bug 4911081 8130181
* @summary verify that Provider.Service.supportsParameter() works
* @author Andreas Sterbenz
*/
@@ -104,7 +104,7 @@
private static class MyProvider extends Provider {
MyProvider() {
- super("MyProvider", 1.0d, "MyProvider");
+ super("MyProvider", "1.0", "MyProvider");
put("Signature.DSA0", "foo.DSA0");
--- a/jdk/test/java/security/Provider/TestSecurityProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/TestSecurityProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -30,7 +30,7 @@
public final class TestSecurityProvider extends Provider {
public TestSecurityProvider() {
- super("TEST", 1.0d, "Test Security provider");
+ super("TEST", "1.0", "Test Security provider");
System.out.println(String.format("TEST Security provider loaded"
+ " successfully : %s", this.toString()));
}
@@ -38,7 +38,7 @@
@Override
public String toString() {
return "TestSecurityProvider [getName()=" + getName()
- + ", getVersion()=" + getVersion() + ", getInfo()="
+ + ", getVersion()=" + getVersionStr() + ", getInfo()="
+ getInfo() + ", toString()=" + super.toString() + "]";
}
--- a/jdk/test/java/security/Provider/Turkish.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Provider/Turkish.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 6220064 7054918
+ * @bug 6220064 7054918 8130181
* @summary make sure everything works ok in the Turkish local (dotted/dotless i problem)
* @author Andreas Sterbenz
*/
@@ -107,7 +107,7 @@
private static class TProvider extends Provider {
TProvider(String name) {
- super(name, 1.0d, null);
+ super(name, "1.0", null);
put("Signature.MD5withRSA", "com.foo.Sig");
put("Alg.Alias.Signature.MD5RSA", "MD5withRSA");
put("sIGNATURE.shaWITHrsa", "com.foo.Sig");
--- a/jdk/test/java/security/SecureClassLoader/DefineClass.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/SecureClassLoader/DefineClass.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -54,7 +54,7 @@
/*
* @test
- * @bug 6826789 8131486
+ * @bug 6826789 8131486 8130181
* @summary Make sure equivalent ProtectionDomains are granted the same
* permissions when the CodeSource URLs are different but resolve
* to the same ip address after name service resolution.
@@ -194,7 +194,7 @@
private static class TestProvider extends Provider {
TestProvider() {
- super("Test8131486", 0.0, "For testing only");
+ super("Test8131486", "0.0", "For testing only");
putService(new Provider.Service(this, "KeyStore", "Test8131486",
"DefineClass$TestKeyStore", null, null));
}
--- a/jdk/test/java/security/Security/AddProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Security/AddProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8001319
+ * @bug 8001319 8130181
* @summary check that SecurityPermission insertProvider permission is enforced
* correctly
* @run main/othervm/policy=AddProvider.policy.1 AddProvider 1
@@ -53,7 +53,7 @@
private static class TestProvider extends Provider {
TestProvider(String name) {
- super(name, 0.0, "Not for use in production systems!");
+ super(name, "0.0", "Not for use in production systems!");
}
}
}
--- a/jdk/test/java/security/Security/ClassLoaderDeadlock/provider/HashProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/provider/HashProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, 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
@@ -27,7 +27,7 @@
public final class HashProvider extends Provider {
public HashProvider() {
- super("HashProvider", 1.0d, "");
+ super("HashProvider", "1.0", "");
// register all algorithms from the following providers into this provider
// the security framework will try to load them via the classloader of this provider
addAlgorithms("SunRsaSign");
--- a/jdk/test/java/security/Security/SynchronizedAccess.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Security/SynchronizedAccess.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4162583 7054918
+ * @bug 4162583 7054918 8130181
* @library ../testlibrary
* @summary Make sure Provider api implementations are synchronized properly
*/
@@ -61,7 +61,7 @@
public void run() {
Provider[] provs = new Provider[10];
for (int i=0; i < provs.length; i++)
- provs[i] = new MyProvider("name"+i, 1, "test");
+ provs[i] = new MyProvider("name"+i, "1", "test");
int rounds = 20;
while (rounds-- > 0) {
@@ -86,7 +86,7 @@
}
class MyProvider extends Provider {
- public MyProvider(String name, double version, String info) {
+ public MyProvider(String name, String version, String info) {
super(name, version, info);
put("Signature.sigalg", "sigimpl");
}
--- a/jdk/test/java/security/Security/removing/RemoveProviderByIdentity.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Security/removing/RemoveProviderByIdentity.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4208414
+ * @bug 4208414 8130181
* @summary Providers should be removed "by-identity" - not "by-value"
*/
@@ -34,7 +34,7 @@
public static void main(String[] args) throws Exception {
String PROVIDER_NAME = "myprovider";
- Security.addProvider(new MyProvider(PROVIDER_NAME, 1, "test"));
+ Security.addProvider(new MyProvider(PROVIDER_NAME, "1", "test"));
if (Security.getProvider(PROVIDER_NAME) == null)
throw new Exception("provider not registered");
@@ -45,7 +45,7 @@
}
class MyProvider extends Provider {
- public MyProvider(String name, double version, String info) {
+ public MyProvider(String name, String version, String info) {
super(name, version, info);
put("Signature.sigalg", "sigimpl");
}
--- a/jdk/test/java/security/Signature/SignatureGetAlgorithm.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/Signature/SignatureGetAlgorithm.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, 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
@@ -27,7 +27,7 @@
/*
* @test
- * @bug 8014620
+ * @bug 8014620 8130181
* @summary Signature.getAlgorithm return null in special case
* @run main/othervm SignatureGetAlgorithm
* @author youdwei
@@ -49,7 +49,7 @@
public static class TestProvider extends Provider {
TestProvider() {
- super("testSignatureGetAlgorithm", 1.0, "test Signatures");
+ super("testSignatureGetAlgorithm", "1.0", "test Signatures");
put("Signature.MySignatureAlg",
"SignatureGetAlgorithm$MySignatureAlg");
}
--- a/jdk/test/java/security/cert/CertPathBuilder/StubProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/java/security/cert/CertPathBuilder/StubProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, 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
@@ -23,14 +23,14 @@
/*
*
- * @bug 4408997
+ * @bug 4408997 8130181
* Used by GetInstance test.
*/
import java.security.Provider;
public class StubProvider extends Provider {
public StubProvider() {
- super( "StubProvider", 1.1, "No Info");
+ super( "StubProvider", "1.1", "No Info");
put("CertPathBuilder.PKIX", "StubProviderImpl");
}
}
--- a/jdk/test/javax/crypto/JceSecurity/MyProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/javax/crypto/JceSecurity/MyProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, 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
@@ -23,7 +23,7 @@
/*
* test
- * @bug 6377058
+ * @bug 6377058 8130181
* @summary SunJCE depends on sun.security.provider.SignatureImpl
* behaviour, BC can't load into 1st slot.
* @author Brad R. Wetmore
@@ -34,7 +34,7 @@
public class MyProvider extends Provider {
public MyProvider() {
- super("MyProvider", 1.0, "CertImpl");
+ super("MyProvider", "1.0", "CertImpl");
put("CertificateFactory.X.509", "MyCertificateFactory");
}
}
--- a/jdk/test/javax/crypto/SecretKeyFactory/Provider1.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/javax/crypto/SecretKeyFactory/Provider1.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, 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
@@ -23,7 +23,7 @@
/*
* test
- * @bug 6370923
+ * @bug 6370923 8130181
* @summary SecretKeyFactory failover does not work
* @author Brad R. Wetmore
*/
@@ -35,7 +35,7 @@
public class Provider1 extends Provider {
public Provider1() {
- super("Provider1", 1.0, "SecretKeyFactory");
+ super("Provider1", "1.0", "SecretKeyFactory");
System.out.println("Creating Provider1");
put("SecretKeyFactory.DUMMY", "com.p1.P1SecretKeyFactory");
}
--- a/jdk/test/javax/crypto/SecretKeyFactory/Provider2.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/javax/crypto/SecretKeyFactory/Provider2.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, 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
@@ -23,7 +23,7 @@
/*
* test
- * @bug 6370923
+ * @bug 6370923 8130181
* @summary SecretKeyFactory failover does not work
* @author Brad R. Wetmore
*/
@@ -35,7 +35,7 @@
public class Provider2 extends Provider {
public Provider2() {
- super("Provider2", 1.0, "SecretKeyFactory");
+ super("Provider2", "1.0", "SecretKeyFactory");
System.out.println("Creating Provider2");
put("SecretKeyFactory.DUMMY", "com.p2.P2SecretKeyFactory");
}
--- a/jdk/test/javax/net/ssl/sanity/pluggability/CheckSSLContextExport.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/javax/net/ssl/sanity/pluggability/CheckSSLContextExport.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4635454 6208022
+ * @bug 4635454 6208022 8130181
* @summary Check pluggability of SSLContext class.
*/
import java.security.*;
@@ -34,7 +34,7 @@
private static String info = "test provider for JSSE pluggability";
public CheckSSLContextExport(String protocols[]) {
- super("TestJSSEPluggability", 1.0, info);
+ super("TestJSSEPluggability", "1.0", info);
for (int i=0; i<protocols.length; i++) {
put("SSLContext." + protocols[i], "MySSLContextImpl");
}
--- a/jdk/test/javax/security/auth/login/Configuration/GetInstanceProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/javax/security/auth/login/Configuration/GetInstanceProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -27,7 +27,7 @@
public GetInstanceProvider() {
super("GetInstanceProvider",
- 1,
+ "1",
"GetInstanceProvider: Configuration.GetInstanceConfigSpi");
AccessController.doPrivileged(new PrivilegedAction() {
--- a/jdk/test/jdk/security/jarsigner/Function.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/jdk/security/jarsigner/Function.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8056174
+ * @bug 8056174 8130181
* @summary test the functions of JarSigner API
* @modules java.base/sun.security.tools.keytool
* jdk.jartool
@@ -145,7 +145,7 @@
public static class MyProvider extends Provider {
MyProvider() {
- super("MY", 1.0d, null);
+ super("MY", "1.0", null);
put("MessageDigest.Five", Five.class.getName());
put("Signature.SHA1WithRSA", SHA1WithRSA.class.getName());
}
--- a/jdk/test/sun/security/provider/SecureRandom/AbstractDrbg/SpecTest.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/sun/security/provider/SecureRandom/AbstractDrbg/SpecTest.java Fri Aug 19 06:27:54 2016 +0000
@@ -22,7 +22,7 @@
*/
/* @test
- * @bug 8051408 8157308
+ * @bug 8051408 8157308 8130181
* @modules java.base/sun.security.provider
* @build java.base/sun.security.provider.S
* @run main SpecTest
@@ -46,7 +46,7 @@
// getInstance from a provider.
- Provider p = new All("A", 0, "");
+ Provider p = new All("A", "0", "");
byte[] bytes = new byte[100];
// A non-DRBG
@@ -123,9 +123,9 @@
// getInstance from competitive providers.
- Provider l = new Legacy("L", 0, "");
- Provider w = new Weak("W", 0, "");
- Provider s = new Strong("S", 0, "");
+ Provider l = new Legacy("L", "0", "");
+ Provider w = new Weak("W", "0", "");
+ Provider s = new Strong("S", "0", "");
Security.addProvider(l);
Security.addProvider(w);
@@ -173,7 +173,7 @@
}
public static class All extends Provider {
- protected All(String name, double version, String info) {
+ protected All(String name, String version, String info) {
super(name, version, info);
put("SecureRandom.S1", S.S1.class.getName());
put("SecureRandom.S2", S.S2.class.getName());
@@ -183,21 +183,21 @@
// Providing S with no params support
public static class Legacy extends Provider {
- protected Legacy(String name, double version, String info) {
+ protected Legacy(String name, String version, String info) {
super(name, version, info);
put("SecureRandom.S", S.S1.class.getName());
}
}
public static class Weak extends Provider {
- protected Weak(String name, double version, String info) {
+ protected Weak(String name, String version, String info) {
super(name, version, info);
put("SecureRandom.S", S.S2.class.getName());
}
}
public static class Strong extends Provider {
- protected Strong(String name, double version, String info) {
+ protected Strong(String name, String version, String info) {
super(name, version, info);
put("SecureRandom.S", S.S3.class.getName());
}
--- a/jdk/test/sun/security/tools/jarsigner/alt/test.dummy/org/test/dummy/DummyProvider.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/sun/security/tools/jarsigner/alt/test.dummy/org/test/dummy/DummyProvider.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, 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
@@ -27,7 +27,7 @@
public class DummyProvider extends Provider {
public DummyProvider() {
- super("Dummy", 0.1, "Dummy Provider with nothing");
+ super("Dummy", "0.1", "Dummy Provider with nothing");
}
@Override
@@ -36,7 +36,7 @@
}
private DummyProvider(String arg) {
- super("Dummy", 0.2, "Dummy Provider with " + arg);
+ super("Dummy", "0.2", "Dummy Provider with " + arg);
//
// KeyStore
//
--- a/jdk/test/sun/security/x509/AlgorithmId/ExtensibleAlgorithmId.java Thu Aug 18 17:30:49 2016 -0700
+++ b/jdk/test/sun/security/x509/AlgorithmId/ExtensibleAlgorithmId.java Fri Aug 19 06:27:54 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4162868
+ * @bug 4162868 8130181
* @modules java.base/sun.security.x509
* @run main/othervm ExtensibleAlgorithmId
* @summary Algorithm Name-to-OID mapping needs to be made extensible.
@@ -51,7 +51,7 @@
class TestProvider extends Provider {
public TestProvider() {
- super("Dummy", 1.0, "XYZ algorithm");
+ super("Dummy", "1.0", "XYZ algorithm");
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {