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

SunEC Provider not available with jlink

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Linux Mint 19.3 64bit, OpenJDK 14.0.1 GA

      A DESCRIPTION OF THE PROBLEM :
      I'm using JDK 14.0.1 GA and trying to create a small redistributable version of my application using the combination of jlink and jpackage.

      In my application, I'm trying to validate some signatures with algorithm such as SHA256withECDSA, SHA384withECDSA and SHA512withECDSA. If I run my application with the standard JDK distribution, the application is working correctly, but if I run it with the result of jlink and jpackage, I get errors like

      "SHA256withECDSA Signature not available"
      "SHA384withECDSA Signature not available"

      I've double-checked that libsunec.so is in place under the 'runtime/lib' folder, but I've seen that the SunEC provider isn't loaded at all during the start (just SUN and SunRSA are being loaded).

      The jlink modules I'm using are:

      java.desktop,java.smartcardio,java.management,java.sql,java.logging,java.net.http,java.xml.crypto,jdk.crypto.ec

      and my jlink command is the following one:


      jlink --strip-debug \
            --strip-native-commands \
            --bind-services \
            --no-header-files \
            --no-man-pages \
            --compress=2 \
            --module-path ${JAVA_HOME}/jmods \
            --add-modules java.desktop,java.smartcardio,java.management,java.sql,java.logging,java.net.http,java.xml.crypto,jdk.crypto.ec \
            --output jlink-runtime

      REGRESSION : Last worked in version 14.0.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Write a program that verifies a file signed with EC Algorithms (e.g. SHA256withECDSA)

      2. Optimize runtime with jlink

      3. Create a package version with jpackage

      4. Run application

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The Signature verification should work
      ACTUAL -
      Elliptic Curves algorithm aren't available at runtime. SunEC isn't loaded

      ---------- BEGIN SOURCE ----------
      I can provide it as git repository
      ---------- END SOURCE ----------

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: