summaryrefslogtreecommitdiff
path: root/lib/ssl/sslnonce.c
diff options
context:
space:
mode:
authorWan-Teh Chang <wtc@google.com>2014-03-03 12:21:41 -0800
committerWan-Teh Chang <wtc@google.com>2014-03-03 12:21:41 -0800
commit5ccd61581d1118523dbff8b15f6514e046054a1b (patch)
treeb28db12db8d808d758c6eff0287c99006770e6c8 /lib/ssl/sslnonce.c
parent4969a3f894fbe25a4f5e34616876f71bd3765dc7 (diff)
downloadnss-hg-5ccd61581d1118523dbff8b15f6514e046054a1b.tar.gz
Bug 947572: Don't destroy the session ticket in cache when we receive
a NewSessionTicket message with an empty ticket. r=briansmith.
Diffstat (limited to 'lib/ssl/sslnonce.c')
-rw-r--r--lib/ssl/sslnonce.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/ssl/sslnonce.c b/lib/ssl/sslnonce.c
index c2493cdc6..2e861f157 100644
--- a/lib/ssl/sslnonce.c
+++ b/lib/ssl/sslnonce.c
@@ -483,6 +483,8 @@ ssl3_SetSIDSessionTicket(sslSessionID *sid,
{
PORT_Assert(sid);
PORT_Assert(newSessionTicket);
+ PORT_Assert(newSessionTicket->ticket.data);
+ PORT_Assert(newSessionTicket->ticket.len != 0);
/* if sid->u.ssl3.lock, we are updating an existing entry that is already
* cached or was once cached, so we need to acquire and release the write
@@ -491,10 +493,6 @@ ssl3_SetSIDSessionTicket(sslSessionID *sid,
*/
if (sid->u.ssl3.lock) {
PR_RWLock_Wlock(sid->u.ssl3.lock);
-
- /* A server might have sent us an empty ticket, which has the
- * effect of clearing the previously known ticket.
- */
if (sid->u.ssl3.locked.sessionTicket.ticket.data) {
SECITEM_FreeItem(&sid->u.ssl3.locked.sessionTicket.ticket,
PR_FALSE);