Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8267837

JDK 7u/8u PKCS12KeyStore.parseAlgParameters exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • P3
    • None
    • 7u311, 8u301
    • security-libs

    Description

      In JDK-8267599, reverted only macAlgorithm. So still issue is reproducible. We should revert certProtectionAlgorithm also at least, I would suggest to revert keyProtectionAlgorithm along with it.

      Steps to reproduce the issue:
      Generate keystore with latest java - keytool -keystore testkeystore.p12 -genkeypair -keyalg EC -alias testcert -dname CN=testcert -storepass password -storetype pkcs12

      Run the attached program with old JDK(say April 2021 CPU)

      Exception:
      Exception in thread "main" java.io.IOException: parseAlgParameters failed: ObjectIdentifier() -- data isn't an object ID (tag = 48)
      at sun.security.pkcs12.PKCS12KeyStore.parseAlgParameters(PKCS12KeyStore.java:819)
      at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2027)
      at java.security.KeyStore.load(KeyStore.java:1445)
      at PKCS12.main(PKCS12.java:14)
      Caused by: java.io.IOException: ObjectIdentifier() -- data isn't an object ID (tag = 48)
      at sun.security.util.ObjectIdentifier.<init>(ObjectIdentifier.java:285)
      at sun.security.util.DerInputStream.getOID(DerInputStream.java:321)
      at com.sun.crypto.provider.PBES2Parameters.engineInit(PBES2Parameters.java:267)
      at java.security.AlgorithmParameters.init(AlgorithmParameters.java:293)
      at sun.security.pkcs12.PKCS12KeyStore.parseAlgParameters(PKCS12KeyStore.java:815)
      ... 3 more

      Attachments

        1. JKS.java
          0.7 kB
        2. PKCS12.java
          0.7 kB

        Issue Links

          Activity

            People

              coffeys Sean Coffey
              akolarkunnu Abdul Kolarkunnu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: