File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1390,12 +1390,18 @@ JNIEXPORT jlong JNICALL Java_com_wolfssl_WolfSSLSession_get1Session
13901390 sess = wolfSSL_get_session (ssl );
13911391 }
13921392
1393- /* wolfSSL checks ssl for NULL, returns pointer to new WOLFSSL_SESSION,
1394- * Returns new duplicated WOLFSSL_SESSION. Needs to be freed with
1395- * wolfSSL_SESSION_free() when finished with pointer. */
1396- if (sess != NULL ) {
1397- /* Guarantee that we own the WOLFSSL_SESSION, make a copy */
1398- dup = wolfSSL_SESSION_dup (sess );
1393+ /* Only duplicate / save session if not TLS 1.3 (will be using normal
1394+ * session IDs), or is TLS 1.3 and we have a session ticket */
1395+ if ((wolfSSL_version (ssl ) != TLS1_3_VERSION ) ||
1396+ (wolfSSL_SESSION_has_ticket ((const WOLFSSL_SESSION * )sess ))) {
1397+
1398+ /* wolfSSL checks ssl for NULL, returns pointer to new WOLFSSL_SESSION,
1399+ * Returns new duplicated WOLFSSL_SESSION. Needs to be freed with
1400+ * wolfSSL_SESSION_free() when finished with pointer. */
1401+ if (sess != NULL ) {
1402+ /* Guarantee that we own the WOLFSSL_SESSION, make a copy */
1403+ dup = wolfSSL_SESSION_dup (sess );
1404+ }
13991405 }
14001406
14011407 if (wc_UnLockMutex (jniSessLock ) != 0 ) {
You can’t perform that action at this time.
0 commit comments