From 0f9675b98ea2b32671b3dbd76bda3637b589bac3 Mon Sep 17 00:00:00 2001 From: Sergei Kovalev Date: Thu, 15 Sep 2016 13:03:03 +0300 Subject: [PATCH] 8165689: Fix module dependencies for sun/security/pkcs11/* tests Reviewed-by: mullan --- .../TestSHAwithECDSASignatureOids.java | 3 ++- jdk/test/sun/security/krb5/IPv6.java | 9 +++++-- .../security/pkcs11/Cipher/ReinitCipher.java | 3 ++- .../pkcs11/Cipher/TestPKCS5PaddingError.java | 3 ++- .../security/pkcs11/Cipher/TestRSACipher.java | 3 ++- .../pkcs11/Cipher/TestRSACipherWrap.java | 3 ++- .../pkcs11/Cipher/TestRawRSACipher.java | 3 ++- .../pkcs11/Cipher/TestSymmCiphers.java | 3 ++- .../pkcs11/Cipher/TestSymmCiphersNoPad.java | 3 ++- .../pkcs11/KeyAgreement/SupportedDHKeys.java | 14 ++++++----- .../security/pkcs11/KeyAgreement/TestDH.java | 3 ++- .../pkcs11/KeyAgreement/TestInterop.java | 3 ++- .../pkcs11/KeyAgreement/TestShort.java | 3 ++- .../KeyAgreement/UnsupportedDHKeys.java | 12 ++++----- .../pkcs11/KeyGenerator/DESParity.java | 3 ++- .../pkcs11/KeyGenerator/TestKeyGenerator.java | 3 ++- .../pkcs11/KeyPairGenerator/TestDH2048.java | 3 ++- jdk/test/sun/security/pkcs11/Mac/MacKAT.java | 20 ++++++++------- .../sun/security/pkcs11/Mac/MacSameTest.java | 22 ++++++++-------- .../sun/security/pkcs11/Mac/ReinitMac.java | 3 ++- .../pkcs11/MessageDigest/ByteBuffers.java | 3 ++- .../pkcs11/MessageDigest/DigestKAT.java | 3 ++- .../pkcs11/MessageDigest/ReinitDigest.java | 3 ++- .../pkcs11/MessageDigest/TestCloning.java | 3 ++- .../security/pkcs11/Provider/Absolute.java | 9 ++++--- jdk/test/sun/security/pkcs11/SampleTest.java | 12 +++------ .../security/pkcs11/Secmod/AddPrivateKey.java | 3 ++- .../pkcs11/Secmod/AddTrustedCert.java | 3 ++- .../sun/security/pkcs11/Secmod/Crypto.java | 3 ++- .../security/pkcs11/Secmod/GetPrivateKey.java | 3 ++- .../pkcs11/Secmod/JksSetPrivateKey.java | 3 ++- .../security/pkcs11/Secmod/LoadKeystore.java | 18 +++++++------ .../security/pkcs11/Secmod/TrustAnchors.java | 3 ++- .../security/pkcs11/SecureRandom/Basic.java | 3 ++- .../SecureRandom/TestDeserialization.java | 15 ++++++++--- .../pkcs11/Serialize/SerializeProvider.java | 16 +++++++----- .../pkcs11/Signature/ByteBuffers.java | 3 ++- .../pkcs11/Signature/ReinitSignature.java | 15 +++++++---- .../security/pkcs11/Signature/TestDSA.java | 3 ++- .../pkcs11/Signature/TestDSAKeyLength.java | 1 + .../pkcs11/Signature/TestRSAKeyLength.java | 3 ++- .../security/pkcs11/ec/ReadCertificates.java | 3 ++- .../sun/security/pkcs11/ec/ReadPKCS12.java | 3 ++- jdk/test/sun/security/pkcs11/ec/TestECDH.java | 3 ++- .../sun/security/pkcs11/ec/TestECDH2.java | 3 ++- .../sun/security/pkcs11/ec/TestECDSA.java | 3 ++- .../sun/security/pkcs11/ec/TestECDSA2.java | 3 ++- .../sun/security/pkcs11/ec/TestECGenSpec.java | 3 ++- .../security/pkcs11/ec/TestKeyFactory.java | 3 ++- jdk/test/sun/security/pkcs11/rsa/KeyWrap.java | 3 ++- .../sun/security/pkcs11/rsa/TestCACerts.java | 3 ++- .../security/pkcs11/rsa/TestKeyFactory.java | 3 ++- .../pkcs11/rsa/TestKeyPairGenerator.java | 3 ++- .../security/pkcs11/rsa/TestSignatures.java | 3 ++- .../pkcs11/sslecc/ClientJSSEServerJSSE.java | 1 + .../security/pkcs11/tls/TestKeyMaterial.java | 3 ++- .../pkcs11/tls/TestLeadingZeroesP11.java | 1 + .../security/pkcs11/tls/TestMasterSecret.java | 3 ++- jdk/test/sun/security/pkcs11/tls/TestPRF.java | 3 ++- .../security/pkcs11/tls/TestPremaster.java | 3 ++- .../keytool/DefaultSignatureAlgorithm.java | 1 + .../x509/URICertStore/ExtensionsWithLDAP.java | 16 ++++++------ .../x509/X509CertImpl/V3Certificate.java | 25 +++++++++++-------- 63 files changed, 213 insertions(+), 132 deletions(-) diff --git a/jdk/test/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java b/jdk/test/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java index 58a81065746..cca4e77befb 100644 --- a/jdk/test/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java +++ b/jdk/test/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java @@ -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 @@ -31,6 +31,7 @@ import java.util.List; * OID and algorithm transformation string should match. * Both could be able to be used to generate the algorithm instance. * @compile ../../TestSignatureOidHelper.java + * @modules jdk.crypto.ec * @run main TestSHAwithECDSASignatureOids */ public class TestSHAwithECDSASignatureOids { diff --git a/jdk/test/sun/security/krb5/IPv6.java b/jdk/test/sun/security/krb5/IPv6.java index 20085c0f9e0..5f541035528 100644 --- a/jdk/test/sun/security/krb5/IPv6.java +++ b/jdk/test/sun/security/krb5/IPv6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, 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 @@ -25,11 +25,16 @@ * @test * @bug 6877357 6885166 * @run main/othervm IPv6 + * @modules jdk.security.auth * @summary IPv6 address does not work */ import com.sun.security.auth.module.Krb5LoginModule; -import java.io.*; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.FileOutputStream; +import java.io.PrintStream; +import java.io.StringReader; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; diff --git a/jdk/test/sun/security/pkcs11/Cipher/ReinitCipher.java b/jdk/test/sun/security/pkcs11/Cipher/ReinitCipher.java index db7098e5fdf..72dbb728687 100644 --- a/jdk/test/sun/security/pkcs11/Cipher/ReinitCipher.java +++ b/jdk/test/sun/security/pkcs11/Cipher/ReinitCipher.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm ReinitCipher * @run main/othervm ReinitCipher sm */ diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java b/jdk/test/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java index 5fa94cbfc54..49880d3706e 100644 --- a/jdk/test/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java +++ b/jdk/test/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6687725 * @summary Test internal PKCS5Padding impl with various error conditions. * @author Valerie Peng * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestPKCS5PaddingError * @run main/othervm TestPKCS5PaddingError sm */ diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java index b9656a54086..160ce1cb5a1 100644 --- a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java +++ b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4898468 6994008 * @summary basic test for RSA cipher * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestRSACipher * @run main/othervm TestRSACipher sm */ diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java index 8637302b547..4e4fb600852 100644 --- a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java +++ b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6572331 6994008 * @summary basic test for RSA cipher key wrapping functionality * @author Valerie Peng * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestRSACipherWrap * @run main/othervm TestRSACipherWrap sm */ diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java b/jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java index cebe4224129..ed85f315a75 100644 --- a/jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java +++ b/jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6994008 * @summary basic test for RSA/ECB/NoPadding cipher * @author Valerie Peng * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestRawRSACipher * @run main/othervm TestRawRSACipher sm */ diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java index 018edc7417a..e94c61d2938 100644 --- a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java +++ b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4898461 6604496 * @summary basic test for symmetric ciphers with padding * @author Valerie Peng * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestSymmCiphers * @run main/othervm TestSymmCiphers sm */ diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java index 2359e77bf03..4fc7d7b9553 100644 --- a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java +++ b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4898484 6604496 8001284 * @summary basic test for symmetric ciphers with no padding * @author Valerie Peng * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestSymmCiphersNoPad * @run main/othervm TestSymmCiphersNoPad sm */ diff --git a/jdk/test/sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java b/jdk/test/sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java index 50154df7c77..52b69892dae 100644 --- a/jdk/test/sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java +++ b/jdk/test/sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java @@ -21,21 +21,23 @@ * questions. */ -/** +/* * @test * @bug 8072452 * @summary Support DHE sizes up to 8192-bits and DSA sizes up to 3072-bits * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm SupportedDHKeys * @run main/othervm SupportedDHKeys sm */ import java.math.BigInteger; - -import java.security.*; -import javax.crypto.*; -import javax.crypto.interfaces.*; -import javax.crypto.spec.*; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.Provider; +import javax.crypto.interfaces.DHPrivateKey; +import javax.crypto.interfaces.DHPublicKey; +import javax.crypto.spec.DHParameterSpec; public class SupportedDHKeys extends PKCS11Test { diff --git a/jdk/test/sun/security/pkcs11/KeyAgreement/TestDH.java b/jdk/test/sun/security/pkcs11/KeyAgreement/TestDH.java index 45e03897359..c43dc081878 100644 --- a/jdk/test/sun/security/pkcs11/KeyAgreement/TestDH.java +++ b/jdk/test/sun/security/pkcs11/KeyAgreement/TestDH.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 4921804 6324825 * @summary Verify that DH works properly * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestDH * @run main/othervm TestDH sm */ diff --git a/jdk/test/sun/security/pkcs11/KeyAgreement/TestInterop.java b/jdk/test/sun/security/pkcs11/KeyAgreement/TestInterop.java index 15a96b9b19e..4834b761f89 100644 --- a/jdk/test/sun/security/pkcs11/KeyAgreement/TestInterop.java +++ b/jdk/test/sun/security/pkcs11/KeyAgreement/TestInterop.java @@ -21,11 +21,12 @@ * questions. */ -/** +/* * @test * @bug 7146728 * @summary Interop test for DH with secret that has a leading 0x00 byte * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestInterop * @run main/othervm TestInterop sm */ diff --git a/jdk/test/sun/security/pkcs11/KeyAgreement/TestShort.java b/jdk/test/sun/security/pkcs11/KeyAgreement/TestShort.java index aec6c0c7c16..f082fee09ac 100644 --- a/jdk/test/sun/security/pkcs11/KeyAgreement/TestShort.java +++ b/jdk/test/sun/security/pkcs11/KeyAgreement/TestShort.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 4942494 7146728 * @summary KAT test for DH (normal and with secret that has leading a 0x00 byte) * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestShort * @run main/othervm TestShort sm */ diff --git a/jdk/test/sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java b/jdk/test/sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java index 0725171cb53..cdfa887de0a 100644 --- a/jdk/test/sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java +++ b/jdk/test/sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java @@ -21,21 +21,19 @@ * questions. */ -/** +/* * @test * @bug 8072452 * @summary Support DHE sizes up to 8192-bits and DSA sizes up to 3072-bits * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm UnsupportedDHKeys * @run main/othervm UnsupportedDHKeys sm */ -import java.math.BigInteger; - -import java.security.*; -import javax.crypto.*; -import javax.crypto.interfaces.*; -import javax.crypto.spec.*; +import java.security.InvalidParameterException; +import java.security.KeyPairGenerator; +import java.security.Provider; public class UnsupportedDHKeys extends PKCS11Test { diff --git a/jdk/test/sun/security/pkcs11/KeyGenerator/DESParity.java b/jdk/test/sun/security/pkcs11/KeyGenerator/DESParity.java index 3c8b3a52283..9e2b6da7b43 100644 --- a/jdk/test/sun/security/pkcs11/KeyGenerator/DESParity.java +++ b/jdk/test/sun/security/pkcs11/KeyGenerator/DESParity.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4898479 * @summary Verify that the parity bits are set correctly * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm DESParity * @run main/othervm DESParity sm */ diff --git a/jdk/test/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java b/jdk/test/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java index e0f669f58e3..f5297390348 100644 --- a/jdk/test/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java +++ b/jdk/test/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 4917233 6461727 6490213 6720456 * @summary test the KeyGenerator * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestKeyGenerator * @run main/othervm TestKeyGenerator sm */ diff --git a/jdk/test/sun/security/pkcs11/KeyPairGenerator/TestDH2048.java b/jdk/test/sun/security/pkcs11/KeyPairGenerator/TestDH2048.java index 4655678c31e..f5a0a105fe8 100644 --- a/jdk/test/sun/security/pkcs11/KeyPairGenerator/TestDH2048.java +++ b/jdk/test/sun/security/pkcs11/KeyPairGenerator/TestDH2048.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 7196382 8072452 * @summary Ensure that DH key pairs can be generated for 512 - 8192 bits * @author Valerie Peng * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestDH2048 * @run main/othervm TestDH2048 sm */ diff --git a/jdk/test/sun/security/pkcs11/Mac/MacKAT.java b/jdk/test/sun/security/pkcs11/Mac/MacKAT.java index d7679f91ffd..c068ac0e3c1 100644 --- a/jdk/test/sun/security/pkcs11/Mac/MacKAT.java +++ b/jdk/test/sun/security/pkcs11/Mac/MacKAT.java @@ -21,6 +21,17 @@ * questions. */ +/* + * @test + * @bug 4846410 6313661 4963723 + * @summary Basic known-answer-test for Hmac algorithms + * @author Andreas Sterbenz + * @library .. + * @modules jdk.crypto.pkcs11 + * @run main/othervm MacKAT + * @run main/othervm MacKAT sm + */ + import java.io.UnsupportedEncodingException; import java.security.Provider; import java.util.Arrays; @@ -30,15 +41,6 @@ import javax.crypto.Mac; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; -/** - * @test - * @bug 4846410 6313661 4963723 - * @summary Basic known-answer-test for Hmac algorithms - * @author Andreas Sterbenz - * @library .. - * @run main/othervm MacKAT - * @run main/othervm MacKAT sm - */ public class MacKAT extends PKCS11Test { private final static byte[] ALONG, BLONG, BKEY, BKEY_20, DDDATA_50, diff --git a/jdk/test/sun/security/pkcs11/Mac/MacSameTest.java b/jdk/test/sun/security/pkcs11/Mac/MacSameTest.java index 8d6689721fc..c1ee2ec4a67 100644 --- a/jdk/test/sun/security/pkcs11/Mac/MacSameTest.java +++ b/jdk/test/sun/security/pkcs11/Mac/MacSameTest.java @@ -21,6 +21,18 @@ * questions. */ +/* + * @test + * @bug 8048603 + * @summary Check if doFinal and update operation result in same Mac + * @author Yu-Ching Valerie Peng, Bill Situ, Alexander Fomin + * @library .. + * @modules jdk.crypto.pkcs11 + * @run main/othervm MacSameTest + * @run main/othervm MacSameTest sm + * @key randomness + */ + import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; @@ -30,16 +42,6 @@ import java.util.List; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; -/** - * @test - * @bug 8048603 - * @summary Check if doFinal and update operation result in same Mac - * @author Yu-Ching Valerie Peng, Bill Situ, Alexander Fomin - * @library .. - * @run main/othervm MacSameTest - * @run main/othervm MacSameTest sm - * @key randomness - */ public class MacSameTest extends PKCS11Test { private static final int MESSAGE_SIZE = 25; diff --git a/jdk/test/sun/security/pkcs11/Mac/ReinitMac.java b/jdk/test/sun/security/pkcs11/Mac/ReinitMac.java index 39970d8df00..97dcb7305b4 100644 --- a/jdk/test/sun/security/pkcs11/Mac/ReinitMac.java +++ b/jdk/test/sun/security/pkcs11/Mac/ReinitMac.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm ReinitMac * @run main/othervm ReinitMac sm */ diff --git a/jdk/test/sun/security/pkcs11/MessageDigest/ByteBuffers.java b/jdk/test/sun/security/pkcs11/MessageDigest/ByteBuffers.java index eca0485c8a9..64d7ff5ba65 100644 --- a/jdk/test/sun/security/pkcs11/MessageDigest/ByteBuffers.java +++ b/jdk/test/sun/security/pkcs11/MessageDigest/ByteBuffers.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary Test the MessageDigest.update(ByteBuffer) method * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm ByteBuffers * @run main/othervm ByteBuffers sm */ diff --git a/jdk/test/sun/security/pkcs11/MessageDigest/DigestKAT.java b/jdk/test/sun/security/pkcs11/MessageDigest/DigestKAT.java index 0f48f28c859..4a3b71f7deb 100644 --- a/jdk/test/sun/security/pkcs11/MessageDigest/DigestKAT.java +++ b/jdk/test/sun/security/pkcs11/MessageDigest/DigestKAT.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary Basic known-answer-test for all our MessageDigest algorithms * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm DigestKAT * @run main/othervm DigestKAT sm */ diff --git a/jdk/test/sun/security/pkcs11/MessageDigest/ReinitDigest.java b/jdk/test/sun/security/pkcs11/MessageDigest/ReinitDigest.java index 9d8250c9ab0..3414a579754 100644 --- a/jdk/test/sun/security/pkcs11/MessageDigest/ReinitDigest.java +++ b/jdk/test/sun/security/pkcs11/MessageDigest/ReinitDigest.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm ReinitDigest * @run main/othervm ReinitDigest sm */ diff --git a/jdk/test/sun/security/pkcs11/MessageDigest/TestCloning.java b/jdk/test/sun/security/pkcs11/MessageDigest/TestCloning.java index 0aca8fbf791..4bac0794227 100644 --- a/jdk/test/sun/security/pkcs11/MessageDigest/TestCloning.java +++ b/jdk/test/sun/security/pkcs11/MessageDigest/TestCloning.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6414899 * @summary Ensure the cloning functionality works. * @author Valerie Peng * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestCloning * @run main/othervm TestCloning sm */ diff --git a/jdk/test/sun/security/pkcs11/Provider/Absolute.java b/jdk/test/sun/security/pkcs11/Provider/Absolute.java index 85bbd216ba1..7906ac129c5 100644 --- a/jdk/test/sun/security/pkcs11/Provider/Absolute.java +++ b/jdk/test/sun/security/pkcs11/Provider/Absolute.java @@ -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 @@ -20,13 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/** +/* * @test * @bug 7003952 7191662 * @library .. + * @modules jdk.crypto.pkcs11 * @summary load DLLs and launch executables using fully qualified path */ -import java.security.*; + +import java.security.InvalidParameterException; +import java.security.Provider; public class Absolute { diff --git a/jdk/test/sun/security/pkcs11/SampleTest.java b/jdk/test/sun/security/pkcs11/SampleTest.java index 43cd13ae333..5d5c68414f0 100644 --- a/jdk/test/sun/security/pkcs11/SampleTest.java +++ b/jdk/test/sun/security/pkcs11/SampleTest.java @@ -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 @@ -21,20 +21,16 @@ * questions. */ -/** +/* * @test * @bug 4000000 * @summary XXX todo * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 */ -import java.io.*; -import java.util.*; - -import java.security.*; - -import javax.crypto.*; +import java.security.Provider; public class SampleTest extends PKCS11Test { diff --git a/jdk/test/sun/security/pkcs11/Secmod/AddPrivateKey.java b/jdk/test/sun/security/pkcs11/Secmod/AddPrivateKey.java index 67c691a3bc2..82fc4ab5f74 100644 --- a/jdk/test/sun/security/pkcs11/Secmod/AddPrivateKey.java +++ b/jdk/test/sun/security/pkcs11/Secmod/AddPrivateKey.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6414980 * @summary Test that the PKCS#11 KeyStore handles RSA, DSA, and EC keys * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm AddPrivateKey * @run main/othervm AddPrivateKey sm policy */ diff --git a/jdk/test/sun/security/pkcs11/Secmod/AddTrustedCert.java b/jdk/test/sun/security/pkcs11/Secmod/AddTrustedCert.java index 2eedf3cd506..1e085c33a24 100644 --- a/jdk/test/sun/security/pkcs11/Secmod/AddTrustedCert.java +++ b/jdk/test/sun/security/pkcs11/Secmod/AddTrustedCert.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6298106 * @summary make sure we can add a trusted cert to the NSS KeyStore module * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm AddTrustedCert * @run main/othervm AddTrustedCert sm policy */ diff --git a/jdk/test/sun/security/pkcs11/Secmod/Crypto.java b/jdk/test/sun/security/pkcs11/Secmod/Crypto.java index 2e571051cbd..b1b4372a49b 100644 --- a/jdk/test/sun/security/pkcs11/Secmod/Crypto.java +++ b/jdk/test/sun/security/pkcs11/Secmod/Crypto.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6329006 * @summary verify that NSS no-db mode works correctly * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm Crypto * @run main/othervm Crypto sm policy */ diff --git a/jdk/test/sun/security/pkcs11/Secmod/GetPrivateKey.java b/jdk/test/sun/security/pkcs11/Secmod/GetPrivateKey.java index b3170597b5d..9dd1fe0aaba 100644 --- a/jdk/test/sun/security/pkcs11/Secmod/GetPrivateKey.java +++ b/jdk/test/sun/security/pkcs11/Secmod/GetPrivateKey.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6273877 6322208 6275523 * @summary make sure we can access the NSS softtoken KeyStore * and use a private key * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm GetPrivateKey * @run main/othervm GetPrivateKey sm policy */ diff --git a/jdk/test/sun/security/pkcs11/Secmod/JksSetPrivateKey.java b/jdk/test/sun/security/pkcs11/Secmod/JksSetPrivateKey.java index 7613fce9ba5..360e5d1e684 100644 --- a/jdk/test/sun/security/pkcs11/Secmod/JksSetPrivateKey.java +++ b/jdk/test/sun/security/pkcs11/Secmod/JksSetPrivateKey.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6269847 * @summary store a NSS PKCS11 PrivateKeyEntry to JKS KeyStore throws confusing NPE * @author Wang Weijun * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm JksSetPrivateKey * @run main/othervm JksSetPrivateKey sm policy */ diff --git a/jdk/test/sun/security/pkcs11/Secmod/LoadKeystore.java b/jdk/test/sun/security/pkcs11/Secmod/LoadKeystore.java index c08fe8446aa..2e1d85ce58f 100644 --- a/jdk/test/sun/security/pkcs11/Secmod/LoadKeystore.java +++ b/jdk/test/sun/security/pkcs11/Secmod/LoadKeystore.java @@ -21,6 +21,16 @@ * questions. */ +/* + * @test + * @bug 8048622 8134232 + * @summary Checks that PKCS#11 keystore can't be loaded with wrong password + * @library ../ + * @modules jdk.crypto.pkcs11 + * @run main/othervm LoadKeystore + * @run main/othervm LoadKeystore sm policy + */ + import java.io.File; import java.io.IOException; import java.security.KeyStore; @@ -30,14 +40,6 @@ import java.security.Security; import java.security.UnrecoverableKeyException; import java.util.Collections; -/* - * @test - * @bug 8048622 8134232 - * @summary Checks that PKCS#11 keystore can't be loaded with wrong password - * @library ../ - * @run main/othervm LoadKeystore - * @run main/othervm LoadKeystore sm policy - */ public class LoadKeystore extends SecmodTest { public static void main(String[] args) throws Exception { diff --git a/jdk/test/sun/security/pkcs11/Secmod/TrustAnchors.java b/jdk/test/sun/security/pkcs11/Secmod/TrustAnchors.java index 277a51ec4c2..a26a5862d59 100644 --- a/jdk/test/sun/security/pkcs11/Secmod/TrustAnchors.java +++ b/jdk/test/sun/security/pkcs11/Secmod/TrustAnchors.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6298106 6275523 6420252 8059627 * @summary make sure we can access the NSS trust anchor module * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TrustAnchors * @run main/othervm TrustAnchors sm policy */ diff --git a/jdk/test/sun/security/pkcs11/SecureRandom/Basic.java b/jdk/test/sun/security/pkcs11/SecureRandom/Basic.java index 8c2c1686f73..3145431b867 100644 --- a/jdk/test/sun/security/pkcs11/SecureRandom/Basic.java +++ b/jdk/test/sun/security/pkcs11/SecureRandom/Basic.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6246411 * @summary basic test for PKCS#11 SecureRandom * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm Basic * @run main/othervm Basic sm */ diff --git a/jdk/test/sun/security/pkcs11/SecureRandom/TestDeserialization.java b/jdk/test/sun/security/pkcs11/SecureRandom/TestDeserialization.java index 117fb62d900..37985dd96e7 100644 --- a/jdk/test/sun/security/pkcs11/SecureRandom/TestDeserialization.java +++ b/jdk/test/sun/security/pkcs11/SecureRandom/TestDeserialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -21,15 +21,22 @@ * questions. */ -/** +/* * @test * @bug 6837847 * @summary Ensure a deserialized PKCS#11 SecureRandom is functional. * @library .. + * @modules jdk.crypto.pkcs11 */ -import java.security.*; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.security.SecureRandom; +import java.security.Security; public class TestDeserialization extends PKCS11Test { diff --git a/jdk/test/sun/security/pkcs11/Serialize/SerializeProvider.java b/jdk/test/sun/security/pkcs11/Serialize/SerializeProvider.java index 35f13bb16a0..a3deb72c974 100644 --- a/jdk/test/sun/security/pkcs11/Serialize/SerializeProvider.java +++ b/jdk/test/sun/security/pkcs11/Serialize/SerializeProvider.java @@ -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 @@ -21,18 +21,22 @@ * questions. */ -/** +/* * @test * @bug 4921802 * @summary Test that the SunPKCS11 provider can be serialized * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 */ -import java.io.*; -import java.util.*; - -import java.security.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.security.Provider; +import java.security.Security; public class SerializeProvider extends PKCS11Test { diff --git a/jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java b/jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java index 39e4424af35..3d1afa3bcb0 100644 --- a/jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java +++ b/jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary Test the Signature.update(ByteBuffer) method * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm ByteBuffers * @run main/othervm ByteBuffers sm */ diff --git a/jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java b/jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java index 0f51ffaa096..30f1d7f4f17 100644 --- a/jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java +++ b/jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java @@ -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 @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary test that reinitializing Signatures works correctly * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main ReinitSignature * @run main ReinitSignature * @run main ReinitSignature @@ -330,9 +331,13 @@ * @run main ReinitSignature */ -import java.util.*; - -import java.security.*; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.PrivateKey; +import java.security.Provider; +import java.security.PublicKey; +import java.security.Signature; +import java.util.Random; public class ReinitSignature extends PKCS11Test { diff --git a/jdk/test/sun/security/pkcs11/Signature/TestDSA.java b/jdk/test/sun/security/pkcs11/Signature/TestDSA.java index c4fcf5d5956..b707d98ee20 100644 --- a/jdk/test/sun/security/pkcs11/Signature/TestDSA.java +++ b/jdk/test/sun/security/pkcs11/Signature/TestDSA.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary basic test of SHA1withDSA and RawDSA signing/verifying * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestDSA * @run main/othervm TestDSA sm */ diff --git a/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java b/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java index f671bba3bd7..c1a0dc1bc57 100644 --- a/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java +++ b/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java @@ -28,6 +28,7 @@ * with unsupported key sizes * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestDSAKeyLength * @run main/othervm TestDSAKeyLength sm */ diff --git a/jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java b/jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java index 43341472e99..7618851bc2a 100644 --- a/jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java +++ b/jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test %W% %E% * @bug 6695485 * @summary Make sure initSign/initVerify() check RSA key lengths * @author Yu-Ching Valerie Peng * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestRSAKeyLength * @run main/othervm TestRSAKeyLength sm */ diff --git a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java index 4c0bbfba8f6..3117c983402 100644 --- a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java +++ b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 6405536 6414980 8051972 * @summary Make sure that we can parse certificates using various named curves @@ -29,6 +29,7 @@ * @author Andreas Sterbenz * @library .. * @library ../../../../java/security/testlibrary + * @modules jdk.crypto.pkcs11 * @run main/othervm ReadCertificates * @run main/othervm ReadCertificates sm policy */ diff --git a/jdk/test/sun/security/pkcs11/ec/ReadPKCS12.java b/jdk/test/sun/security/pkcs11/ec/ReadPKCS12.java index 3252b08d195..57af80441f8 100644 --- a/jdk/test/sun/security/pkcs11/ec/ReadPKCS12.java +++ b/jdk/test/sun/security/pkcs11/ec/ReadPKCS12.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 6405536 * @summary Verify that we can parse ECPrivateKeys from PKCS#12 and use them @@ -29,6 +29,7 @@ * @library .. * @library ../../../../java/security/testlibrary * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm ReadPKCS12 * @run main/othervm ReadPKCS12 sm policy */ diff --git a/jdk/test/sun/security/pkcs11/ec/TestECDH.java b/jdk/test/sun/security/pkcs11/ec/TestECDH.java index 421f46ccfc2..d5432b03968 100644 --- a/jdk/test/sun/security/pkcs11/ec/TestECDH.java +++ b/jdk/test/sun/security/pkcs11/ec/TestECDH.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6405536 * @summary Basic known answer test for ECDH * @author Andreas Sterbenz * @library .. * @library ../../../../java/security/testlibrary + * @modules jdk.crypto.pkcs11 * @run main/othervm TestECDH * @run main/othervm TestECDH sm policy */ diff --git a/jdk/test/sun/security/pkcs11/ec/TestECDH2.java b/jdk/test/sun/security/pkcs11/ec/TestECDH2.java index dee7a706ce7..d064e5263c3 100644 --- a/jdk/test/sun/security/pkcs11/ec/TestECDH2.java +++ b/jdk/test/sun/security/pkcs11/ec/TestECDH2.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 6405536 * @summary basic test of ECDSA signatures for P-256 and P-384 from the @@ -29,6 +29,7 @@ * @library .. * @library ../../../../java/security/testlibrary * @modules java.base/sun.security.util + * jdk.crypto.pkcs11 * @compile -XDignore.symbol.file TestECDH2.java * @run main/othervm TestECDH2 * @run main/othervm TestECDH2 sm diff --git a/jdk/test/sun/security/pkcs11/ec/TestECDSA.java b/jdk/test/sun/security/pkcs11/ec/TestECDSA.java index 9e0b8401aa9..fd5de680064 100644 --- a/jdk/test/sun/security/pkcs11/ec/TestECDSA.java +++ b/jdk/test/sun/security/pkcs11/ec/TestECDSA.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 6405536 8042967 * @summary basic test of SHA1withECDSA and NONEwithECDSA signing/verifying @@ -29,6 +29,7 @@ * @library .. * @library ../../../../java/security/testlibrary * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestECDSA * @run main/othervm TestECDSA sm policy */ diff --git a/jdk/test/sun/security/pkcs11/ec/TestECDSA2.java b/jdk/test/sun/security/pkcs11/ec/TestECDSA2.java index c2cd7188a03..fa0c5fc26b8 100644 --- a/jdk/test/sun/security/pkcs11/ec/TestECDSA2.java +++ b/jdk/test/sun/security/pkcs11/ec/TestECDSA2.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 6405536 * @summary basic test of ECDSA signatures for P-256 and P-384 from the @@ -29,6 +29,7 @@ * @library .. * @library ../../../../java/security/testlibrary * @modules java.base/sun.security.util + * jdk.crypto.pkcs11 * @compile -XDignore.symbol.file TestECDSA2.java * @run main/othervm TestECDSA2 * @run main/othervm TestECDSA2 sm diff --git a/jdk/test/sun/security/pkcs11/ec/TestECGenSpec.java b/jdk/test/sun/security/pkcs11/ec/TestECGenSpec.java index 829b44ee7d9..4ce105030da 100644 --- a/jdk/test/sun/security/pkcs11/ec/TestECGenSpec.java +++ b/jdk/test/sun/security/pkcs11/ec/TestECGenSpec.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6405536 * @summary Verify that we can use ECGenParameterSpec * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestECGenSpec * @run main/othervm TestECGenSpec sm */ diff --git a/jdk/test/sun/security/pkcs11/ec/TestKeyFactory.java b/jdk/test/sun/security/pkcs11/ec/TestKeyFactory.java index 519c861ce3d..827af91ed9e 100644 --- a/jdk/test/sun/security/pkcs11/ec/TestKeyFactory.java +++ b/jdk/test/sun/security/pkcs11/ec/TestKeyFactory.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 6405536 * @summary Test the P11ECKeyFactory * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestKeyFactory * @run main/othervm TestKeyFactory sm */ diff --git a/jdk/test/sun/security/pkcs11/rsa/KeyWrap.java b/jdk/test/sun/security/pkcs11/rsa/KeyWrap.java index e0bad7cd2d4..311a9b7f5aa 100644 --- a/jdk/test/sun/security/pkcs11/rsa/KeyWrap.java +++ b/jdk/test/sun/security/pkcs11/rsa/KeyWrap.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6231216 * @summary Verify key wrapping (of extractable keys) works for RSA/PKCS1 * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm KeyWrap * @run main/othervm KeyWrap sm */ diff --git a/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java b/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java index 24c16243585..a79330b8fcb 100644 --- a/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java +++ b/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary Test the new RSA provider can verify all the RSA certs in the cacerts file * @author Andreas Sterbenz * @library .. * @library ../../../../java/security/testlibrary + * @modules jdk.crypto.pkcs11 * @run main/othervm TestCACerts * @run main/othervm TestCACerts sm TestCACerts.policy */ diff --git a/jdk/test/sun/security/pkcs11/rsa/TestKeyFactory.java b/jdk/test/sun/security/pkcs11/rsa/TestKeyFactory.java index 802774285c3..d8292bcbad3 100644 --- a/jdk/test/sun/security/pkcs11/rsa/TestKeyFactory.java +++ b/jdk/test/sun/security/pkcs11/rsa/TestKeyFactory.java @@ -21,12 +21,13 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary Test KeyFactory of the new RSA provider * @author Andreas Sterbenz * @library .. + * @modules jdk.crypto.pkcs11 * @run main/othervm TestKeyFactory * @run main/othervm TestKeyFactory sm rsakeys.ks.policy */ diff --git a/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java b/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java index dd60d406fa6..84bbb60ab53 100644 --- a/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java +++ b/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary Verify that the RSA KeyPairGenerator works (use -Dseed=X to set PRNG seed) @@ -29,6 +29,7 @@ * @library .. * @library /lib/testlibrary * @build jdk.testlibrary.* + * @modules jdk.crypto.pkcs11 * @run main/othervm -Djava.security.debug=sunpkcs11 TestKeyPairGenerator * @run main/othervm -Djava.security.debug=sunpkcs11 TestKeyPairGenerator * sm TestKeyPairGenerator.policy diff --git a/jdk/test/sun/security/pkcs11/rsa/TestSignatures.java b/jdk/test/sun/security/pkcs11/rsa/TestSignatures.java index ae4718f4f56..84283b81ef8 100644 --- a/jdk/test/sun/security/pkcs11/rsa/TestSignatures.java +++ b/jdk/test/sun/security/pkcs11/rsa/TestSignatures.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 4856966 * @summary Test signing/verifying using all the signature algorithms * @author Andreas Sterbenz * @library .. * @key randomness + * @modules jdk.crypto.pkcs11 * @run main/othervm TestSignatures * @run main/othervm TestSignatures sm rsakeys.ks.policy */ diff --git a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java index 1fab350dc9d..11fcaacaf79 100644 --- a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java +++ b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java @@ -33,6 +33,7 @@ * @author Andreas Sterbenz * @library .. * @library ../../../../java/security/testlibrary + * @modules jdk.crypto.pkcs11 * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" * ClientJSSEServerJSSE * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" diff --git a/jdk/test/sun/security/pkcs11/tls/TestKeyMaterial.java b/jdk/test/sun/security/pkcs11/tls/TestKeyMaterial.java index 1511dff4d4b..27944e92f89 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestKeyMaterial.java +++ b/jdk/test/sun/security/pkcs11/tls/TestKeyMaterial.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6316539 * @summary Known-answer-test for TlsKeyMaterial generator * @author Andreas Sterbenz * @library .. * @modules java.base/sun.security.internal.spec + * jdk.crypto.pkcs11 * @run main/othervm TestKeyMaterial * @run main/othervm TestKeyMaterial sm policy */ diff --git a/jdk/test/sun/security/pkcs11/tls/TestLeadingZeroesP11.java b/jdk/test/sun/security/pkcs11/tls/TestLeadingZeroesP11.java index a8d8f72a299..2d9dc2890aa 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestLeadingZeroesP11.java +++ b/jdk/test/sun/security/pkcs11/tls/TestLeadingZeroesP11.java @@ -27,6 +27,7 @@ * @summary Need to strip leading zeros in TlsPremasterSecret of DHKeyAgreement * @library .. * @author Pasi Eronen + * @modules jdk.crypto.pkcs11 * @run main/othervm TestLeadingZeroesP11 * @run main/othervm TestLeadingZeroesP11 sm */ diff --git a/jdk/test/sun/security/pkcs11/tls/TestMasterSecret.java b/jdk/test/sun/security/pkcs11/tls/TestMasterSecret.java index 855b8c21f13..67ee6e708bd 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestMasterSecret.java +++ b/jdk/test/sun/security/pkcs11/tls/TestMasterSecret.java @@ -21,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 6316539 * @summary Known-answer-test for TlsMasterSecret generator @@ -29,6 +29,7 @@ * @library .. * @modules java.base/sun.security.internal.interfaces * java.base/sun.security.internal.spec + * jdk.crypto.pkcs11 * @run main/othervm TestMasterSecret * @run main/othervm TestMasterSecret sm TestMasterSecret.policy */ diff --git a/jdk/test/sun/security/pkcs11/tls/TestPRF.java b/jdk/test/sun/security/pkcs11/tls/TestPRF.java index 6e05ea64f90..47b49e9a634 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestPRF.java +++ b/jdk/test/sun/security/pkcs11/tls/TestPRF.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6316539 6345251 * @summary Basic known-answer-test for TlsPrf * @author Andreas Sterbenz * @library .. * @modules java.base/sun.security.internal.spec + * jdk.crypto.pkcs11 * @run main/othervm TestPRF * @run main/othervm TestPRF sm policy */ diff --git a/jdk/test/sun/security/pkcs11/tls/TestPremaster.java b/jdk/test/sun/security/pkcs11/tls/TestPremaster.java index bbbbf2c376d..a179bb81c2a 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestPremaster.java +++ b/jdk/test/sun/security/pkcs11/tls/TestPremaster.java @@ -21,13 +21,14 @@ * questions. */ -/** +/* * @test * @bug 6316539 * @summary Basic tests for TlsRsaPremasterSecret generator * @author Andreas Sterbenz * @library .. * @modules java.base/sun.security.internal.spec + * jdk.crypto.pkcs11 * @run main/othervm TestPremaster * @run main/othervm TestPremaster sm policy */ diff --git a/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java b/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java index 90cfad8898c..0c718db925e 100644 --- a/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java +++ b/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java @@ -26,6 +26,7 @@ * @bug 8138766 * @summary New default -sigalg for keytool * @modules java.base/sun.security.tools.keytool + * @modules jdk.crypto.ec * @run main/othervm DefaultSignatureAlgorithm RSA 1024 SHA256withRSA * @run main/othervm DefaultSignatureAlgorithm RSA 3072 SHA256withRSA * @run main/othervm DefaultSignatureAlgorithm RSA 3073 SHA384withRSA diff --git a/jdk/test/sun/security/x509/URICertStore/ExtensionsWithLDAP.java b/jdk/test/sun/security/x509/URICertStore/ExtensionsWithLDAP.java index 17e2e7caa53..0b5bdf7900a 100644 --- a/jdk/test/sun/security/x509/URICertStore/ExtensionsWithLDAP.java +++ b/jdk/test/sun/security/x509/URICertStore/ExtensionsWithLDAP.java @@ -23,6 +23,15 @@ * questions. */ +/* + * @test + * @bug 8134708 + * @summary Check if LDAP resources from CRLDP and AIA extensions can be loaded + * @run main/othervm ExtensionsWithLDAP CRLDP ldap.host.for.crldp + * @modules jdk.security.auth + * @run main/othervm ExtensionsWithLDAP AIA ldap.host.for.aia + */ + import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; @@ -45,13 +54,6 @@ import java.util.List; import java.util.Set; import java.util.function.Consumer; -/* - * @test - * @bug 8134708 - * @summary Check if LDAP resources from CRLDP and AIA extensions can be loaded - * @run main/othervm ExtensionsWithLDAP CRLDP ldap.host.for.crldp - * @run main/othervm ExtensionsWithLDAP AIA ldap.host.for.aia - */ public class ExtensionsWithLDAP { /* diff --git a/jdk/test/sun/security/x509/X509CertImpl/V3Certificate.java b/jdk/test/sun/security/x509/X509CertImpl/V3Certificate.java index 479cbc10621..6fde08c73c9 100644 --- a/jdk/test/sun/security/x509/X509CertImpl/V3Certificate.java +++ b/jdk/test/sun/security/x509/X509CertImpl/V3Certificate.java @@ -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 @@ -21,6 +21,17 @@ * questions. */ +/* + * @test + * @bug 8049237 + * @modules java.base/sun.security.x509 + * java.base/sun.security.util + * jdk.crypto.ec + * @summary This test generates V3 certificate with all the supported + * extensions. Writes back the generated certificate in to a file and checks for + * equality with the original certificate. + */ + import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -28,7 +39,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; -import static java.lang.System.out; import java.security.InvalidKeyException; import java.security.KeyPair; import java.security.KeyPairGenerator; @@ -50,15 +60,8 @@ import sun.security.util.BitArray; import sun.security.util.ObjectIdentifier; import sun.security.x509.*; -/** - * @test - * @bug 8049237 - * @modules java.base/sun.security.x509 - * java.base/sun.security.util - * @summary This test generates V3 certificate with all the supported - * extensions. Writes back the generated certificate in to a file and checks for - * equality with the original certificate. - */ +import static java.lang.System.out; + public class V3Certificate { public static final String V3_FILE = "certV3";