Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: net/third_party/nss/ssl/sslnonce.c

Issue 1053903002: Update libssl to NSS 3.18 RTM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/third_party/nss/ssl/sslinfo.c ('k') | net/third_party/nss/ssl/sslproto.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file implements the CLIENT Session ID cache. 2 * This file implements the CLIENT Session ID cache.
3 * 3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public 4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 7
8 #include "cert.h" 8 #include "cert.h"
9 #include "pk11pub.h" 9 #include "pk11pub.h"
10 #include "secitem.h" 10 #include "secitem.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 #endif 434 #endif
435 return myTime; 435 return myTime;
436 } 436 }
437 437
438 void 438 void
439 ssl3_SetSIDSessionTicket(sslSessionID *sid, 439 ssl3_SetSIDSessionTicket(sslSessionID *sid,
440 /*in/out*/ NewSessionTicket *newSessionTicket) 440 /*in/out*/ NewSessionTicket *newSessionTicket)
441 { 441 {
442 PORT_Assert(sid); 442 PORT_Assert(sid);
443 PORT_Assert(newSessionTicket); 443 PORT_Assert(newSessionTicket);
444 PORT_Assert(newSessionTicket->ticket.data);
445 PORT_Assert(newSessionTicket->ticket.len != 0);
444 446
445 /* if sid->u.ssl3.lock, we are updating an existing entry that is already 447 /* if sid->u.ssl3.lock, we are updating an existing entry that is already
446 * cached or was once cached, so we need to acquire and release the write 448 * cached or was once cached, so we need to acquire and release the write
447 * lock. Otherwise, this is a new session that isn't shared with anything 449 * lock. Otherwise, this is a new session that isn't shared with anything
448 * yet, so no locking is needed. 450 * yet, so no locking is needed.
449 */ 451 */
450 if (sid->u.ssl3.lock) { 452 if (sid->u.ssl3.lock) {
451 NSSRWLock_LockWrite(sid->u.ssl3.lock); 453 NSSRWLock_LockWrite(sid->u.ssl3.lock);
452
453 /* A server might have sent us an empty ticket, which has the
454 * effect of clearing the previously known ticket.
455 */
456 if (sid->u.ssl3.locked.sessionTicket.ticket.data) { 454 if (sid->u.ssl3.locked.sessionTicket.ticket.data) {
457 SECITEM_FreeItem(&sid->u.ssl3.locked.sessionTicket.ticket, 455 SECITEM_FreeItem(&sid->u.ssl3.locked.sessionTicket.ticket,
458 PR_FALSE); 456 PR_FALSE);
459 } 457 }
460 } 458 }
461 459
462 PORT_Assert(!sid->u.ssl3.locked.sessionTicket.ticket.data); 460 PORT_Assert(!sid->u.ssl3.locked.sessionTicket.ticket.data);
463 461
464 /* Do a shallow copy, moving the ticket data. */ 462 /* Do a shallow copy, moving the ticket data. */
465 sid->u.ssl3.locked.sessionTicket = *newSessionTicket; 463 sid->u.ssl3.locked.sessionTicket = *newSessionTicket;
466 newSessionTicket->ticket.data = NULL; 464 newSessionTicket->ticket.data = NULL;
467 newSessionTicket->ticket.len = 0; 465 newSessionTicket->ticket.len = 0;
468 466
469 if (sid->u.ssl3.lock) { 467 if (sid->u.ssl3.lock) {
470 NSSRWLock_UnlockWrite(sid->u.ssl3.lock); 468 NSSRWLock_UnlockWrite(sid->u.ssl3.lock);
471 } 469 }
472 } 470 }
OLDNEW
« no previous file with comments | « net/third_party/nss/ssl/sslinfo.c ('k') | net/third_party/nss/ssl/sslproto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698