Skip to content

Commit c84000a

Browse files
committed
OpenJCEPlus KeyDestructionTest Toleration
OpenJCEPlus and OpenJCEPlusFIPS providers support key destruction for the key material being tested by KeyDestructionTest. The test is being adjusted accordingly. Signed-off-by: Jason Katonica <[email protected]>
1 parent b642b20 commit c84000a

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

test/jdk/ProblemList-FIPS140_3_OpenJCEPlusFIPS.FIPS140-3.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ javax/net/ssl/sanity/pluggability/CheckSSLContextExport.java https://github.com/
681681
javax/net/ssl/templates/SSLEngineTemplate.java https://github.com/eclipse-openj9/openj9/issues/20343 generic-all
682682
javax/net/ssl/templates/SSLSocketTemplate.java https://github.com/eclipse-openj9/openj9/issues/20343 generic-all
683683
javax/rmi/ssl/SocketFactoryTest.java https://github.com/eclipse-openj9/openj9/issues/20343 generic-all
684-
javax/security/auth/Destroyable/KeyDestructionTest.java https://github.com/eclipse-openj9/openj9/issues/20343 generic-all
685684
javax/security/auth/PrivateCredentialPermission/MoreThenOnePrincipals.java https://github.com/eclipse-openj9/openj9/issues/20343 generic-all
686685
javax/security/auth/Subject/SubjectNullTests.java https://github.com/eclipse-openj9/openj9/issues/20343 generic-all
687686
javax/security/auth/login/Configuration/GetInstance.java https://github.com/eclipse-openj9/openj9/issues/20343 generic-all

test/jdk/ProblemList-FIPS140_3_OpenJcePlus.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ javax/net/ssl/templates/SSLEngineTemplate.java https://github.com/eclipse-openj9
629629
javax/net/ssl/templates/SSLSocketTemplate.java https://github.com/eclipse-openj9/openj9/issues/20978 generic-all
630630
javax/rmi/ssl/SSLSocketParametersTest.java https://github.com/eclipse-openj9/openj9/issues/20978 generic-all
631631
javax/rmi/ssl/SocketFactoryTest.java https://github.com/eclipse-openj9/openj9/issues/20978 generic-all
632-
javax/security/auth/Destroyable/KeyDestructionTest.java https://github.com/eclipse-openj9/openj9/issues/20978 generic-all
633632
javax/security/auth/PrivateCredentialPermission/MoreThenOnePrincipals.java https://github.com/eclipse-openj9/openj9/issues/20978 generic-all
634633
javax/security/auth/login/Configuration/GetInstance.java https://github.com/eclipse-openj9/openj9/issues/20978 generic-all
635634
javax/security/sasl/Sasl/ClientServerTest.java https://github.com/eclipse-openj9/openj9/issues/20978 generic-all

test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
* questions.
2222
*/
2323

24+
/*
25+
* ===========================================================================
26+
* (c) Copyright IBM Corp. 2025, 2025 All Rights Reserved
27+
* ===========================================================================
28+
*/
29+
2430
/*
2531
* @test
2632
* @bug 6263419
@@ -44,9 +50,21 @@ public static void main(String[] args) throws Exception {
4450
testKeyDestruction(new MyDestroyableSecretKey());
4551
testKeyDestruction(new MyDestroyablePrivateKey());
4652

47-
// Check keys that support but have not implemented key destruction
48-
testNoKeyDestruction(generateSecretKey("AES", 128));
49-
testNoKeyDestruction(keypair.getPrivate());
53+
// AES key implementations, from providers OpenJCEPlus and OpenJCEPlusFIPS,
54+
// do implement destroyable for AES keys, other providers do not.
55+
if (KeyGenerator.getInstance("AES").getProvider().getName().startsWith("OpenJCEPlus")) {
56+
testKeyDestruction(generateSecretKey("AES", 128));
57+
} else {
58+
testNoKeyDestruction(generateSecretKey("AES", 128));
59+
}
60+
61+
// RSA key implementations, from providers OpenJCEPlus and OpenJCEPlusFIPS,
62+
// do implement destroyable for RSA keys, other providers do not.
63+
if (KeyPairGenerator.getInstance(kpgAlgorithm).getProvider().getName().startsWith("OpenJCEPlus")) {
64+
testKeyDestruction(keypair.getPrivate());
65+
} else {
66+
testNoKeyDestruction(keypair.getPrivate());
67+
}
5068

5169
// Check keys that do not support key destruction
5270
try {

0 commit comments

Comments
 (0)