Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

6 changes: 1 addition & 5 deletions test/jdk/java/security/cert/CertPathBuilder/GetInstance.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2025, 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
Expand Down Expand Up @@ -30,11 +30,7 @@
* The test passes if it returns.
* The test fails if an exception is thrown.
*/
import java.security.cert.CertPathParameters;
import java.security.cert.CertPathBuilderResult;
import java.security.cert.CertPathBuilderSpi;
import java.security.Provider;
import java.security.AccessController;
import java.security.cert.CertPathBuilder;
import java.security.NoSuchAlgorithmException;

Expand Down
3 changes: 1 addition & 2 deletions test/jdk/sun/security/pkcs11/PKCS11Test.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
Expand Down Expand Up @@ -37,7 +37,6 @@
import java.security.InvalidAlgorithmParameterException;
import java.security.KeyPairGenerator;
import java.security.NoSuchProviderException;
import java.security.Policy;
import java.security.Provider;
import java.security.ProviderException;
import java.security.SecureRandom;
Expand Down
7 changes: 2 additions & 5 deletions test/jdk/sun/security/tools/jarsigner/CertChainUnclosed.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, 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
Expand Down Expand Up @@ -32,15 +32,12 @@

import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Locale;

public class CertChainUnclosed {

public static void main(String[] args) throws Exception {
String os = AccessController.doPrivileged(
(PrivilegedAction<String>)() -> System.getProperty("os.name"));
String os = System.getProperty("os.name");
if (!os.toUpperCase(Locale.US).contains("WINDOWS")) {
System.out.println("Not Windows. Skip test.");
return;
Expand Down
28 changes: 7 additions & 21 deletions test/jdk/sun/security/x509/AVA/AVAEqualsHashCode.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
Expand Down Expand Up @@ -49,9 +49,7 @@ public static void main(String[] args) throws Exception {
byte[] ba = deros.toByteArray();
DerValue dv = new DerValue(ba);

GetAVAConstructor a = new GetAVAConstructor();
java.security.AccessController.doPrivileged(a);
Constructor c = a.getCons();
Constructor c = getAVAConstructor();

Object[] objs = new Object[2];
objs[0] = oid;
Expand All @@ -72,16 +70,10 @@ public static void main(String[] args) throws Exception {
else
throw new Exception("FAILED equals()/hashCode() contract");
}
}

class GetAVAConstructor implements java.security.PrivilegedExceptionAction {

private Class avaClass = null;
private Constructor avaCons = null;

public Object run() throws Exception {
static Constructor getAVAConstructor() throws Exception {
try {
avaClass = Class.forName("sun.security.x509.AVA");
Class avaClass = Class.forName("sun.security.x509.AVA");
Constructor[] cons = avaClass.getDeclaredConstructors();

int i;
Expand All @@ -90,22 +82,16 @@ public Object run() throws Exception {
if (parms.length == 2) {
if (parms[0].getName().equalsIgnoreCase("sun.security.util.ObjectIdentifier") &&
parms[1].getName().equalsIgnoreCase("sun.security.util.DerValue")) {
avaCons = cons[i];
Constructor avaCons = cons[i];
avaCons.setAccessible(true);
break;
return avaCons;
}
}
}

return null;
} catch (Exception e) {
System.out.println("Caught unexpected exception " + e);
throw e;
}
return avaCons;
}

public Constructor getCons(){
return avaCons;
}

}
6 changes: 3 additions & 3 deletions test/lib/jdk/test/lib/net/SimpleSSLContext.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, 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
Expand Down Expand Up @@ -48,8 +48,7 @@ public SimpleSSLContext() throws IOException {
}

private SimpleSSLContext(Supplier<String> protocols) throws IOException {
final String proto = protocols.get();

String proto = protocols.get();
String paths = System.getProperty("test.src.path");
StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
while (st.hasMoreTokens()) {
Expand All @@ -58,6 +57,7 @@ private SimpleSSLContext(Supplier<String> protocols) throws IOException {
if (f.exists()) {
try (FileInputStream fis = new FileInputStream(f)) {
init(fis, proto);
break;
}
}
}
Expand Down