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

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

Issue 11275240: Update net/third_party/nss/ssl to NSS 3.14. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Upload before commit Created 8 years, 1 month 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 From 4c2b4b3992f81f062248f03296f7eb59b5fc0868 Mon Sep 17 00:00:00 2001 1 diff -pu -r a/net/third_party/nss/ssl/ssl3con.c b/net/third_party/nss/ssl/ssl3co n.c
2 From: Adam Langley <agl@chromium.org> 2 --- a/net/third_party/nss/ssl/ssl3con.c»2012-11-09 15:19:29.665155332 -0800
3 Date: Mon, 3 Oct 2011 12:20:29 -0400 3 +++ b/net/third_party/nss/ssl/ssl3con.c»2012-11-09 15:20:08.835732728 -0800
4 Subject: [PATCH] cachecerts.patch 4 @@ -42,6 +42,7 @@
5
6 ---
7 mozilla/security/nss/lib/ssl/ssl3con.c | 54 +++++++++++++++++++++++++++++-
8 mozilla/security/nss/lib/ssl/sslimpl.h | 3 ++
9 mozilla/security/nss/lib/ssl/sslnonce.c | 4 ++
10 3 files changed, 59 insertions(+), 2 deletions(-)
11
12 diff --git a/mozilla/security/nss/lib/ssl/ssl3con.c b/mozilla/security/nss/lib/s sl/ssl3con.c
13 index 455a532..9830e65 100644
14 --- a/mozilla/security/nss/lib/ssl/ssl3con.c
15 +++ b/mozilla/security/nss/lib/ssl/ssl3con.c
16 @@ -72,6 +72,7 @@
17 #endif 5 #endif
18 6
19 static void ssl3_CleanupPeerCerts(sslSocket *ss); 7 static void ssl3_CleanupPeerCerts(sslSocket *ss);
20 +static void ssl3_CopyPeerCertsFromSID(sslSocket *ss, sslSessionID *sid); 8 +static void ssl3_CopyPeerCertsFromSID(sslSocket *ss, sslSessionID *sid);
21 static PK11SymKey *ssl3_GenerateRSAPMS(sslSocket *ss, ssl3CipherSpec *spec, 9 static PK11SymKey *ssl3_GenerateRSAPMS(sslSocket *ss, ssl3CipherSpec *spec,
22 PK11SlotInfo * serverKeySlot); 10 PK11SlotInfo * serverKeySlot);
23 static SECStatus ssl3_DeriveMasterSecret(sslSocket *ss, PK11SymKey *pms); 11 static SECStatus ssl3_DeriveMasterSecret(sslSocket *ss, PK11SymKey *pms);
24 @@ -5141,6 +5142,7 @@ ssl3_HandleServerHello(sslSocket *ss, SSL3Opaque *b, PRUin t32 length) 12 @@ -5575,6 +5576,7 @@ ssl3_HandleServerHello(sslSocket *ss, SS
25 /* copy the peer cert from the SID */ 13 /* copy the peer cert from the SID */
26 if (sid->peerCert != NULL) { 14 if (sid->peerCert != NULL) {
27 ss->sec.peerCert = CERT_DupCertificate(sid->peerCert); 15 ss->sec.peerCert = CERT_DupCertificate(sid->peerCert);
28 + ssl3_CopyPeerCertsFromSID(ss, sid); 16 + ssl3_CopyPeerCertsFromSID(ss, sid);
29 } 17 }
30 18
31 19
32 @@ -6393,6 +6395,7 @@ compression_found: 20 @@ -6916,6 +6918,7 @@ compression_found:
33 ss->sec.ci.sid = sid; 21 ss->sec.ci.sid = sid;
34 if (sid->peerCert != NULL) { 22 if (sid->peerCert != NULL) {
35 ss->sec.peerCert = CERT_DupCertificate(sid->peerCert); 23 ss->sec.peerCert = CERT_DupCertificate(sid->peerCert);
36 + ssl3_CopyPeerCertsFromSID(ss, sid); 24 + ssl3_CopyPeerCertsFromSID(ss, sid);
37 } 25 }
38 26
39 /* 27 /*
40 @@ -7761,6 +7764,44 @@ ssl3_CleanupPeerCerts(sslSocket *ss) 28 @@ -8323,6 +8326,44 @@ ssl3_CleanupPeerCerts(sslSocket *ss)
41 ss->ssl3.peerCertChain = NULL; 29 ss->ssl3.peerCertChain = NULL;
42 } 30 }
43 31
44 +static void 32 +static void
45 +ssl3_CopyPeerCertsFromSID(sslSocket *ss, sslSessionID *sid) 33 +ssl3_CopyPeerCertsFromSID(sslSocket *ss, sslSessionID *sid)
46 +{ 34 +{
47 + PRArenaPool *arena; 35 + PRArenaPool *arena;
48 + ssl3CertNode *lastCert = NULL; 36 + ssl3CertNode *lastCert = NULL;
49 + ssl3CertNode *certs = NULL; 37 + ssl3CertNode *certs = NULL;
50 + int i; 38 + int i;
(...skipping 24 matching lines...) Expand all
75 + ssl3CertNode *c = certs; 63 + ssl3CertNode *c = certs;
76 + 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) {
77 + PORT_Assert(!sid->peerCertChain[i]); 65 + PORT_Assert(!sid->peerCertChain[i]);
78 + sid->peerCertChain[i] = CERT_DupCertificate(c->cert); 66 + sid->peerCertChain[i] = CERT_DupCertificate(c->cert);
79 + } 67 + }
80 +} 68 +}
81 + 69 +
82 /* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete 70 /* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete
83 * ssl3 Certificate message. 71 * ssl3 Certificate message.
84 * Caller must hold Handshake and RecvBuf locks. 72 * Caller must hold Handshake and RecvBuf locks.
85 @@ -7947,6 +7994,7 @@ ssl3_HandleCertificate(sslSocket *ss, SSL3Opaque *b, PRUin t32 length) 73 @@ -8510,6 +8551,7 @@ ssl3_HandleCertificate(sslSocket *ss, SS
86 } 74 }
87 75
88 ss->sec.ci.sid->peerCert = CERT_DupCertificate(ss->sec.peerCert); 76 ss->sec.ci.sid->peerCert = CERT_DupCertificate(ss->sec.peerCert);
89 + ssl3_CopyPeerCertsToSID(ss->ssl3.peerCertChain, ss->sec.ci.sid); 77 + ssl3_CopyPeerCertsToSID(ss->ssl3.peerCertChain, ss->sec.ci.sid);
90 78
91 if (!ss->sec.isServer) { 79 if (!ss->sec.isServer) {
92 » /* set the server authentication and key exchange types and sizes 80 CERTCertificate *cert = ss->sec.peerCert;
93 diff --git a/mozilla/security/nss/lib/ssl/sslimpl.h b/mozilla/security/nss/lib/s sl/sslimpl.h 81 diff -pu -r a/net/third_party/nss/ssl/sslimpl.h b/net/third_party/nss/ssl/sslimp l.h
94 index d1c1181..48d6d83 100644 82 --- a/net/third_party/nss/ssl/sslimpl.h»2012-09-27 18:46:45.000000000 -0700
95 --- a/mozilla/security/nss/lib/ssl/sslimpl.h 83 +++ b/net/third_party/nss/ssl/sslimpl.h»2012-11-09 15:20:08.835732728 -0800
96 +++ b/mozilla/security/nss/lib/ssl/sslimpl.h 84 @@ -571,10 +571,13 @@ typedef enum {» never_cached,
97 @@ -569,10 +569,13 @@ typedef enum {» never_cached,
98 invalid_cache /* no longer in any cache. */ 85 invalid_cache /* no longer in any cache. */
99 } Cached; 86 } Cached;
100 87
101 +#define MAX_PEER_CERT_CHAIN_SIZE 8 88 +#define MAX_PEER_CERT_CHAIN_SIZE 8
102 + 89 +
103 struct sslSessionIDStr { 90 struct sslSessionIDStr {
104 sslSessionID * next; /* chain used for client sockets, only */ 91 sslSessionID * next; /* chain used for client sockets, only */
105 92
106 CERTCertificate * peerCert; 93 CERTCertificate * peerCert;
107 + CERTCertificate * peerCertChain[MAX_PEER_CERT_CHAIN_SIZE]; 94 + CERTCertificate * peerCertChain[MAX_PEER_CERT_CHAIN_SIZE];
108 const char * peerID; /* client only */ 95 const char * peerID; /* client only */
109 const char * urlSvrName; /* client only */ 96 const char * urlSvrName; /* client only */
110 CERTCertificate * localCert; 97 CERTCertificate * localCert;
111 diff --git a/mozilla/security/nss/lib/ssl/sslnonce.c b/mozilla/security/nss/lib/ ssl/sslnonce.c 98 diff -pu -r a/net/third_party/nss/ssl/sslnonce.c b/net/third_party/nss/ssl/sslno nce.c
112 index 63dc5a2..64adc1f 100644 99 --- a/net/third_party/nss/ssl/sslnonce.c» 2012-04-25 07:50:12.000000000 -0 700
113 --- a/mozilla/security/nss/lib/ssl/sslnonce.c 100 +++ b/net/third_party/nss/ssl/sslnonce.c» 2012-11-09 15:20:08.835732728 -0 800
114 +++ b/mozilla/security/nss/lib/ssl/sslnonce.c 101 @@ -165,6 +165,7 @@ lock_cache(void)
115 @@ -197,6 +197,7 @@ lock_cache(void)
116 static void 102 static void
117 ssl_DestroySID(sslSessionID *sid) 103 ssl_DestroySID(sslSessionID *sid)
118 { 104 {
119 + int i; 105 + int i;
120 SSL_TRC(8, ("SSL: destroy sid: sid=0x%x cached=%d", sid, sid->cached)); 106 SSL_TRC(8, ("SSL: destroy sid: sid=0x%x cached=%d", sid, sid->cached));
121 PORT_Assert((sid->references == 0)); 107 PORT_Assert((sid->references == 0));
122 108
123 @@ -216,6 +217,9 @@ ssl_DestroySID(sslSessionID *sid) 109 @@ -184,6 +185,9 @@ ssl_DestroySID(sslSessionID *sid)
124 if ( sid->peerCert ) { 110 if ( sid->peerCert ) {
125 CERT_DestroyCertificate(sid->peerCert); 111 CERT_DestroyCertificate(sid->peerCert);
126 } 112 }
127 + for (i = 0; i < MAX_PEER_CERT_CHAIN_SIZE && sid->peerCertChain[i]; i++) { 113 + for (i = 0; i < MAX_PEER_CERT_CHAIN_SIZE && sid->peerCertChain[i]; i++) {
128 + CERT_DestroyCertificate(sid->peerCertChain[i]); 114 + CERT_DestroyCertificate(sid->peerCertChain[i]);
129 + } 115 + }
130 if ( sid->localCert ) { 116 if ( sid->localCert ) {
131 CERT_DestroyCertificate(sid->localCert); 117 CERT_DestroyCertificate(sid->localCert);
132 } 118 }
OLDNEW
« no previous file with comments | « net/third_party/nss/patches/applypatches.sh ('k') | net/third_party/nss/patches/channelid.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698