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

[8u] sun/security/pkcs11/ec/ tests fail on RHEL9

XMLWordPrintable

    • b01
    • generic
    • linux

        The following tests fail in jdk8 on RHEL9,

        ・sun/security/pkcs11/ec/TestECDH.java
        stack:
        ----------System.err:(29/1748)----------
        java.security.spec.InvalidKeySpecException: Could not create EC public key
        at sun.security.pkcs11.P11ECKeyFactory.engineGeneratePublic(P11ECKeyFactory.java:173)
        at java.security.KeyFactory.generatePublic(KeyFactory.java:328)
        at TestECDH.test(TestECDH.java:101)
        at TestECDH.main(TestECDH.java:92)
        at PKCS11Test.premain(PKCS11Test.java:125)
        at PKCS11Test.testNSS(PKCS11Test.java:487)
        at PKCS11Test.main(PKCS11Test.java:156)
        at TestECDH.main(TestECDH.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
        at java.lang.Thread.run(Thread.java:750)
        Caused by: java.security.InvalidKeyException: Could not create EC public key
        at sun.security.pkcs11.P11ECKeyFactory.implTranslatePublicKey(P11ECKeyFactory.java:130)
        at sun.security.pkcs11.P11ECKeyFactory.engineGeneratePublic(P11ECKeyFactory.java:171)
        ... 13 more
        Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DOMAIN_PARAMS_INVALID
        at sun.security.pkcs11.wrapper.PKCS11.C_CreateObject(Native Method)
        at sun.security.pkcs11.P11ECKeyFactory.generatePublic(P11ECKeyFactory.java:254)
        at sun.security.pkcs11.P11ECKeyFactory.implTranslatePublicKey(P11ECKeyFactory.java:110)
        ... 14 more

        ・sun/security/pkcs11/ec/TestECDSA.java
        stack:
        ----------System.err:(29/1765)----------
        java.security.spec.InvalidKeySpecException: Could not create EC private key
        at sun.security.pkcs11.P11ECKeyFactory.engineGeneratePrivate(P11ECKeyFactory.java:203)
        at java.security.KeyFactory.generatePrivate(KeyFactory.java:366)
        at TestECDSA.test(TestECDSA.java:172)
        at TestECDSA.main(TestECDSA.java:154)
        at PKCS11Test.premain(PKCS11Test.java:125)
        at PKCS11Test.testNSS(PKCS11Test.java:487)
        at PKCS11Test.main(PKCS11Test.java:156)
        at TestECDSA.main(TestECDSA.java:118)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
        at java.lang.Thread.run(Thread.java:750)
        Caused by: java.security.InvalidKeyException: Could not create EC private key
        at sun.security.pkcs11.P11ECKeyFactory.implTranslatePrivateKey(P11ECKeyFactory.java:159)
        at sun.security.pkcs11.P11ECKeyFactory.engineGeneratePrivate(P11ECKeyFactory.java:201)
        ... 13 more
        Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DOMAIN_PARAMS_INVALID
        at sun.security.pkcs11.wrapper.PKCS11.C_CreateObject(Native Method)
        at sun.security.pkcs11.P11ECKeyFactory.generatePrivate(P11ECKeyFactory.java:277)
        at sun.security.pkcs11.P11ECKeyFactory.implTranslatePrivateKey(P11ECKeyFactory.java:139)
        ... 14 more


        ・sun/security/pkcs11/ec/TestECGenSpec.java
        ----------System.err:(20/1353)----------
        java.security.InvalidParameterException: EC key must be at least 256 bits. The specific key size 192 is not supported
        at sun.security.pkcs11.P11KeyPairGenerator.initialize(P11KeyPairGenerator.java:148)
        at java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:640)
        at java.security.KeyPairGenerator.initialize(KeyPairGenerator.java:351)
        at TestKeyFactory.main(TestKeyFactory.java:142)
        at PKCS11Test.premain(PKCS11Test.java:125)
        at PKCS11Test.testNSS(PKCS11Test.java:487)
        at PKCS11Test.main(PKCS11Test.java:156)
        at TestKeyFactory.main(TestKeyFactory.java:123)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
        at java.lang.Thread.run(Thread.java:750)

        In jdk11 and later, these tests pass.

              phh Paul Hohensee
              tkiriyama Takuya Kiriyama
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: