Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the java wrapper working on linux and windows #60

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rkxx
Copy link

@rkxx rkxx commented Mar 20, 2023

Description

This pull request consists of 3 commits which make the existing java wrapper working for linux and windows targets.

  • b91b04b adds build tasks to build the wrapper for linux. The build tasks install the necessary tool chain (using rustup), build the native lib (using cargo) and copy the built libs into the src folder. The test task is modified to allow testing on linux and windows platforms using the libs in the src folder.

  • 2a9680b modifies the tests to address signing and verifiying of large number of messages (e.g. required for signing vaccination credentials). The modified tests fail on windows if commit 5cfe730 is not applied.

  • 5cfe730 fixes issues with invalid data due to loss of ownership. Instead of use of ByteArray::from(vec[8]) to create ByteArray ByteArray::from(&vec[8]) is used preventing move of ownership. The ownership remains in the calling scope and the data are not overwritten before used later in this scope.

  • Tests for the changes have been added (for bug fixes / features)

  • The commit message(s) follow conventional commits

  • Documentation has been added / updated (for bug fixes / features)

  • Changes follow the contributing document.

Motivation and Context

Make java wrapper available on linux and windows and fixes issues with invalid data when signing and verifying large number of messages. Signing and verifying large number of messages is required for jsonld data (e.g. verifiable credentials - vaccination credentials etc.).

issue#43

Does this PR introduce a breaking change?

  • Yes
  • No

Which merge strategy will you use?

  • Squash
  • Rebase (REVIEW COMMITS)

…t task to allow junit tests

Only build.gradle in wrappers/java has been updated.
build.sh is still not working due to missing JNI features (--features java).
Use build task of gradle to build and test java wrapper.

mattrglobal#43
…messages (200)

The existing tests only signed and verified one message and succeeded on Windows.
Using the library for ld-signatures (e.g. vaccination credentials) failed
when normalized credential results in more than 15 messages.
…oss of ownership

The existing implementation did use ByteArray.from(vec[8]) to create the ByteArray.
So it moves the ownership. Further, ByteArray only holds a ptr to data.
Ptr points to invalid data after ByteArray is created and
data get overwritten depending on underlying plattform and length of data.

mattrglobal#43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant