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

JNI/JCE: fix pointer use in JNI X509CheckPrivateKey() #80

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

cconlon
Copy link
Member

@cconlon cconlon commented Oct 23, 2024

This PR fixes the native JNI X509CheckPrivateKey() function to operate on a copy of the pointer to pkcs8KeyDerArr.

Recent changes in native wolfSSL as of wolfSSL/wolfssl@901384e704#diff-34d62efe7620eac9235c878aafc6716d1ef20a2246a35fac977f34bacce0481cR7315 caused the wolfSSL API wolfSSL_d2i_PKCS8_PKEY() to advance the input key buffer pointer.

Since the pointer can now be advanced, that can cause a crash in JNI when calling ReleaseByteArrayElements() on that pointer.

Fixes https://cloud.wolfssl-test.com/jenkins/job/wolfSSL/job/nightly-FIPSv2-wolfcrypt-jni-ant-test-v2

@JacobBarthelmeh JacobBarthelmeh merged commit 280032d into wolfSSL:master Oct 29, 2024
34 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.

3 participants