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

Always call wolfSSL_get1_session() inside native JNI WolfSSLSession.getSession() #236

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

cconlon
Copy link
Member

@cconlon cconlon commented Nov 27, 2024

Java callers of WolfSSLSession.getSession() should always expect to free the returned session pointer with WolfSSLSession.freeSession(long session). Previously getSession() called wolfSSL_SESSION_dup() but only for connections that were not TLS 1.3 or had a session ticket. Calling wolfSSL_get1_session() should be a more consistent solution since it increases the ref count on the WOLFSSL_SESSION in question.

This should make it more interoperable with various build options - TLS 1.3, without TLS 1.3, with -DNO_SESSION_CACHE_REF.

This also adds one GitHub Action test for the wolfSSL configure --enable-jni CFLAGS=-DNO_SESSION_CACHE_REF.

Potential fix for ZD 17211.

@cconlon cconlon self-assigned this Nov 27, 2024
…), callers expect to always free returned pointer
@JacobBarthelmeh JacobBarthelmeh merged commit 06feb77 into wolfSSL:master Dec 6, 2024
40 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