Skip to content

Support OpenSSL backend and implement message digest - #1492

Open
KostasTsiounis wants to merge 1 commit into
IBM:mainfrom
KostasTsiounis:openssl_backend
Open

Support OpenSSL backend and implement message digest#1492
KostasTsiounis wants to merge 1 commit into
IBM:mainfrom
KostasTsiounis:openssl_backend

Conversation

@KostasTsiounis

@KostasTsiounis KostasTsiounis commented May 22, 2026

Copy link
Copy Markdown
Member

With this change, all appropriate code is added to support the use of OpenSSL as a backend. That includes:

  • Main Java class to load the libraries required and offer native methods.
  • Adapter Java classes to smoothly integrate without changes with existing code.
  • Makefiles to compile and link required C code to use OpenSSL.
  • Additional test tags and general test setup to allow the execution of appropriate tests with the new backend.

Additionally, the first set of algorithms, namely the message digests, are implemented. The aforementioned tags are, also, added to the corresponding tests.

Signed-off-by: Kostas Tsiounis kostas.tsiounis@ibm.com

@johnpeck-us-ibm

Copy link
Copy Markdown
Member

I know we talked about contexts and one for FIPS and one for non-FIPS. Could we use the Property query instead?
sha256 = EVP_MD_fetch(NULL, "SHA2-256", "fips=yes"); - FIPS
sha256 = EVP_MD_fetch(NULL, "SHA2-256", "provider=default"); - Non-FIPS.
Note the NULL for the context.

Does using this have any performance ramifications?

@KostasTsiounis
KostasTsiounis force-pushed the openssl_backend branch 2 times, most recently from 1b76bd7 to 31add61 Compare July 7, 2026 20:28
@KostasTsiounis
KostasTsiounis force-pushed the openssl_backend branch 2 times, most recently from 8920c23 to 0e09aab Compare July 21, 2026 15:39
@jasonkatonica
jasonkatonica requested a review from thu-ibm July 21, 2026 18:14
@KostasTsiounis
KostasTsiounis marked this pull request as ready for review July 31, 2026 00:05
Comment thread src/main/java/com/ibm/crypto/plus/provider/base/NativeImplementation.java Outdated
Comment thread src/main/java/com/ibm/crypto/plus/provider/ock/NativeOCKAdapterNonFIPS.java Outdated
Comment thread src/main/java/com/ibm/crypto/plus/provider/openssl/NativeOpenSSLAdapter.java Outdated
Comment thread src/main/native/openssl/Digest.c Outdated
Comment thread src/main/native/openssl/Digest.c
Comment thread src/main/java/com/ibm/crypto/plus/provider/openssl/NativeOpenSSLAdapter.java Outdated
Comment thread src/main/java/com/ibm/crypto/plus/provider/openssl/OpenSSLException.java Outdated
Comment thread src/main/native/openssl/Utils.c
Comment thread src/test/java/ibm/jceplus/junit/tests/TestArguments.java
@KostasTsiounis
KostasTsiounis requested a review from taoliult August 6, 2026 20:46
@KostasTsiounis KostasTsiounis changed the title Openssl backend Support OpenSSL backend and implement message digest Aug 7, 2026
Comment thread src/main/native/openssl/Digest.c Outdated
Comment thread src/main/java/com/ibm/crypto/plus/provider/base/Digest.java
Comment thread src/main/native/openssl/Digest.c
Comment thread src/main/native/openssl/Digest.c Outdated
Comment thread src/main/java/com/ibm/crypto/plus/provider/openssl/NativeOpenSSLAdapter.java Outdated
Comment thread src/main/native/openssl/Digest.c Outdated
Comment thread src/main/native/openssl/Utils.c Outdated
Comment thread src/main/native/openssl/Utils.c Outdated
Comment thread src/main/java/com/ibm/crypto/plus/provider/base/Digest.java
Comment thread src/main/native/openssl/Digest.c Outdated
Comment thread src/main/java/com/ibm/crypto/plus/provider/openssl/NativeOpenSSLAdapter.java Outdated
Comment thread src/main/native/openssl/Digest.c
@KostasTsiounis

Copy link
Copy Markdown
Member Author

I added some additional guards for z/OS, since OpenSSL is not available there with e6a77cb

Comment thread src/main/java/com/ibm/crypto/plus/provider/openssl/NativeOpenSSLAdapter.java Outdated

@taoliult taoliult left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasonkatonica jasonkatonica left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JinhangZhang JinhangZhang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

With this change, all appropriate code is added to support
the use of OpenSSL as a backend. That includes:
- Main Java class to load the libraries required and offer
  native methods.
- Adapter Java classes to smoothly integrate without changes
  with existing code.
- Makefiles to compile and link required C code to use
  OpenSSL.
- Additional test tags and general test setup to allow the
  execution of appropriate tests with the new backend.

Additionally, the first set of algorithms, namely the
message digests, are implemented. The aforementioned
tags are, also, added to the corresponding tests.

Signed-off-by: Kostas Tsiounis <kostas.tsiounis@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants