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

Side by Side Diff: net/third_party/nss/patches/cachecerts.patch

Issue 111853013: Update net/third_party/nss to NSS 3.15.4. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update the comment in sslenum.c for the two CHACHA20 cipher suites Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 diff -pu a/nss/lib/ssl/ssl3con.c b/nss/lib/ssl/ssl3con.c 1 diff -pu a/nss/lib/ssl/ssl3con.c b/nss/lib/ssl/ssl3con.c
2 --- a/nss/lib/ssl/ssl3con.c» 2013-07-31 12:29:35.584231452 -0700 2 --- a/nss/lib/ssl/ssl3con.c» 2014-01-03 19:28:03.550814608 -0800
3 +++ b/nss/lib/ssl/ssl3con.c» 2013-07-31 12:31:22.785789376 -0700 3 +++ b/nss/lib/ssl/ssl3con.c» 2014-01-03 19:30:09.722877211 -0800
4 @@ -43,6 +43,7 @@ 4 @@ -43,6 +43,7 @@
5 5
6 static SECStatus ssl3_AuthCertificate(sslSocket *ss); 6 static SECStatus ssl3_AuthCertificate(sslSocket *ss);
7 static void ssl3_CleanupPeerCerts(sslSocket *ss); 7 static void ssl3_CleanupPeerCerts(sslSocket *ss);
8 +static void ssl3_CopyPeerCertsFromSID(sslSocket *ss, sslSessionID *sid); 8 +static void ssl3_CopyPeerCertsFromSID(sslSocket *ss, sslSessionID *sid);
9 static PK11SymKey *ssl3_GenerateRSAPMS(sslSocket *ss, ssl3CipherSpec *spec, 9 static PK11SymKey *ssl3_GenerateRSAPMS(sslSocket *ss, ssl3CipherSpec *spec,
10 PK11SlotInfo * serverKeySlot); 10 PK11SlotInfo * serverKeySlot);
11 static SECStatus ssl3_DeriveMasterSecret(sslSocket *ss, PK11SymKey *pms); 11 static SECStatus ssl3_DeriveMasterSecret(sslSocket *ss, PK11SymKey *pms);
12 @@ -6141,6 +6142,7 @@ ssl3_HandleServerHello(sslSocket *ss, SS 12 @@ -6451,6 +6452,7 @@ ssl3_HandleServerHello(sslSocket *ss, SS
13 /* copy the peer cert from the SID */ 13 /* copy the peer cert from the SID */
14 if (sid->peerCert != NULL) { 14 if (sid->peerCert != NULL) {
15 ss->sec.peerCert = CERT_DupCertificate(sid->peerCert); 15 ss->sec.peerCert = CERT_DupCertificate(sid->peerCert);
16 + ssl3_CopyPeerCertsFromSID(ss, sid); 16 + ssl3_CopyPeerCertsFromSID(ss, sid);
17 } 17 }
18 18
19 /* NULL value for PMS signifies re-use of the old MS */ 19 /* NULL value for PMS signifies re-use of the old MS */
20 @@ -7538,6 +7540,7 @@ compression_found: 20 @@ -8025,6 +8027,7 @@ compression_found:
21 ss->sec.ci.sid = sid; 21 ss->sec.ci.sid = sid;
22 if (sid->peerCert != NULL) { 22 if (sid->peerCert != NULL) {
23 ss->sec.peerCert = CERT_DupCertificate(sid->peerCert); 23 ss->sec.peerCert = CERT_DupCertificate(sid->peerCert);
24 + ssl3_CopyPeerCertsFromSID(ss, sid); 24 + ssl3_CopyPeerCertsFromSID(ss, sid);
25 } 25 }
26 26
27 /* 27 /*
28 @@ -9147,6 +9150,44 @@ ssl3_CleanupPeerCerts(sslSocket *ss) 28 @@ -9639,6 +9642,44 @@ ssl3_CleanupPeerCerts(sslSocket *ss)
29 ss->ssl3.peerCertChain = NULL; 29 ss->ssl3.peerCertChain = NULL;
30 } 30 }
31 31
32 +static void 32 +static void
33 +ssl3_CopyPeerCertsFromSID(sslSocket *ss, sslSessionID *sid) 33 +ssl3_CopyPeerCertsFromSID(sslSocket *ss, sslSessionID *sid)
34 +{ 34 +{
35 + PLArenaPool *arena; 35 + PLArenaPool *arena;
36 + ssl3CertNode *lastCert = NULL; 36 + ssl3CertNode *lastCert = NULL;
37 + ssl3CertNode *certs = NULL; 37 + ssl3CertNode *certs = NULL;
38 + int i; 38 + int i;
(...skipping 24 matching lines...) Expand all
63 + ssl3CertNode *c = certs; 63 + ssl3CertNode *c = certs;
64 + for (; i < MAX_PEER_CERT_CHAIN_SIZE && c; i++, c = c->next) { 64 + for (; i < MAX_PEER_CERT_CHAIN_SIZE && c; i++, c = c->next) {
65 + PORT_Assert(!sid->peerCertChain[i]); 65 + PORT_Assert(!sid->peerCertChain[i]);
66 + sid->peerCertChain[i] = CERT_DupCertificate(c->cert); 66 + sid->peerCertChain[i] = CERT_DupCertificate(c->cert);
67 + } 67 + }
68 +} 68 +}
69 + 69 +
70 /* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete 70 /* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete
71 * ssl3 CertificateStatus message. 71 * ssl3 CertificateStatus message.
72 * Caller must hold Handshake and RecvBuf locks. 72 * Caller must hold Handshake and RecvBuf locks.
73 @@ -9432,6 +9473,7 @@ ssl3_AuthCertificate(sslSocket *ss) 73 @@ -9917,6 +9958,7 @@ ssl3_AuthCertificate(sslSocket *ss)
74 } 74 }
75 75
76 ss->sec.ci.sid->peerCert = CERT_DupCertificate(ss->sec.peerCert); 76 ss->sec.ci.sid->peerCert = CERT_DupCertificate(ss->sec.peerCert);
77 + ssl3_CopyPeerCertsToSID(ss->ssl3.peerCertChain, ss->sec.ci.sid); 77 + ssl3_CopyPeerCertsToSID(ss->ssl3.peerCertChain, ss->sec.ci.sid);
78 78
79 if (!ss->sec.isServer) { 79 if (!ss->sec.isServer) {
80 CERTCertificate *cert = ss->sec.peerCert; 80 CERTCertificate *cert = ss->sec.peerCert;
81 diff -pu a/nss/lib/ssl/sslimpl.h b/nss/lib/ssl/sslimpl.h 81 diff -pu a/nss/lib/ssl/sslimpl.h b/nss/lib/ssl/sslimpl.h
82 --- a/nss/lib/ssl/sslimpl.h» 2013-07-31 12:07:10.974699609 -0700 82 --- a/nss/lib/ssl/sslimpl.h» 2014-01-03 19:28:03.550814608 -0800
83 +++ b/nss/lib/ssl/sslimpl.h» 2013-07-31 12:31:22.785789376 -0700 83 +++ b/nss/lib/ssl/sslimpl.h» 2014-01-03 19:30:09.722877211 -0800
84 @@ -572,10 +572,13 @@ typedef enum {» never_cached, 84 @@ -586,6 +586,8 @@ typedef enum {» never_cached,
85 invalid_cache /* no longer in any cache. */ 85 invalid_cache /* no longer in any cache. */
86 } Cached; 86 } Cached;
87 87
88 +#define MAX_PEER_CERT_CHAIN_SIZE 8 88 +#define MAX_PEER_CERT_CHAIN_SIZE 8
89 + 89 +
90 struct sslSessionIDStr { 90 struct sslSessionIDStr {
91 sslSessionID * next; /* chain used for client sockets, only */ 91 /* The global cache lock must be held when accessing these members when the
92 * sid is in any cache.
93 @@ -600,6 +602,7 @@ struct sslSessionIDStr {
94 */
92 95
93 CERTCertificate * peerCert; 96 CERTCertificate * peerCert;
94 + CERTCertificate * peerCertChain[MAX_PEER_CERT_CHAIN_SIZE]; 97 + CERTCertificate * peerCertChain[MAX_PEER_CERT_CHAIN_SIZE];
95 SECItemArray peerCertStatus; /* client only */ 98 SECItemArray peerCertStatus; /* client only */
96 const char * peerID; /* client only */ 99 const char * peerID; /* client only */
97 const char * urlSvrName; /* client only */ 100 const char * urlSvrName; /* client only */
98 diff -pu a/nss/lib/ssl/sslnonce.c b/nss/lib/ssl/sslnonce.c 101 diff -pu a/nss/lib/ssl/sslnonce.c b/nss/lib/ssl/sslnonce.c
99 --- a/nss/lib/ssl/sslnonce.c» 2013-07-31 12:07:10.974699609 -0700 102 --- a/nss/lib/ssl/sslnonce.c» 2014-01-03 19:28:03.550814608 -0800
100 +++ b/nss/lib/ssl/sslnonce.c» 2013-07-31 12:31:22.785789376 -0700 103 +++ b/nss/lib/ssl/sslnonce.c» 2014-01-03 19:30:09.782878192 -0800
101 @@ -164,6 +164,7 @@ lock_cache(void) 104 @@ -164,6 +164,7 @@ lock_cache(void)
102 static void 105 static void
103 ssl_DestroySID(sslSessionID *sid) 106 ssl_DestroySID(sslSessionID *sid)
104 { 107 {
105 + int i; 108 + int i;
106 SSL_TRC(8, ("SSL: destroy sid: sid=0x%x cached=%d", sid, sid->cached)); 109 SSL_TRC(8, ("SSL: destroy sid: sid=0x%x cached=%d", sid, sid->cached));
107 PORT_Assert((sid->references == 0)); 110 PORT_Assert((sid->references == 0));
108 111
109 @@ -183,6 +184,9 @@ ssl_DestroySID(sslSessionID *sid) 112 @@ -196,6 +197,9 @@ ssl_DestroySID(sslSessionID *sid)
110 if ( sid->peerCert ) { 113 if ( sid->peerCert ) {
111 CERT_DestroyCertificate(sid->peerCert); 114 CERT_DestroyCertificate(sid->peerCert);
112 } 115 }
113 + for (i = 0; i < MAX_PEER_CERT_CHAIN_SIZE && sid->peerCertChain[i]; i++) { 116 + for (i = 0; i < MAX_PEER_CERT_CHAIN_SIZE && sid->peerCertChain[i]; i++) {
114 + CERT_DestroyCertificate(sid->peerCertChain[i]); 117 + CERT_DestroyCertificate(sid->peerCertChain[i]);
115 + } 118 + }
116 if (sid->peerCertStatus.items) { 119 if (sid->peerCertStatus.items) {
117 SECITEM_FreeArray(&sid->peerCertStatus, PR_FALSE); 120 SECITEM_FreeArray(&sid->peerCertStatus, PR_FALSE);
118 } 121 }
OLDNEW
« no previous file with comments | « net/third_party/nss/patches/applypatches.sh ('k') | net/third_party/nss/patches/cachelocks.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698