Skip to content

8349501: Relocate supporting classes in security/testlibrary to test/lib/jdk tree #1721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
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
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 All @@ -23,7 +23,7 @@

/*
* @test
* @library /test/lib /java/security/testlibrary
* @library /test/lib
* @bug 4470717
* @summary fix default handling and other misc
* @run main/othervm Default
Expand All @@ -34,6 +34,7 @@

import javax.security.auth.callback.*;
import java.io.*;
import jdk.test.lib.security.HumanInputStream;

public class Default {
public static void main(String args[]) throws Exception {
Expand Down
6 changes: 3 additions & 3 deletions test/jdk/java/security/KeyFactory/Failover.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 All @@ -24,16 +24,16 @@
/**
* @test
* @bug 4894125 7054918 8130181
* @library ../testlibrary /test/lib
* @library /test/lib
* @summary test that failover for KeyFactory works
* @author Andreas Sterbenz
*/

import java.util.*;

import java.security.*;
import java.security.interfaces.*;
import java.security.spec.*;
import jdk.test.lib.security.ProvidersSnapshot;
import jdk.test.lib.security.SecurityUtils;

public class Failover {
Expand Down
6 changes: 3 additions & 3 deletions test/jdk/java/security/KeyPairGenerator/Failover.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2016, 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 All @@ -24,16 +24,16 @@
/**
* @test
* @bug 4894125 7054918 8130181
* @library ../testlibrary
* @library /test/lib
* @summary test that failover for KeyPairGenerator works
* @author Andreas Sterbenz
*/

import java.util.*;

import java.security.*;
import java.security.interfaces.*;
import java.security.spec.*;
import jdk.test.lib.security.ProvidersSnapshot;

public class Failover {

Expand Down
7 changes: 3 additions & 4 deletions test/jdk/java/security/Provider/ChangeProviders.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2016, 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 All @@ -24,14 +24,13 @@
/*
* @test
* @bug 4856968 7054918 8130181
* @library ../testlibrary
* @library /test/lib
* @summary make sure add/insert/removeProvider() work correctly
* @author Andreas Sterbenz
*/

import java.util.*;

import java.security.*;
import jdk.test.lib.security.ProvidersSnapshot;

public class ChangeProviders extends Provider {

Expand Down
5 changes: 3 additions & 2 deletions test/jdk/java/security/Provider/GetInstance.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2016, 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 All @@ -24,7 +24,7 @@
/*
* @test
* @bug 4856968 7054918 8130181
* @library ../testlibrary
* @library /test/lib
* @summary make sure getInstance() works correctly, including failover
* and delayed provider selection for Signatures
* @author Andreas Sterbenz
Expand All @@ -34,6 +34,7 @@

import java.security.*;
import java.security.cert.*;
import jdk.test.lib.security.ProvidersSnapshot;

public class GetInstance {

Expand Down
3 changes: 1 addition & 2 deletions test/jdk/java/security/Provider/GetServiceRace.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 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 All @@ -24,7 +24,6 @@
/*
* @test
* @bug 8231387
* @library ../testlibrary
* @summary make sure getService() avoids a race
* @author Tianmin Shi
*/
Expand Down
5 changes: 3 additions & 2 deletions test/jdk/java/security/Provider/RemoveProvider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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 All @@ -24,13 +24,14 @@
/*
* @test
* @bug 4190873 7054918 8130181
* @library ../testlibrary
* @library /test/lib
* @summary Make sure provider instance can be removed from list of registered
* providers, and "entrySet", "keySet", and "values" methods don't loop
* indefinitely.
*/
import java.security.*;
import java.util.*;
import jdk.test.lib.security.ProvidersSnapshot;

public class RemoveProvider {

Expand Down
5 changes: 3 additions & 2 deletions test/jdk/java/security/Security/NoInstalledProviders.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, 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 All @@ -24,12 +24,13 @@
/*
* @test
* @bug 4273454 7054918 7052537
* @library ../testlibrary
* @library /test/lib
* @summary Make sure getProviders(filter) doesn't throw NPE
* @run main/othervm NoInstalledProviders
*/

import java.security.*;
import jdk.test.lib.security.ProvidersSnapshot;

public class NoInstalledProviders {

Expand Down
5 changes: 3 additions & 2 deletions test/jdk/java/security/Security/SynchronizedAccess.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 All @@ -24,13 +24,14 @@
/*
* @test
* @bug 4162583 7054918 8130181 8028127
* @library /test/lib ../testlibrary
* @library /test/lib
* @summary Make sure Provider api implementations are synchronized properly
*/

import java.security.*;

import jdk.test.lib.Asserts;
import jdk.test.lib.security.ProvidersSnapshot;

public class SynchronizedAccess {

Expand Down
5 changes: 3 additions & 2 deletions test/jdk/java/security/Security/removing/RemoveProviders.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2011, 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 All @@ -24,14 +24,15 @@
/**
* @test
* @bug 4963416 7054918
* @library ../../testlibrary
* @library /test/lib
* @summary make sure removeProvider() always works correctly
* @author Andreas Sterbenz
*/

import java.util.*;

import java.security.*;
import jdk.test.lib.security.ProvidersSnapshot;

public class RemoveProviders {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 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 All @@ -25,8 +25,7 @@
* @test
* @bug 8179503 8328638
* @summary Java should support GET OCSP calls
* @library /javax/net/ssl/templates /java/security/testlibrary
* @build SimpleOCSPServer
* @library /javax/net/ssl/templates /test/lib
* @modules java.base/sun.security.util
* java.base/sun.security.provider.certpath
* java.base/sun.security.x509
Expand Down Expand Up @@ -64,7 +63,7 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;

import sun.security.testlibrary.SimpleOCSPServer;
import jdk.test.lib.security.SimpleOCSPServer;
import sun.security.util.DerOutputStream;
import sun.security.util.DerValue;
import sun.security.util.ObjectIdentifier;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 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 @@ -34,8 +34,7 @@
* @modules java.base/sun.security.x509
* java.base/sun.security.provider.certpath
* java.base/sun.security.util
* @library ../../../../../java/security/testlibrary
* @build CertificateBuilder SimpleOCSPServer
* @library /test/lib
* @run main/othervm -Djava.security.debug=certpath OCSPTimeout 1000 true
* @run main/othervm -Djava.security.debug=certpath
* -Dcom.sun.security.ocsp.readtimeout=5 OCSPTimeout 1000 true
Expand All @@ -59,8 +58,8 @@
import java.security.cert.*;
import java.util.concurrent.TimeUnit;

import sun.security.testlibrary.SimpleOCSPServer;
import sun.security.testlibrary.CertificateBuilder;
import jdk.test.lib.security.SimpleOCSPServer;
import jdk.test.lib.security.CertificateBuilder;

import static java.security.cert.PKIXRevocationChecker.Option.*;

Expand All @@ -84,7 +83,7 @@ public class OCSPTimeout {

public static void main(String[] args) throws Exception {
int ocspTimeout = 15000;
boolean expected = false;
boolean expected;

createPKI();

Expand Down Expand Up @@ -195,7 +194,6 @@ private static void createPKI() throws Exception {
rootOcsp = new SimpleOCSPServer(rootKeystore, passwd, ROOT_ALIAS, null);
rootOcsp.enableLog(debug);
rootOcsp.setNextUpdateInterval(3600);
rootOcsp.setDisableContentLength(true);
rootOcsp.start();

// Wait 60 seconds for server ready
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 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 All @@ -26,7 +26,6 @@
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PublicKey;
import java.security.cert.CertificateFactory;
import java.security.cert.CertPath;
import java.security.cert.CertPathValidator;
Expand Down Expand Up @@ -54,7 +53,7 @@
import sun.security.x509.X509CRLEntryImpl;
import sun.security.x509.X509CRLImpl;
import static sun.security.x509.X509CRLImpl.TBSCertList;
import sun.security.testlibrary.CertificateBuilder;
import jdk.test.lib.security.CertificateBuilder;

/*
* @test
Expand All @@ -65,8 +64,7 @@
* fresh or stale.
* @modules java.base/sun.security.x509
* java.base/sun.security.util
* @library ../../../../../java/security/testlibrary
* @build CertificateBuilder CheckAllCRLs
* @library /test/lib
* @run main/othervm -Dcom.sun.security.enableCRLDP=true CheckAllCRLs
*/
public class CheckAllCRLs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public class ValWithAnchorByName {

// The following certificates and OCSP responses were captured from
// a test run that used certificates and responses generated by
// sun.security.testlibrary.CertificateBuilder and
// sun.security.testlibrary.SimpleOCSPServer.
// jdk.test.lib.security.CertificateBuilder and
// jdk.test.lib.security.SimpleOCSPServer.

// Subject: CN=SSLCertificate, O=SomeCompany
// Issuer: CN=Intermediate CA Cert, O=SomeCompany
Expand Down
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 All @@ -24,19 +24,20 @@
/**
* @test
* @bug 4508341 7055362
* @library ../../../java/security/testlibrary
* @library /test/lib
* @summary Test the error conditions of
* EncryptedPrivateKeyInfo.getKeySpec(...) methods.
* @author Valerie Peng
* @run main/othervm -DcipherAlg=PBEWithMD5AndDES GetKeySpecException
* @run main/othervm -DcipherAlg=PBEWithSHA1AndDESede GetKeySpecException
*/

import java.security.*;
import java.util.Arrays;
import java.util.Vector;
import java.security.spec.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import jdk.test.lib.security.ProvidersSnapshot;

public class GetKeySpecException {
private static String cipherAlg;
Expand Down
Loading