Skip to content

Add module Support for Java 9+ #85

@ErikBergfurInfor

Description

@ErikBergfurInfor

I'm working on getting a Java 17 FIPS test environment working with WolfSSL as the JSSE and JCA.
One of the build steps is to get a FIPS JDK compiled with the JSSE and JCA modules.
If I put the JNI and JSSE jars in the /fips and run

jlink --no-header-files --no-man-pages \
    --compress=2 \
    --module-path /fips/ \
    --add-modules ${mods},wolfcrypt.jni,wolfssl.jsse \
    --output /usr/java/fips --ignore-signing-information

I get errors that indicate that the module-info class is missing. I can patch the jar-files with:

jdeps --ignore-missing-deps --generate-module-info patch /fips/wolfcrypt-jni.jar \
  && javac --patch-module wolfcrypt.jni=/fips/wolfcrypt-jni.jar patch/wolfcrypt.jni/module-info.java \
  && jar uf /fips/wolfcrypt-jni.jar -C patch/wolfcrypt.jni module-info.class

But when I do this and retry with the previous command, I get a conflict in the exported packages.

What I think needs to be done is:

  1. In wolfssljni, move the classes in com.wolfssl.wolfcrypt to com.wolfssl.wolfcrypt.jsse or somewhere non-conflicting
  2. Add a module-info.java to each jar, to ease the integration in java 9+

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions