ConcurrentModificationException if jdk.crypto.disabledAlgorithms has multiple entries with known oid

XMLWordPrintable

        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

              Assignee:
              Valerie Peng
              Reporter:
              Sean Mullan
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: