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

Reviewed-by: rhalade, weijun
This commit is contained in:
Jamil Nimeh 2025-02-10 18:19:57 +00:00
parent 84b32cb61c
commit b737f7fb30
42 changed files with 120 additions and 123 deletions

View File

@ -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
@ -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
@ -34,6 +34,7 @@ import jdk.test.lib.Asserts;
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 {

View File

@ -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
@ -24,7 +24,7 @@
/**
* @test
* @bug 4894125 7054918 8130181
* @library ../testlibrary /test/lib
* @library /test/lib
* @summary test that failover for KeyFactory works
* @author Andreas Sterbenz
*/
@ -32,8 +32,8 @@
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 {

View File

@ -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
@ -24,7 +24,7 @@
/**
* @test
* @bug 4894125 7054918 8130181
* @library ../testlibrary
* @library /test/lib
* @summary test that failover for KeyPairGenerator works
* @author Andreas Sterbenz
*/
@ -32,8 +32,8 @@
import java.util.*;
import java.security.*;
import java.security.interfaces.*;
import java.security.spec.*;
import jdk.test.lib.security.ProvidersSnapshot;
public class Failover {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, 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
@ -24,14 +24,13 @@
/*
* @test
* @bug 4856968 7054918 8130181 8175874
* @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 {

View File

@ -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
@ -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
@ -34,6 +34,7 @@ import java.util.*;
import java.security.*;
import java.security.cert.*;
import jdk.test.lib.security.ProvidersSnapshot;
public class GetInstance {

View File

@ -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
@ -24,7 +24,6 @@
/*
* @test
* @bug 8231387
* @library ../testlibrary
* @summary make sure getService() avoids a race
* @author Tianmin Shi
*/

View File

@ -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
@ -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 {

View File

@ -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
@ -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 {

View File

@ -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
@ -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 {

View File

@ -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
@ -24,7 +24,7 @@
/**
* @test
* @bug 4963416 7054918
* @library ../../testlibrary
* @library /test/lib
* @summary make sure removeProvider() always works correctly
* @author Andreas Sterbenz
*/
@ -32,6 +32,7 @@
import java.util.*;
import java.security.*;
import jdk.test.lib.security.ProvidersSnapshot;
public class RemoveProviders {

View File

@ -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
@ -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
@ -64,7 +63,7 @@ import java.util.Objects;
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;

View File

@ -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
@ -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
@ -59,8 +58,8 @@ import java.util.*;
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.*;
@ -84,7 +83,7 @@ public class OCSPTimeout {
public static void main(String[] args) throws Exception {
int ocspTimeout = 15000;
boolean expected = false;
boolean expected;
createPKI();
@ -195,7 +194,6 @@ public class OCSPTimeout {
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

View File

@ -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
@ -26,7 +26,6 @@ import java.nio.file.Path;
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;
@ -54,7 +53,7 @@ import sun.security.x509.X500Name;
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
@ -65,8 +64,7 @@ import sun.security.testlibrary.CertificateBuilder;
* 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 {

View File

@ -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

View File

@ -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
@ -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;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 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
@ -24,7 +24,7 @@
/*
* @test
* @bug 6377058 7055362
* @library ../../../java/security/testlibrary
* @library /test/lib
* @summary SunJCE depends on sun.security.provider.SignatureImpl
* behaviour, BC can't load into 1st slot.
* @author Brad R. Wetmore
@ -33,7 +33,7 @@
import java.security.*;
import javax.crypto.*;
import java.io.*;
import jdk.test.lib.security.ProvidersSnapshot;
public class SunJCE_BC_LoadOrdering {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@ -28,8 +28,7 @@
* @test
* @bug 8046321 8153829
* @summary OCSP Stapling for TLS
* @library ../../../../java/security/testlibrary
* @build CertificateBuilder SimpleOCSPServer
* @library /test/lib
* @run main/othervm HttpsUrlConnClient RSA SHA256withRSA
* @run main/othervm HttpsUrlConnClient RSASSA-PSS RSASSA-PSS
*/
@ -59,8 +58,8 @@ import java.text.SimpleDateFormat;
import java.util.*;
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;
public class HttpsUrlConnClient {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@ -28,8 +28,7 @@
* @test
* @bug 8046321 8153829
* @summary OCSP Stapling for TLS
* @library ../../../../java/security/testlibrary
* @build CertificateBuilder SimpleOCSPServer
* @library /test/lib
* @run main/othervm SSLEngineWithStapling
*/
@ -87,8 +86,8 @@ import java.util.List;
import java.util.Map;
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;
public class SSLEngineWithStapling {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@ -28,8 +28,7 @@
* @test
* @bug 8046321 8153829
* @summary OCSP Stapling for TLS
* @library ../../../../java/security/testlibrary
* @build CertificateBuilder SimpleOCSPServer
* @library /test/lib
* @run main/othervm SSLSocketWithStapling
*/
@ -63,8 +62,8 @@ import java.util.Map;
import java.util.HashMap;
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;
public class SSLSocketWithStapling {

View File

@ -28,8 +28,7 @@
* @test
* @bug 8145854 8153829
* @summary SSLContextImpl.statusResponseManager should be generated if required
* @library ../../../../java/security/testlibrary
* @build CertificateBuilder SimpleOCSPServer
* @library /test/lib
* @run main/othervm StapleEnableProps
*/
@ -49,8 +48,8 @@ import java.util.Map;
import java.util.Objects;
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;
public class StapleEnableProps {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 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
@ -34,7 +34,6 @@
* @library ../pkcs11
* @library ../pkcs11/ec
* @library ../pkcs11/sslecc
* @library ../../../java/security/testlibrary
* @library ../../../javax/net/ssl/TLSCommon
* @modules jdk.crypto.cryptoki/sun.security.pkcs11.wrapper
* @run main/othervm -Djdk.tls.namedGroups="secp256r1" TestEC
@ -43,6 +42,7 @@
import java.security.NoSuchProviderException;
import java.security.Provider;
import java.security.Security;
import jdk.test.lib.security.ProvidersSnapshot;
/*
* Leverage the collection of EC tests used by PKCS11

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 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
@ -28,7 +28,6 @@
* and verify their signatures
* @author Andreas Sterbenz
* @library /test/lib ..
* @library ../../../../java/security/testlibrary
* @modules jdk.crypto.cryptoki
* @run main/othervm ReadCertificates
*/
@ -55,6 +54,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.security.auth.x500.X500Principal;
import jdk.test.lib.security.Providers;
public class ReadCertificates extends PKCS11Test {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 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
@ -27,7 +27,6 @@
* @summary Verify that we can parse ECPrivateKeys from PKCS#12 and use them
* @author Andreas Sterbenz
* @library /test/lib ..
* @library ../../../../java/security/testlibrary
* @key randomness
* @modules jdk.crypto.cryptoki java.base/sun.security.ec
* @run main/othervm ReadPKCS12
@ -54,6 +53,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import jdk.test.lib.security.Providers;
public class ReadPKCS12 extends PKCS11Test {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 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
@ -27,7 +27,6 @@
* @summary Basic known answer test for ECDH
* @author Andreas Sterbenz
* @library /test/lib ..
* @library ../../../../java/security/testlibrary
* @modules jdk.crypto.cryptoki
* @run main/othervm TestECDH
*/
@ -43,6 +42,8 @@ import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Arrays;
import javax.crypto.KeyAgreement;
import jdk.test.lib.security.Providers;
public class TestECDH extends PKCS11Test {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -27,7 +27,6 @@
* @summary basic test of ECDSA signatures for P-256 and P-384 from the
* example data in "Suite B Implementer's Guide to FIPS 186-3".
* @library /test/lib ..
* @library ../../../../java/security/testlibrary
* @modules java.base/sun.security.util
* jdk.crypto.cryptoki
* @compile -XDignore.symbol.file TestECDH2.java

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 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
@ -27,7 +27,6 @@
* @summary basic test of SHA1withECDSA and NONEwithECDSA signing/verifying
* @author Andreas Sterbenz
* @library /test/lib ..
* @library ../../../../java/security/testlibrary
* @key randomness
* @modules jdk.crypto.cryptoki
* @run main/othervm TestECDSA
@ -45,6 +44,7 @@ import java.security.interfaces.ECPublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Random;
import jdk.test.lib.security.Providers;
public class TestECDSA extends PKCS11Test {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -27,7 +27,6 @@
* @summary basic test of ECDSA signatures for P-256 and P-384 from the
* example data in "Suite B Implementer's Guide to FIPS 186-3".
* @library /test/lib ..
* @library ../../../../java/security/testlibrary
* @modules java.base/sun.security.util
* jdk.crypto.cryptoki
* @compile -XDignore.symbol.file TestECDSA2.java

View File

@ -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
@ -27,7 +27,6 @@
* @summary Test the new RSA provider can verify all the RSA certs in the cacerts file
* @author Andreas Sterbenz
* @library /test/lib ..
* @library ../../../../java/security/testlibrary
* @modules jdk.crypto.cryptoki
* @run main/othervm TestCACerts
*/
@ -42,6 +41,7 @@ import java.security.PublicKey;
import java.security.Security;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
import jdk.test.lib.security.Providers;
public class TestCACerts extends PKCS11Test {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -32,7 +32,6 @@
* @summary Verify that all ciphersuites work (incl. ECC using NSS crypto)
* @author Andreas Sterbenz
* @library /test/lib .. ../../../../javax/net/ssl/TLSCommon
* @library ../../../../java/security/testlibrary
* @modules jdk.crypto.cryptoki
* @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1"
* ClientJSSEServerJSSE
@ -40,6 +39,7 @@
import java.security.Provider;
import java.security.Security;
import jdk.test.lib.security.Providers;
public class ClientJSSEServerJSSE extends PKCS11Test {

View File

@ -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
@ -25,10 +25,9 @@
* @test
* @bug 8327461
* @summary engineGetEntry in PKCS12KeyStore should be thread-safe
* @library /test/lib ../../../java/security/testlibrary
* @library /test/lib
* @modules java.base/sun.security.x509
* java.base/sun.security.util
* @build CertificateBuilder
* @run main GetSetEntryTest
*/
@ -42,7 +41,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.TimeUnit;
import java.util.Date;
import sun.security.testlibrary.CertificateBuilder;
import jdk.test.lib.security.CertificateBuilder;
public class GetSetEntryTest {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, 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
@ -28,8 +28,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 OCSPNoContentLength
*/
@ -46,8 +45,8 @@ import java.util.*;
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;
public class OCSPNoContentLength {

View File

@ -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
@ -28,8 +28,7 @@
* @modules java.base/sun.security.provider.certpath:+open
* java.base/sun.security.x509
* java.base/sun.security.util
* @library /test/lib ../../../../../java/security/testlibrary
* @build CertificateBuilder
* @library /test/lib
* @run main Order
*/
@ -43,7 +42,7 @@ import javax.security.auth.x500.X500Principal;
import sun.security.x509.X509CertImpl;
import jdk.test.lib.Asserts;
import sun.security.testlibrary.CertificateBuilder;
import jdk.test.lib.security.CertificateBuilder;
public class Order {

View File

@ -23,10 +23,12 @@
/*
* @test
* @library /test/lib
* @build jdk.test.lib.security.SimpleOCSPServer
* jdk.test.lib.security.CertificateBuilder
* @bug 8046321 8339403
* @library ../../../../java/security/testlibrary
* @build CertificateBuilder SimpleOCSPServer
* @run main/othervm -Djavax.net.debug=ssl:respmgr java.base/sun.security.ssl.StatusResponseManagerTests
* @summary OCSP Stapling for TLS
* @run main/othervm -Djavax.net.debug=ssl:respmgr
* java.base/sun.security.ssl.StatusResponseManagerTests
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@ -34,8 +34,8 @@ import java.security.KeyStore;
import java.security.PublicKey;
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 sun.security.ssl.CertStatusExtension.*;

View File

@ -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
@ -23,7 +23,7 @@
/*
* @test
* @library /java/security/testlibrary
* @library /test/lib
* @bug 6251120 8231950 8242151
* @summary Testing keytool
*
@ -68,10 +68,10 @@ import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.security.cert.X509Certificate;
import jdk.test.lib.util.FileUtils;
import jdk.test.lib.security.HumanInputStream;
import jdk.test.lib.security.SecurityUtils;
import sun.security.util.ObjectIdentifier;
public class KeyToolTest {
// The stdout and stderr outputs after a keytool run

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 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
@ -29,7 +29,7 @@ import java.nio.file.Paths;
/*
* @test
* @summary It tests (almost) all keytool behaviors with NSS.
* @library /test/lib /test/jdk/sun/security/pkcs11 /java/security/testlibrary
* @library /test/lib /test/jdk/sun/security/pkcs11
* @modules java.base/sun.security.tools.keytool
* java.base/sun.security.util
* java.base/sun.security.x509

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, 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
@ -27,8 +27,7 @@
* @summary Enhance OCSP, CRL and Certificate Fetch Timeouts
* @modules java.base/sun.security.x509
* java.base/sun.security.util
* @library /test/lib ../../../../java/security/testlibrary
* @build CertificateBuilder
* @library /test/lib
* @run main/othervm -Dcom.sun.security.enableAIAcaIssuers=true
* -Dcom.sun.security.cert.readtimeout=1 AIACertTimeout 5000 false
* @run main/othervm -Dcom.sun.security.enableAIAcaIssuers=true
@ -55,10 +54,7 @@ import java.security.spec.*;
import java.util.*;
import java.util.concurrent.TimeUnit;
import sun.security.testlibrary.CertificateBuilder;
import sun.security.x509.*;
import sun.security.util.*;
import jdk.test.lib.security.CertificateBuilder;
public class AIACertTimeout {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@ -21,7 +21,7 @@
* questions.
*/
package sun.security.testlibrary;
package jdk.test.lib.security;
import java.io.*;
import java.util.*;

View File

@ -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
@ -21,6 +21,7 @@
* questions.
*/
package jdk.test.lib.security;
import java.io.BufferedReader;
import java.io.IOException;
@ -82,6 +83,7 @@ public class HumanInputStream extends InputStream {
}
return re;
}
@Override public int read(byte[] buffer, int offset, int len) {
inLine = true;
try {
@ -92,6 +94,7 @@ public class HumanInputStream extends InputStream {
inLine = false;
}
}
@Override public int available() {
if (pos < length) return 1;
return 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 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
@ -21,6 +21,8 @@
* questions.
*/
package jdk.test.lib.security;
import java.security.Provider;
import java.security.Security;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 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
@ -21,6 +21,8 @@
* questions.
*/
package jdk.test.lib.security;
import java.security.Provider;
import java.security.Security;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@ -21,7 +21,7 @@
* questions.
*/
package sun.security.testlibrary;
package jdk.test.lib.security;
import java.io.*;
import java.net.*;