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

sun/security/pkcs11/Secmod/AddTrustedCert.java failed with Linux built-in NSS libs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • tbd
    • 11, 14, 17, 21
    • security-libs

    Description

      $ cat /etc/oracle-release
      Oracle Linux Server release 7.6

      java version "14-ea" 2020-03-17
      Java(TM) SE Runtime Environment (build 14-ea+18-773)

      After JDK-8180837, test sun/security/pkcs11/Secmod/AddTrustedCert.java is skipped for defined NSS version:
      --> "Skip test due to improper NSS version in [3.28, 3.35). "

      But this test failed with the default NSS version 3.36, which is not in the skipped version list, on Oracle Linux 7.6

      ----------System.out:(86/3621)*----------
      Cannot resolve artifact, please check if JIB jar is present in classpath.
      nssLibDir: /usr/lib64/
      Cannot resolve artifact, please check if JIB jar is present in classpath.
      libnss3 version = 3.36. ECC None.
      SunPKCS11-NSSKeyStore version 14

      ...
      ----------System.err:(21/1603)----------
      java.security.KeyStoreException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_READ_ONLY
      at jdk.crypto.cryptoki/sun.security.pkcs11.P11KeyStore.engineSetEntry(P11KeyStore.java:1049)
      at jdk.crypto.cryptoki/sun.security.pkcs11.P11KeyStore.engineSetCertificateEntry(P11KeyStore.java:515)
      at java.base/java.security.KeyStore.setCertificateEntry(KeyStore.java:1228)
      at AddTrustedCert.main(AddTrustedCert.java:106)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
      at java.base/java.lang.Thread.run(Thread.java:830)
      Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_READ_ONLY
      at jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11.C_CreateObject(Native Method)
      at jdk.crypto.cryptoki/sun.security.pkcs11.P11KeyStore.storeCert(P11KeyStore.java:1567)
      at jdk.crypto.cryptoki/sun.security.pkcs11.P11KeyStore.engineSetEntry(P11KeyStore.java:1045)
      ... 9 more

      Attachments

        Issue Links

          Activity

            People

              mdonovan Matthew Donovan
              amlu Amy Lu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: