From 7c67a9261c50ab8dfadb8a384e1fe18af994eb39 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 6 Oct 2014 12:44:52 -0700 Subject: [PATCH] trimmed some unused code for session tickets --- cyassl/internal.h | 17 +---------------- src/internal.c | 12 +----------- src/ssl.c | 4 +--- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/cyassl/internal.h b/cyassl/internal.h index 47e854ebc..29bf6dbd1 100644 --- a/cyassl/internal.h +++ b/cyassl/internal.h @@ -2066,23 +2066,8 @@ struct CYASSL { #ifdef HAVE_SECURE_RENEGOTIATION SecureRenegotiation* secure_renegotiation; /* valid pointer indicates */ #endif /* user turned on */ - #ifdef HAVE_SESSION_TICKET - #ifndef NO_CYASSL_CLIENT - /* - Create cantidate_ticket when processing New Session Ticket Handshake - Message. When the ticket is validated at Finished Handshake Message, - move canditate_ticket to session_ticket and call: - TLSX_UseSessionTicket(&ssl->extensions, ssl->session_ticket); - - If the session_ticket must be destroyed, call: - TLSX_UseSessionTicket(&ssl->extensions, NULL); - This function doesn't free an early ticket, but will erase it's - reference inside the extensions. - */ + #if !defined(NO_CYASSL_CLIENT) && defined(HAVE_SESSION_TICKET) byte expect_session_ticket; - SessionTicket* candidate_ticket; - SessionTicket* session_ticket; - #endif #endif #endif /* HAVE_TLS_EXTENSIONS */ #ifdef HAVE_NETX diff --git a/src/internal.c b/src/internal.c index bce25814e..bcbc04bc6 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1757,12 +1757,8 @@ int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx) #ifdef HAVE_SECURE_RENEGOTIATION ssl->secure_renegotiation = NULL; #endif -#ifdef HAVE_SESSION_TICKET -#ifndef NO_CYASSL_CLIENT +#if !defined(NO_CYASSL_CLIENT) && defined(HAVE_SESSION_TICKET) ssl->expect_session_ticket = 0; - ssl->candidate_ticket = NULL; - ssl->session_ticket = NULL; -#endif #endif #endif @@ -2020,12 +2016,6 @@ void SSL_ResourceFree(CYASSL* ssl) #ifdef HAVE_TLS_EXTENSIONS TLSX_FreeAll(ssl->extensions); #endif -#ifdef HAVE_SESSION_TICKET -#ifndef NO_CYASSL_CLIENT - TLSX_SessionTicket_Free(ssl->candidate_ticket); - TLSX_SessionTicket_Free(ssl->session_ticket); -#endif -#endif #ifdef HAVE_NETX if (ssl->nxCtx.nxPacket) nx_packet_release(ssl->nxCtx.nxPacket); diff --git a/src/ssl.c b/src/ssl.c index 56eb7861f..564877b55 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -797,8 +797,7 @@ int CyaSSL_Rehandshake(CYASSL* ssl) #endif /* HAVE_SECURE_RENEGOTIATION */ /* Session Ticket */ -#ifdef HAVE_SESSION_TICKET -#ifndef NO_CYASSL_CLIENT +#if !defined(NO_CYASSL_CLIENT) && defined(HAVE_SESSION_TICKET) int CyaSSL_UseSessionTicket(CYASSL* ssl) { if (ssl == NULL) @@ -815,7 +814,6 @@ int CyaSSL_CTX_UseSessionTicket(CYASSL_CTX* ctx) return TLSX_UseSessionTicket(&ctx->extensions, NULL); } #endif -#endif #ifndef CYASSL_LEANPSK