Skip to content

Upgrade jni crate from 0.21.1 to 0.22.4#180

Merged
palango merged 1 commit into
mainfrom
palango/jni-0.22-upgrade
Jun 12, 2026
Merged

Upgrade jni crate from 0.21.1 to 0.22.4#180
palango merged 1 commit into
mainfrom
palango/jni-0.22-upgrade

Conversation

@palango

@palango palango commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What

Upgrades the jni crate to 0.22.4 and rewrites the JNI bridge for its redesigned API: native methods now receive EnvUnowned and access JNI through with_env, which runs the body under catch_unwind.

Behavior changes

  • A panic can no longer unwind across the FFI boundary and abort the JVM; any residual panic or JNI-level error (e.g. null arrays) is converted into a thrown RuntimeException with a false return.
  • Malformed public key or signature bytes return false instead of panicking.

Verification

  • cargo check/clippy clean with --features jvm
  • All 44 workspace tests pass
  • Release build with the Makefile's exact flags (--features=jni) exports Java_org_celo_BlindThresholdBls_verify (checked with nm)

Rewrite the bridge for the new EnvUnowned/with_env API. The closure now
runs under catch_unwind and malformed keys or signatures return false
instead of panicking across the FFI boundary (audit fix #1).
@palango palango merged commit 9cfed53 into main Jun 12, 2026
11 checks passed
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.

1 participant