< prev index next >
test/jdk/sun/security/pkcs11/PKCS11Test.java
Print this page
rev 59383 : [mq]: final
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2020, 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.
@@ -137,23 +137,10 @@
}
}
pkcs11 = p;
}
- /*
- * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
- * when running SunPKCS11-Solaris (8044554)
- */
- static boolean isBadSolarisSparc(Provider p) {
- if ("SunPKCS11-Solaris".equals(p.getName()) && badSolarisSparc) {
- System.out.println("SunPKCS11-Solaris provider requires " +
- "Solaris SPARC 11.2 or later, skipping");
- return true;
- }
- return false;
- }
-
// Return a SunPKCS11 provider configured with the specified config file
static Provider getSunPKCS11(String config) throws Exception {
if (pkcs11 == null) {
throw new NoSuchProviderException("No PKCS11 provider available");
}
@@ -682,14 +669,10 @@
if (osMap != null) {
return osMap;
}
osMap = new HashMap<>();
- osMap.put("SunOS-sparc-32", new String[] { "/usr/lib/mps/" });
- osMap.put("SunOS-sparcv9-64", new String[] { "/usr/lib/mps/64/" });
- osMap.put("SunOS-x86-32", new String[] { "/usr/lib/mps/" });
- osMap.put("SunOS-amd64-64", new String[] { "/usr/lib/mps/64/" });
osMap.put("Linux-i386-32", new String[] {
"/usr/lib/i386-linux-gnu/",
"/usr/lib32/",
"/usr/lib/" });
osMap.put("Linux-amd64-64", new String[] {
@@ -745,18 +728,10 @@
return nssLibPaths.toArray(new String[nssLibPaths.size()]);
}
private final static char[] hexDigits = "0123456789abcdef".toCharArray();
- private static final String distro = distro();
-
- static final boolean badSolarisSparc =
- System.getProperty("os.name").equals("SunOS") &&
- System.getProperty("os.arch").equals("sparcv9") &&
- System.getProperty("os.version").compareTo("5.11") <= 0 &&
- getDistro().compareTo("11.2") < 0;
-
public static String toString(byte[] b) {
if (b == null) {
return "(null)";
}
StringBuilder sb = new StringBuilder(b.length * 3);
@@ -836,33 +811,10 @@
}
}
return algorithms;
}
- /**
- * Get the identifier for the operating system distribution
- */
- static String getDistro() {
- return distro;
- }
-
- private static String distro() {
- if (props.getProperty("os.name").equals("SunOS")) {
- try (BufferedReader in =
- new BufferedReader(new InputStreamReader(
- Runtime.getRuntime().exec("uname -v").getInputStream()))) {
-
- return in.readLine();
- } catch (Exception e) {
- throw new RuntimeException("Failed to determine distro.", e);
- }
- } else {
- // Not used outside Solaris
- return null;
- }
- }
-
static byte[] generateData(int length) {
byte data[] = new byte[length];
for (int i=0; i<data.length; i++) {
data[i] = (byte) (i % 256);
}
< prev index next >