-
Notifications
You must be signed in to change notification settings - Fork 37
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: wrap wolfSSL_SessionIsSetup() in WolfSSLSession #191
Conversation
… 5.7.0 or WOLFSSL_PR7430_PATCH_APPLIED defined
@cconlon can we please have java test code for this api usage, wolfSSL_SessionIsSetup, getSession and freeSession? |
Hi @NitzDKoder, initial Java test code for the mentioned APIs has been added. Please see For general usage, after a |
…ion on methods, better cleanup
…eek() in WolfSSLSession.getSession()
…ectionTestExtendedSocket() correctly after handshake
…n and WolfSSLSocket
This PR wraps the native wolfSSL API:
wolfSSL_SessionIsSetup(WOLFSSL_SESSION* session);
in the static Java methodWolfSSLSession.sessionIsSetup(long session)
.The native session pointer can be obtained from a calling Java application by calling
WolfSSLSession.getSession()
.WolfSSLSession.getSession()
behaves likewolfSSL_get1_session()
and returns a duplicate/copy of theWOLFSSL_SESSION
. Calling applications must take care to free the session pointer when done by callingWolfSSLSession.freeSession(long session)
.Native
wolfSSL_SessionIsSetup()
was added after wolfSSL 5.7.0 with wolfSSL/wolfssl#7430. If using native wolfSSLLIBWOLFSSL_VERSION_HEX
inwolfssl/version.h
is not greater than0x05007000
, thenWOLFSSL_PR7430_PATCH_APPLIED
must be defined when compiling wolfssljni native JNI sources.java.sh
can be edited to defineWOLFSSL_PR7430_PATCH_APPLIED
incflags
if needed.Other changes in this PR:
WolfSSLSessionTest
to use Junit test method annotationsWolfSSLSession.get/set/freeSession()
WolfSSLSession.getSession()
JNI wrapper, check if session has ticket for TLS 1.3 before callingwolfSSL_peek()
SSLSocket
inWolfSSLSocketTest.protocolConnectionTestExtendedSocket()
, prevents test hang with--enable-jni --enable-all
on some JDK versionsWolfSSLSession
andWolfSSLSocket
Error: Could not find satisfied version for SemVer '8'.
.ZD 17557