We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32a07a7 commit 7b29362Copy full SHA for 7b29362
1 file changed
src/internal.c
@@ -31810,6 +31810,15 @@ int SendCertificateVerify(WOLFSSL* ssl)
31810
#ifdef HAVE_SESSION_TICKET
31811
int SetTicket(WOLFSSL* ssl, const byte* ticket, word32 length)
31812
{
31813
+ /* If the session is shared, we need to copy-on-write */
31814
+ if (ssl->session->ref.count > 1) {
31815
+ WOLFSSL_SESSION* nsession = wolfSSL_SESSION_dup(ssl->session);
31816
+ if (nsession == NULL)
31817
+ return MEMORY_E;
31818
+ wolfSSL_FreeSession(ssl->ctx, ssl->session);
31819
+ ssl->session = nsession;
31820
+ }
31821
+
31822
/* Free old dynamic ticket if we already had one */
31823
if (ssl->session->ticketLenAlloc > 0) {
31824
XFREE(ssl->session->ticket, ssl->heap, DYNAMIC_TYPE_SESSION_TICK);
0 commit comments