-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P3
-
Affects Version/s: 26
-
Component/s: security-libs
-
None
-
Cause Known
If the jdk.crypto.disabledAlgorithms system or security property has multiple entries and at least one with known oid, the following exception is thrown when instantiating a crypto object (ex: Cipher) that checks if it is disabled:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/sun.security.util.CryptoAlgorithmConstraints.permits(CryptoAlgorithmConstraints.java:66)
at java.base/javax.crypto.Cipher.getInstance(Cipher.java:552)
at Test.main(Test.java:5)
Caused by: java.util.ConcurrentModificationException
at java.base/java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1522)
at java.base/java.util.TreeMap$KeyIterator.next(TreeMap.java:1576)
at java.base/sun.security.util.CryptoAlgorithmConstraints.<init>(CryptoAlgorithmConstraints.java:86)
at java.base/sun.security.util.CryptoAlgorithmConstraints$CryptoHolder.<clinit>(CryptoAlgorithmConstraints.java:55)
... 3 more
See attached test case, and run as:
java -Djdk.crypto.disabledAlgorithms="Cipher.RSA/ECB/PKCS1Padding, Cipher.DES" Test
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/sun.security.util.CryptoAlgorithmConstraints.permits(CryptoAlgorithmConstraints.java:66)
at java.base/javax.crypto.Cipher.getInstance(Cipher.java:552)
at Test.main(Test.java:5)
Caused by: java.util.ConcurrentModificationException
at java.base/java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1522)
at java.base/java.util.TreeMap$KeyIterator.next(TreeMap.java:1576)
at java.base/sun.security.util.CryptoAlgorithmConstraints.<init>(CryptoAlgorithmConstraints.java:86)
at java.base/sun.security.util.CryptoAlgorithmConstraints$CryptoHolder.<clinit>(CryptoAlgorithmConstraints.java:55)
... 3 more
See attached test case, and run as:
java -Djdk.crypto.disabledAlgorithms="Cipher.RSA/ECB/PKCS1Padding, Cipher.DES" Test
- relates to
-
JDK-8244336 Restrict algorithms at JCE layer
-
- Resolved
-
- links to
-
Review(master)
openjdk/jdk/29335