Skip to content

JNI: Implement get/set session tickets#284

Merged
cconlon merged 2 commits intowolfSSL:masterfrom
rlm2002:sessionTickets
Aug 14, 2025
Merged

JNI: Implement get/set session tickets#284
cconlon merged 2 commits intowolfSSL:masterfrom
rlm2002:sessionTickets

Conversation

@rlm2002
Copy link
Copy Markdown
Contributor

@rlm2002 rlm2002 commented Jul 31, 2025

Adds wrapper and unit tests for get and set session tickets. Implementation of getSessionTickets() and setSessionTickets() is compatible with older versions of wolfSSL.

Adds macro WOLFSSL_MAX_SESSION_TICKET_LEN with default value 2048, which is used in getSessionTickets() to generate a byte array to copy the ticket to before generating a correctly sized jbyteArray.

Unit tests aim to check functionality of new functions and ability to resume TLS1.3 session with session tickets.

@rlm2002 rlm2002 self-assigned this Jul 31, 2025
@rlm2002 rlm2002 marked this pull request as draft August 1, 2025 14:54
@rlm2002 rlm2002 marked this pull request as ready for review August 4, 2025 20:13
@rlm2002 rlm2002 assigned wolfSSL-Bot and unassigned rlm2002 Aug 4, 2025
@rlm2002 rlm2002 changed the title Implement get/set session tickets JNI: Implement get/set session tickets Aug 4, 2025
@rlm2002 rlm2002 force-pushed the sessionTickets branch 2 times, most recently from 12dbbf1 to dd3401e Compare August 4, 2025 20:41
@dgarske dgarske requested a review from cconlon August 5, 2025 14:09
Comment thread native/com_wolfssl_WolfSSLSession.c Outdated
Comment thread native/com_wolfssl_WolfSSLSession.c
Comment thread native/com_wolfssl_WolfSSLSession.c Outdated
Comment thread native/com_wolfssl_WolfSSLSession.c
Comment thread native/com_wolfssl_WolfSSLSession.c Outdated
Comment thread src/java/com/wolfssl/WolfSSLSession.java Outdated
Comment thread src/java/com/wolfssl/WolfSSLSession.java Outdated
Comment thread src/test/com/wolfssl/test/WolfSSLSessionTest.java Outdated
Comment thread src/test/com/wolfssl/test/WolfSSLSessionTest.java Outdated
Comment thread src/test/com/wolfssl/test/WolfSSLSessionTest.java Outdated
@cconlon cconlon requested a review from Copilot August 11, 2025 22:02
@cconlon cconlon assigned rlm2002 and unassigned cconlon and wolfSSL-Bot Aug 11, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements JNI wrapper functions for getting and setting session tickets in wolfSSL, enabling session resumption functionality for TLS 1.3 connections. The implementation provides backward compatibility with older wolfSSL versions.

  • Adds getSessionTicket() and setSessionTicket() methods to WolfSSLSession class
  • Introduces WOLFSSL_MAX_SESSION_TICKET_LEN macro with default value of 2048 bytes for buffer allocation
  • Implements comprehensive unit tests for session ticket functionality and TLS 1.3 session resumption

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
WolfSSLSession.java Adds public API methods for getting and setting session tickets with proper synchronization and error handling
com_wolfssl_WolfSSLSession.h Declares JNI function signatures for the new session ticket methods
com_wolfssl_WolfSSLSession.c Implements native JNI wrapper functions with proper memory management and conditional compilation
WolfSSLSessionTest.java Adds unit tests for session ticket operations and TLS 1.3 session resumption scenarios

Comment thread src/test/com/wolfssl/test/WolfSSLSessionTest.java Outdated
Comment thread src/test/com/wolfssl/test/WolfSSLSessionTest.java Outdated
modify getSessionTickets method
remove whitespace

test changes from copilot
@rlm2002 rlm2002 assigned cconlon and unassigned rlm2002 Aug 12, 2025
@cconlon
Copy link
Copy Markdown
Member

cconlon commented Aug 12, 2025

Overall looks good, waiting on final approval/merge until wolfSSL/wolfssl#9053 gets in.

@cconlon
Copy link
Copy Markdown
Member

cconlon commented Aug 14, 2025

Doing a quick re-run of CI tests after 9053 has merged.

@cconlon cconlon merged commit 04190d9 into wolfSSL:master Aug 14, 2025
99 checks passed
@rlm2002 rlm2002 deleted the sessionTickets branch January 5, 2026 17:01
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.

4 participants