OLD | NEW |
1 From 5d8c33901f2b1be41afd1b0211bee5d5236a868d Mon Sep 17 00:00:00 2001 | 1 diff -up a/src/net/third_party/nss/ssl/ssl.h b/src/net/third_party/nss/ssl/ssl.h |
2 From: Adam Langley <agl@chromium.org> | 2 --- a/src/net/third_party/nss/ssl/ssl.h»2012-02-28 18:34:23.263186340 -0800 |
3 Date: Mon, 3 Oct 2011 12:21:00 -0400 | 3 +++ b/src/net/third_party/nss/ssl/ssl.h»2012-02-28 18:47:14.683775498 -0800 |
4 Subject: [PATCH] ocspstapling.patch | 4 @@ -167,6 +167,7 @@ SSL_IMPORT PRFileDesc *SSL_ImportFD(PRFi |
5 | 5 * accept fragmented alerts). |
6 --- | 6 */ |
7 mozilla/security/nss/lib/ssl/ssl.def | 1 + | 7 #define SSL_CBC_RANDOM_IV 23 |
8 mozilla/security/nss/lib/ssl/ssl.h | 18 +++++ | 8 +#define SSL_ENABLE_OCSP_STAPLING 24 /* Request OCSP stapling (client) */ |
9 mozilla/security/nss/lib/ssl/ssl3con.c | 111 +++++++++++++++++++++++++++++++ | |
10 mozilla/security/nss/lib/ssl/ssl3ext.c | 78 +++++++++++++++++++++- | |
11 mozilla/security/nss/lib/ssl/ssl3prot.h | 1 + | |
12 mozilla/security/nss/lib/ssl/sslerr.h | 2 + | |
13 mozilla/security/nss/lib/ssl/sslimpl.h | 13 ++++ | |
14 mozilla/security/nss/lib/ssl/sslsock.c | 43 ++++++++++++ | |
15 mozilla/security/nss/lib/ssl/sslt.h | 3 +- | |
16 9 files changed, 268 insertions(+), 2 deletions(-) | |
17 | |
18 diff --git a/mozilla/security/nss/lib/ssl/ssl.def b/mozilla/security/nss/lib/ssl
/ssl.def | |
19 index 0fa8777..35cc1e3 100644 | |
20 --- a/mozilla/security/nss/lib/ssl/ssl.def | |
21 +++ b/mozilla/security/nss/lib/ssl/ssl.def | |
22 @@ -155,6 +155,7 @@ SSL_SNISocketConfigHook; | |
23 ;+NSS_CHROMIUM { | |
24 ;+ global: | |
25 SSL_GetNextProto; | |
26 +SSL_GetStapledOCSPResponse; | |
27 SSL_PeerCertificateChain; | |
28 SSL_SetNextProtoNego; | |
29 ;+ local: | |
30 diff --git a/mozilla/security/nss/lib/ssl/ssl.h b/mozilla/security/nss/lib/ssl/s
sl.h | |
31 index cccb49a..221fe2d 100644 | |
32 --- a/mozilla/security/nss/lib/ssl/ssl.h | |
33 +++ b/mozilla/security/nss/lib/ssl/ssl.h | |
34 @@ -139,6 +139,7 @@ SSL_IMPORT PRFileDesc *SSL_ImportFD(PRFileDesc *model, PRFil
eDesc *fd); | |
35 /* occur on RSA or DH ciphersuites where the cipher's key length is >= 80 */ | |
36 /* bits. The advantage of False Start is that it saves a round trip for */ | |
37 /* client-speaks-first protocols when performing a full handshake. */ | |
38 +#define SSL_ENABLE_OCSP_STAPLING 23 /* Request OCSP stapling (client) */ | |
39 | 9 |
40 #ifdef SSL_DEPRECATED_FUNCTION | 10 #ifdef SSL_DEPRECATED_FUNCTION |
41 /* Old deprecated function names */ | 11 /* Old deprecated function names */ |
42 @@ -274,6 +275,23 @@ SSL_IMPORT CERTCertificate *SSL_PeerCertificate(PRFileDesc
*fd); | 12 @@ -347,6 +348,23 @@ SSL_IMPORT SECStatus SSL_PeerCertificate |
43 SSL_IMPORT SECStatus SSL_PeerCertificateChain( | 13 » PRFileDesc *fd, CERTCertificate **certs, |
44 » PRFileDesc *fd, CERTCertificate **certs, unsigned int *certs_size); | 14 » unsigned int *numCerts, unsigned int maxNumCerts); |
45 | 15 |
46 +/* SSL_GetStapledOCSPResponse returns the OCSP response that was provided by | 16 +/* SSL_GetStapledOCSPResponse returns the OCSP response that was provided by |
47 + * the TLS server. The resulting data is copied to |out_data|. On entry, |*len| | 17 + * the TLS server. The resulting data is copied to |out_data|. On entry, |*len| |
48 + * must contain the size of |out_data|. On exit, |*len| will contain the size | 18 + * must contain the size of |out_data|. On exit, |*len| will contain the size |
49 + * of the OCSP stapled response. If the stapled response is too large to fit in | 19 + * of the OCSP stapled response. If the stapled response is too large to fit in |
50 + * |out_data| then it will be truncated. If no OCSP response was given by the | 20 + * |out_data| then it will be truncated. If no OCSP response was given by the |
51 + * server then it has zero length. | 21 + * server then it has zero length. |
52 + * | 22 + * |
53 + * You must set the SSL_ENABLE_OCSP_STAPLING option in order for OCSP responses | 23 + * You must set the SSL_ENABLE_OCSP_STAPLING option in order for OCSP responses |
54 + * to be provided by a server. | 24 + * to be provided by a server. |
55 + * | 25 + * |
56 + * You can call this function during the certificate verification callback or | 26 + * You can call this function during the certificate verification callback or |
57 + * any time afterwards. | 27 + * any time afterwards. |
58 + */ | 28 + */ |
59 +SSL_IMPORT SECStatus SSL_GetStapledOCSPResponse(PRFileDesc *fd, | 29 +SSL_IMPORT SECStatus SSL_GetStapledOCSPResponse(PRFileDesc *fd, |
60 + unsigned char *out_data, | 30 + unsigned char *out_data, |
61 + unsigned int *len); | 31 + unsigned int *len); |
62 + | 32 + |
63 /* | 33 /* |
64 ** Authenticate certificate hook. Called when a certificate comes in | 34 ** Authenticate certificate hook. Called when a certificate comes in |
65 ** (because of SSL_REQUIRE_CERTIFICATE in SSL_Enable) to authenticate the | 35 ** (because of SSL_REQUIRE_CERTIFICATE in SSL_Enable) to authenticate the |
66 diff --git a/mozilla/security/nss/lib/ssl/ssl3con.c b/mozilla/security/nss/lib/s
sl/ssl3con.c | 36 diff -up a/src/net/third_party/nss/ssl/ssl3con.c b/src/net/third_party/nss/ssl/s
sl3con.c |
67 index 9830e65..ca2793f 100644 | 37 --- a/src/net/third_party/nss/ssl/ssl3con.c» 2012-02-28 17:48:46.326209244 -0
800 |
68 --- a/mozilla/security/nss/lib/ssl/ssl3con.c | 38 +++ b/src/net/third_party/nss/ssl/ssl3con.c» 2012-02-28 19:12:51.845953454 -0
800 |
69 +++ b/mozilla/security/nss/lib/ssl/ssl3con.c | 39 @@ -7887,6 +7887,57 @@ ssl3_CopyPeerCertsToSID(ssl3CertNode *ce |
70 @@ -7803,6 +7803,57 @@ ssl3_CopyPeerCertsToSID(ssl3CertNode *certs, sslSessionID
*sid) | |
71 } | 40 } |
72 | 41 |
73 /* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete | 42 /* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete |
74 + * ssl3 CertificateStatus message. | 43 + * ssl3 CertificateStatus message. |
75 + * Caller must hold Handshake and RecvBuf locks. | 44 + * Caller must hold Handshake and RecvBuf locks. |
76 + * This is always called before ssl3_HandleCertificate, even if the Certificate | 45 + * This is always called before ssl3_HandleCertificate, even if the Certificate |
77 + * message is sent first. | 46 + * message is sent first. |
78 + */ | 47 + */ |
79 +static SECStatus | 48 +static SECStatus |
80 +ssl3_HandleCertificateStatus(sslSocket *ss, SSL3Opaque *b, PRUint32 length) | 49 +ssl3_HandleCertificateStatus(sslSocket *ss, SSL3Opaque *b, PRUint32 length) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 +alert_loser: | 87 +alert_loser: |
119 + (void)SSL3_SendAlert(ss, alert_fatal, desc); | 88 + (void)SSL3_SendAlert(ss, alert_fatal, desc); |
120 + (void)ssl_MapLowLevelError(errCode); | 89 + (void)ssl_MapLowLevelError(errCode); |
121 + return SECFailure; | 90 + return SECFailure; |
122 +} | 91 +} |
123 + | 92 + |
124 +/* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete | 93 +/* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete |
125 * ssl3 Certificate message. | 94 * ssl3 Certificate message. |
126 * Caller must hold Handshake and RecvBuf locks. | 95 * Caller must hold Handshake and RecvBuf locks. |
127 */ | 96 */ |
128 @@ -8605,6 +8656,26 @@ xmit_loser: | 97 @@ -8679,6 +8730,26 @@ ssl3_FinishHandshake(sslSocket * ss) |
129 return SECSuccess; | 98 return SECSuccess; |
130 } | 99 } |
131 | 100 |
132 +/* This function handles any pending Certificate messages. Certificate messages | 101 +/* This function handles any pending Certificate messages. Certificate messages |
133 + * can be pending if we expect a possible CertificateStatus message to follow. | 102 + * can be pending if we expect a possible CertificateStatus message to follow. |
134 + * | 103 + * |
135 + * This function must be called immediately after handling the | 104 + * This function must be called immediately after handling the |
136 + * CertificateStatus message, and before handling any ServerKeyExchange or | 105 + * CertificateStatus message, and before handling any ServerKeyExchange or |
137 + * CertificateRequest messages. | 106 + * CertificateRequest messages. |
138 + */ | 107 + */ |
139 +static SECStatus | 108 +static SECStatus |
140 +ssl3_MaybeHandlePendingCertificateMessage(sslSocket *ss) | 109 +ssl3_MaybeHandlePendingCertificateMessage(sslSocket *ss) |
141 +{ | 110 +{ |
142 + SECStatus rv = SECSuccess; | 111 + SECStatus rv = SECSuccess; |
143 + | 112 + |
144 + if (ss->ssl3.hs.pending_cert_msg.data) { | 113 + if (ss->ssl3.hs.pending_cert_msg.data) { |
145 + rv = ssl3_HandleCertificate(ss, ss->ssl3.hs.pending_cert_msg.data, | 114 + rv = ssl3_HandleCertificate(ss, ss->ssl3.hs.pending_cert_msg.data, |
146 + ss->ssl3.hs.pending_cert_msg.len); | 115 + ss->ssl3.hs.pending_cert_msg.len); |
147 + SECITEM_FreeItem(&ss->ssl3.hs.pending_cert_msg, PR_FALSE); | 116 + SECITEM_FreeItem(&ss->ssl3.hs.pending_cert_msg, PR_FALSE); |
148 + } | 117 + } |
149 + return rv; | 118 + return rv; |
150 +} | 119 +} |
151 + | 120 + |
152 /* Called from ssl3_HandleHandshake() when it has gathered a complete ssl3 | 121 /* Called from ssl3_HandleHandshake() when it has gathered a complete ssl3 |
153 * hanshake message. | 122 * hanshake message. |
154 * Caller must hold Handshake and RecvBuf locks. | 123 * Caller must hold Handshake and RecvBuf locks. |
155 @@ -8699,14 +8770,42 @@ ssl3_HandleHandshakeMessage(sslSocket *ss, SSL3Opaque *b
, PRUint32 length) | 124 @@ -8773,14 +8844,42 @@ ssl3_HandleHandshakeMessage(sslSocket *s |
156 rv = ssl3_HandleServerHello(ss, b, length); | 125 rv = ssl3_HandleServerHello(ss, b, length); |
157 break; | 126 break; |
158 case certificate: | 127 case certificate: |
159 + if (ss->ssl3.hs.may_get_cert_status) { | 128 + if (ss->ssl3.hs.may_get_cert_status) { |
160 + /* If we might get a CertificateStatus then we want to postpone the | 129 + /* If we might get a CertificateStatus then we want to postpone the |
161 + * processing of the Certificate message until after we have | 130 + * processing of the Certificate message until after we have |
162 + * processed the CertificateStatus */ | 131 + * processed the CertificateStatus */ |
163 + if (ss->ssl3.hs.pending_cert_msg.data || | 132 + if (ss->ssl3.hs.pending_cert_msg.data || |
164 + ss->ssl3.hs.ws != wait_server_cert) { | 133 + ss->ssl3.hs.ws != wait_server_cert) { |
165 + (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message); | 134 + (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message); |
(...skipping 22 matching lines...) Expand all Loading... |
188 (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message); | 157 (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message); |
189 PORT_SetError(SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH); | 158 PORT_SetError(SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH); |
190 return SECFailure; | 159 return SECFailure; |
191 } | 160 } |
192 + rv = ssl3_MaybeHandlePendingCertificateMessage(ss); | 161 + rv = ssl3_MaybeHandlePendingCertificateMessage(ss); |
193 + if (rv != SECSuccess) | 162 + if (rv != SECSuccess) |
194 + break; | 163 + break; |
195 rv = ssl3_HandleServerKeyExchange(ss, b, length); | 164 rv = ssl3_HandleServerKeyExchange(ss, b, length); |
196 break; | 165 break; |
197 case certificate_request: | 166 case certificate_request: |
198 @@ -8715,6 +8814,9 @@ ssl3_HandleHandshakeMessage(sslSocket *ss, SSL3Opaque *b,
PRUint32 length) | 167 @@ -8789,6 +8888,9 @@ ssl3_HandleHandshakeMessage(sslSocket *s |
199 PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST); | 168 PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST); |
200 return SECFailure; | 169 return SECFailure; |
201 } | 170 } |
202 + rv = ssl3_MaybeHandlePendingCertificateMessage(ss); | 171 + rv = ssl3_MaybeHandlePendingCertificateMessage(ss); |
203 + if (rv != SECSuccess) | 172 + if (rv != SECSuccess) |
204 + break; | 173 + break; |
205 rv = ssl3_HandleCertificateRequest(ss, b, length); | 174 rv = ssl3_HandleCertificateRequest(ss, b, length); |
206 break; | 175 break; |
207 case server_hello_done: | 176 case server_hello_done: |
208 @@ -8728,6 +8830,9 @@ ssl3_HandleHandshakeMessage(sslSocket *ss, SSL3Opaque *b,
PRUint32 length) | 177 @@ -8802,6 +8904,9 @@ ssl3_HandleHandshakeMessage(sslSocket *s |
209 PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_DONE); | 178 PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_DONE); |
210 return SECFailure; | 179 return SECFailure; |
211 } | 180 } |
212 + rv = ssl3_MaybeHandlePendingCertificateMessage(ss); | 181 + rv = ssl3_MaybeHandlePendingCertificateMessage(ss); |
213 + if (rv != SECSuccess) | 182 + if (rv != SECSuccess) |
214 + break; | 183 + break; |
215 rv = ssl3_HandleServerHelloDone(ss); | 184 rv = ssl3_HandleServerHelloDone(ss); |
216 break; | 185 break; |
217 case certificate_verify: | 186 case certificate_verify: |
218 @@ -9578,6 +9683,12 @@ ssl3_DestroySSL3Info(sslSocket *ss) | 187 @@ -9646,6 +9751,12 @@ ssl3_DestroySSL3Info(sslSocket *ss) |
219 ss->ssl3.hs.messages.len = 0; | 188 ss->ssl3.hs.messages.len = 0; |
220 ss->ssl3.hs.messages.space = 0; | 189 ss->ssl3.hs.messages.space = 0; |
221 } | 190 } |
222 + if (ss->ssl3.hs.pending_cert_msg.data) { | 191 + if (ss->ssl3.hs.pending_cert_msg.data) { |
223 + SECITEM_FreeItem(&ss->ssl3.hs.pending_cert_msg, PR_FALSE); | 192 + SECITEM_FreeItem(&ss->ssl3.hs.pending_cert_msg, PR_FALSE); |
224 + } | 193 + } |
225 + if (ss->ssl3.hs.cert_status.data) { | 194 + if (ss->ssl3.hs.cert_status.data) { |
226 + SECITEM_FreeItem(&ss->ssl3.hs.cert_status, PR_FALSE); | 195 + SECITEM_FreeItem(&ss->ssl3.hs.cert_status, PR_FALSE); |
227 + } | 196 + } |
228 | 197 |
229 /* free the SSL3Buffer (msg_body) */ | 198 /* free the SSL3Buffer (msg_body) */ |
230 PORT_Free(ss->ssl3.hs.msg_body.buf); | 199 PORT_Free(ss->ssl3.hs.msg_body.buf); |
231 diff --git a/mozilla/security/nss/lib/ssl/ssl3ext.c b/mozilla/security/nss/lib/s
sl/ssl3ext.c | 200 diff -up a/src/net/third_party/nss/ssl/ssl3ext.c b/src/net/third_party/nss/ssl/s
sl3ext.c |
232 index fbd5a91..4e3d9cc 100644 | 201 --- a/src/net/third_party/nss/ssl/ssl3ext.c» 2012-02-15 13:52:08.000000000 -0
800 |
233 --- a/mozilla/security/nss/lib/ssl/ssl3ext.c | 202 +++ b/src/net/third_party/nss/ssl/ssl3ext.c» 2012-02-28 19:14:28.617352538 -0
800 |
234 +++ b/mozilla/security/nss/lib/ssl/ssl3ext.c | 203 @@ -253,6 +253,7 @@ static const ssl3HelloExtensionHandler s |
235 @@ -247,6 +247,7 @@ static const ssl3HelloExtensionHandler serverHelloHandlersTL
S[] = { | |
236 { ssl_session_ticket_xtn, &ssl3_ClientHandleSessionTicketXtn }, | 204 { ssl_session_ticket_xtn, &ssl3_ClientHandleSessionTicketXtn }, |
237 { ssl_renegotiation_info_xtn, &ssl3_HandleRenegotiationInfoXtn }, | 205 { ssl_renegotiation_info_xtn, &ssl3_HandleRenegotiationInfoXtn }, |
238 { ssl_next_proto_neg_xtn, &ssl3_ClientHandleNextProtoNegoXtn }, | 206 { ssl_next_proto_nego_xtn, &ssl3_ClientHandleNextProtoNegoXtn }, |
239 + { ssl_cert_status_xtn, &ssl3_ClientHandleStatusRequestXtn }, | 207 + { ssl_cert_status_xtn, &ssl3_ClientHandleStatusRequestXtn }, |
240 { -1, NULL } | 208 { -1, NULL } |
241 }; | 209 }; |
242 | 210 |
243 @@ -270,7 +271,8 @@ ssl3HelloExtensionSender clientHelloSendersTLS[SSL_MAX_EXTEN
SIONS] = { | 211 @@ -276,7 +277,8 @@ ssl3HelloExtensionSender clientHelloSend |
244 { ssl_ec_point_formats_xtn, &ssl3_SendSupportedPointFormatsXtn }, | 212 { ssl_ec_point_formats_xtn, &ssl3_SendSupportedPointFormatsXtn }, |
245 #endif | 213 #endif |
246 { ssl_session_ticket_xtn, &ssl3_SendSessionTicketXtn }, | 214 { ssl_session_ticket_xtn, &ssl3_SendSessionTicketXtn }, |
247 - { ssl_next_proto_neg_xtn, &ssl3_ClientSendNextProtoNegoXtn } | 215 - { ssl_next_proto_nego_xtn, &ssl3_ClientSendNextProtoNegoXtn } |
248 + { ssl_next_proto_neg_xtn, &ssl3_ClientSendNextProtoNegoXtn }, | 216 + { ssl_next_proto_nego_xtn, &ssl3_ClientSendNextProtoNegoXtn }, |
249 + { ssl_cert_status_xtn, &ssl3_ClientSendStatusRequestXtn } | 217 + { ssl_cert_status_xtn, &ssl3_ClientSendStatusRequestXtn } |
250 /* any extra entries will appear as { 0, NULL } */ | 218 /* any extra entries will appear as { 0, NULL } */ |
251 }; | 219 }; |
252 | 220 |
253 @@ -654,6 +656,80 @@ ssl3_ClientSendNextProtoNegoXtn(sslSocket * ss, | 221 @@ -659,6 +661,80 @@ loser: |
254 return -1; | 222 return -1; |
255 } | 223 } |
256 | 224 |
257 +SECStatus | 225 +SECStatus |
258 +ssl3_ClientHandleStatusRequestXtn(sslSocket *ss, PRUint16 ex_type, | 226 +ssl3_ClientHandleStatusRequestXtn(sslSocket *ss, PRUint16 ex_type, |
259 + SECItem *data) | 227 + SECItem *data) |
260 +{ | 228 +{ |
261 + /* If we didn't request this extension, then the server may not echo it. */ | 229 + /* If we didn't request this extension, then the server may not echo it. */ |
262 + if (!ss->opt.enableOCSPStapling) | 230 + if (!ss->opt.enableOCSPStapling) |
263 + return SECFailure; | 231 + return SECFailure; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 + } else if (maxBytes < extension_length) { | 292 + } else if (maxBytes < extension_length) { |
325 + PORT_Assert(0); | 293 + PORT_Assert(0); |
326 + return 0; | 294 + return 0; |
327 + } | 295 + } |
328 + return extension_length; | 296 + return extension_length; |
329 +} | 297 +} |
330 + | 298 + |
331 /* | 299 /* |
332 * NewSessionTicket | 300 * NewSessionTicket |
333 * Called from ssl3_HandleFinished | 301 * Called from ssl3_HandleFinished |
334 diff --git a/mozilla/security/nss/lib/ssl/ssl3prot.h b/mozilla/security/nss/lib/
ssl/ssl3prot.h | 302 diff -up a/src/net/third_party/nss/ssl/ssl3prot.h b/src/net/third_party/nss/ssl/
ssl3prot.h |
335 index f3c950e..aeaacdd 100644 | 303 --- a/src/net/third_party/nss/ssl/ssl3prot.h» 2011-10-28 17:29:11.000000000 -0
700 |
336 --- a/mozilla/security/nss/lib/ssl/ssl3prot.h | 304 +++ b/src/net/third_party/nss/ssl/ssl3prot.h» 2012-02-28 19:12:51.845953454 -0
800 |
337 +++ b/mozilla/security/nss/lib/ssl/ssl3prot.h | |
338 @@ -158,6 +158,7 @@ typedef enum { | 305 @@ -158,6 +158,7 @@ typedef enum { |
339 certificate_verify = 15, | 306 certificate_verify = 15, |
340 client_key_exchange = 16, | 307 client_key_exchange = 16, |
341 finished = 20, | 308 finished = 20, |
342 + certificate_status = 22, | 309 + certificate_status = 22, |
343 next_proto = 67 | 310 next_proto = 67 |
344 } SSL3HandshakeType; | 311 } SSL3HandshakeType; |
345 | 312 |
346 diff --git a/mozilla/security/nss/lib/ssl/sslerr.h b/mozilla/security/nss/lib/ss
l/sslerr.h | 313 diff -up a/src/net/third_party/nss/ssl/sslerr.h b/src/net/third_party/nss/ssl/ss
lerr.h |
347 index a2f6524..c940f95 100644 | 314 --- a/src/net/third_party/nss/ssl/sslerr.h» 2012-02-11 04:55:58.000000000 -0
800 |
348 --- a/mozilla/security/nss/lib/ssl/sslerr.h | 315 +++ b/src/net/third_party/nss/ssl/sslerr.h» 2012-02-28 18:58:06.733056235 -0
800 |
349 +++ b/mozilla/security/nss/lib/ssl/sslerr.h | 316 @@ -211,6 +211,8 @@ SSL_ERROR_FEATURE_NOT_SUPPORTED_FOR_SSL2 |
350 @@ -203,6 +203,8 @@ SSL_ERROR_RX_UNEXPECTED_UNCOMPRESSED_RECORD»= (SSL_ERROR_BAS
E + 114), | 317 SSL_ERROR_FEATURE_NOT_SUPPORTED_FOR_SERVERS = (SSL_ERROR_BASE + 118), |
| 318 SSL_ERROR_FEATURE_NOT_SUPPORTED_FOR_CLIENTS = (SSL_ERROR_BASE + 119), |
351 | 319 |
352 SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY = (SSL_ERROR_BASE + 115), | 320 +SSL_ERROR_RX_UNEXPECTED_CERT_STATUS = (SSL_ERROR_BASE + 120), |
353 | |
354 +SSL_ERROR_RX_UNEXPECTED_CERT_STATUS» = (SSL_ERROR_BASE + 116), | |
355 + | 321 + |
356 SSL_ERROR_END_OF_LIST /* let the c compiler determine the value of this. */ | 322 SSL_ERROR_END_OF_LIST /* let the c compiler determine the value of this. */ |
357 } SSLErrorCodes; | 323 } SSLErrorCodes; |
358 #endif /* NO_SECURITY_ERROR_ENUM */ | 324 #endif /* NO_SECURITY_ERROR_ENUM */ |
359 diff --git a/mozilla/security/nss/lib/ssl/sslimpl.h b/mozilla/security/nss/lib/s
sl/sslimpl.h | 325 diff -up a/src/net/third_party/nss/ssl/sslimpl.h b/src/net/third_party/nss/ssl/s
slimpl.h |
360 index 48d6d83..8e2bd14 100644 | 326 --- a/src/net/third_party/nss/ssl/sslimpl.h» 2012-02-28 17:48:46.326209244 -0
800 |
361 --- a/mozilla/security/nss/lib/ssl/sslimpl.h | 327 +++ b/src/net/third_party/nss/ssl/sslimpl.h» 2012-02-28 19:05:14.299310096 -0
800 |
362 +++ b/mozilla/security/nss/lib/ssl/sslimpl.h | |
363 @@ -339,6 +339,7 @@ typedef struct sslOptionsStr { | 328 @@ -339,6 +339,7 @@ typedef struct sslOptionsStr { |
364 unsigned int enableRenegotiation : 2; /* 20-21 */ | |
365 unsigned int requireSafeNegotiation : 1; /* 22 */ | 329 unsigned int requireSafeNegotiation : 1; /* 22 */ |
366 unsigned int enableFalseStart : 1; /* 23 */ | 330 unsigned int enableFalseStart : 1; /* 23 */ |
367 + unsigned int enableOCSPStapling : 1; /* 24 */ | 331 unsigned int cbcRandomIV : 1; /* 24 */ |
| 332 + unsigned int enableOCSPStapling : 1; /* 25 */ |
368 } sslOptions; | 333 } sslOptions; |
369 | 334 |
370 typedef enum { sslHandshakingUndetermined = 0, | 335 typedef enum { sslHandshakingUndetermined = 0, |
371 @@ -782,6 +783,14 @@ const ssl3CipherSuiteDef *suite_def; | 336 @@ -782,6 +783,14 @@ const ssl3CipherSuiteDef *suite_def; |
372 * when this one finishes */ | 337 PRBool isResuming; /* are we resuming a session */ |
373 PRBool usedStepDownKey; /* we did a server key exchange. */ | 338 PRBool usedStepDownKey; /* we did a server key exchange. */ |
374 PRBool sendingSCSV; /* instead of empty RI */ | 339 PRBool sendingSCSV; /* instead of empty RI */ |
375 + PRBool may_get_cert_status; /* the server echoed a | 340 + PRBool may_get_cert_status; /* the server echoed a |
376 + * status_request extension so | 341 + * status_request extension so |
377 + * may send a CertificateStatus | 342 + * may send a CertificateStatus |
378 + * handshake message. */ | 343 + * handshake message. */ |
379 + SECItem pending_cert_msg; /* a Certificate message which we | 344 + SECItem pending_cert_msg; /* a Certificate message which we |
380 + * save temporarily if we may get | 345 + * save temporarily if we may get |
381 + * a CertificateStatus message */ | 346 + * a CertificateStatus message */ |
382 + SECItem cert_status; /* an OCSP response */ | 347 + SECItem cert_status; /* an OCSP response */ |
383 sslBuffer msgState; /* current state for handshake messages*
/ | 348 sslBuffer msgState; /* current state for handshake messages*
/ |
384 /* protected by recvBufLock */ | 349 /* protected by recvBufLock */ |
385 sslBuffer messages; /* Accumulated handshake messages */ | 350 sslBuffer messages; /* Accumulated handshake messages */ |
386 @@ -1515,6 +1524,8 @@ extern SECStatus ssl3_ClientHandleSessionTicketXtn(sslSock
et *ss, | 351 @@ -1527,6 +1536,8 @@ extern SECStatus ssl3_HandleSupportedPoi |
387 PRUint16 ex_type, SECItem *data); | 352 PRUint16 ex_type, SECItem *data); |
388 extern SECStatus ssl3_ClientHandleNextProtoNegoXtn(sslSocket *ss, | 353 extern SECStatus ssl3_ClientHandleSessionTicketXtn(sslSocket *ss, |
389 PRUint16 ex_type, SECItem *data); | 354 PRUint16 ex_type, SECItem *data); |
390 +extern SECStatus ssl3_ClientHandleStatusRequestXtn(sslSocket *ss, | 355 +extern SECStatus ssl3_ClientHandleStatusRequestXtn(sslSocket *ss, |
391 + PRUint16 ex_type, SECItem *data); | 356 + PRUint16 ex_type, SECItem *data); |
392 extern SECStatus ssl3_ServerHandleSessionTicketXtn(sslSocket *ss, | 357 extern SECStatus ssl3_ServerHandleSessionTicketXtn(sslSocket *ss, |
393 PRUint16 ex_type, SECItem *data); | 358 PRUint16 ex_type, SECItem *data); |
394 extern SECStatus ssl3_ServerHandleNextProtoNegoXtn(sslSocket *ss, | 359 |
395 @@ -1526,6 +1537,8 @@ extern SECStatus ssl3_ServerHandleNextProtoNegoXtn(sslSock
et *ss, | 360 @@ -1536,6 +1547,8 @@ extern SECStatus ssl3_ServerHandleSessio |
396 */ | 361 */ |
397 extern PRInt32 ssl3_SendSessionTicketXtn(sslSocket *ss, PRBool append, | 362 extern PRInt32 ssl3_SendSessionTicketXtn(sslSocket *ss, PRBool append, |
398 PRUint32 maxBytes); | 363 PRUint32 maxBytes); |
399 +extern PRInt32 ssl3_ClientSendStatusRequestXtn(sslSocket *ss, PRBool append, | 364 +extern PRInt32 ssl3_ClientSendStatusRequestXtn(sslSocket *ss, PRBool append, |
400 + PRUint32 maxBytes); | 365 + PRUint32 maxBytes); |
401 | 366 |
402 /* ClientHello and ServerHello extension senders. | 367 /* ClientHello and ServerHello extension senders. |
403 * The code is in ssl3ext.c. | 368 * The code is in ssl3ext.c. |
404 diff --git a/mozilla/security/nss/lib/ssl/sslsock.c b/mozilla/security/nss/lib/s
sl/sslsock.c | 369 diff -up a/src/net/third_party/nss/ssl/sslsock.c b/src/net/third_party/nss/ssl/s
slsock.c |
405 index b7e32a2..4c4df3f 100644 | 370 --- a/src/net/third_party/nss/ssl/sslsock.c» 2012-02-28 16:15:34.790321976 -0
800 |
406 --- a/mozilla/security/nss/lib/ssl/sslsock.c | 371 +++ b/src/net/third_party/nss/ssl/sslsock.c» 2012-02-28 19:12:51.845953454 -0
800 |
407 +++ b/mozilla/security/nss/lib/ssl/sslsock.c | 372 @@ -185,7 +185,8 @@ static sslOptions ssl_defaults = { |
408 @@ -185,6 +185,7 @@ static sslOptions ssl_defaults = { | |
409 2, /* enableRenegotiation (default: requires extension) */ | 373 2, /* enableRenegotiation (default: requires extension) */ |
410 PR_FALSE, /* requireSafeNegotiation */ | 374 PR_FALSE, /* requireSafeNegotiation */ |
411 PR_FALSE, /* enableFalseStart */ | 375 PR_FALSE, /* enableFalseStart */ |
| 376 - PR_TRUE /* cbcRandomIV */ |
| 377 + PR_TRUE, /* cbcRandomIV */ |
412 + PR_FALSE, /* enableOCSPStapling */ | 378 + PR_FALSE, /* enableOCSPStapling */ |
413 }; | 379 }; |
414 | 380 |
415 sslSessionIDLookupFunc ssl_sid_lookup; | 381 sslSessionIDLookupFunc ssl_sid_lookup; |
416 @@ -738,6 +739,10 @@ SSL_OptionSet(PRFileDesc *fd, PRInt32 which, PRBool on) | 382 @@ -741,6 +742,10 @@ SSL_OptionSet(PRFileDesc *fd, PRInt32 wh |
417 » ss->opt.enableFalseStart = on; | 383 » ss->opt.cbcRandomIV = on; |
418 break; | 384 break; |
419 | 385 |
420 + case SSL_ENABLE_OCSP_STAPLING: | 386 + case SSL_ENABLE_OCSP_STAPLING: |
421 + ss->opt.enableOCSPStapling = on; | 387 + ss->opt.enableOCSPStapling = on; |
422 + break; | 388 + break; |
423 + | 389 + |
424 default: | 390 default: |
425 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 391 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
426 rv = SECFailure; | 392 rv = SECFailure; |
427 @@ -802,6 +807,7 @@ SSL_OptionGet(PRFileDesc *fd, PRInt32 which, PRBool *pOn) | 393 @@ -806,6 +811,7 @@ SSL_OptionGet(PRFileDesc *fd, PRInt32 wh |
428 case SSL_REQUIRE_SAFE_NEGOTIATION: | |
429 on = ss->opt.requireSafeNegotiation; break; | 394 on = ss->opt.requireSafeNegotiation; break; |
430 case SSL_ENABLE_FALSE_START: on = ss->opt.enableFalseStart; break; | 395 case SSL_ENABLE_FALSE_START: on = ss->opt.enableFalseStart; break; |
| 396 case SSL_CBC_RANDOM_IV: on = ss->opt.cbcRandomIV; break; |
431 + case SSL_ENABLE_OCSP_STAPLING: on = ss->opt.enableOCSPStapling; break; | 397 + case SSL_ENABLE_OCSP_STAPLING: on = ss->opt.enableOCSPStapling; break; |
432 | 398 |
433 default: | 399 default: |
434 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 400 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
435 @@ -853,6 +859,9 @@ SSL_OptionGetDefault(PRInt32 which, PRBool *pOn) | 401 @@ -860,6 +866,9 @@ SSL_OptionGetDefault(PRInt32 which, PRBo |
436 on = ssl_defaults.requireSafeNegotiation; | |
437 break; | 402 break; |
438 case SSL_ENABLE_FALSE_START: on = ssl_defaults.enableFalseStart; break; | 403 case SSL_ENABLE_FALSE_START: on = ssl_defaults.enableFalseStart; break; |
| 404 case SSL_CBC_RANDOM_IV: on = ssl_defaults.cbcRandomIV; break; |
439 + case SSL_ENABLE_OCSP_STAPLING: | 405 + case SSL_ENABLE_OCSP_STAPLING: |
440 + on = ssl_defaults.enableOCSPStapling; | 406 + on = ssl_defaults.enableOCSPStapling; |
441 + break; | 407 + break; |
442 | 408 |
443 default: | 409 default: |
444 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 410 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
445 @@ -1000,6 +1009,10 @@ SSL_OptionSetDefault(PRInt32 which, PRBool on) | 411 @@ -1019,6 +1028,10 @@ SSL_OptionSetDefault(PRInt32 which, PRBo |
446 » ssl_defaults.enableFalseStart = on; | 412 » ssl_defaults.cbcRandomIV = on; |
447 break; | 413 break; |
448 | 414 |
449 + case SSL_ENABLE_OCSP_STAPLING: | 415 + case SSL_ENABLE_OCSP_STAPLING: |
450 + ssl_defaults.enableOCSPStapling = on; | 416 + ssl_defaults.enableOCSPStapling = on; |
451 + break; | 417 + break; |
452 + | 418 + |
453 default: | 419 default: |
454 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 420 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
455 return SECFailure; | 421 return SECFailure; |
456 @@ -1453,6 +1466,36 @@ loser: | 422 @@ -1537,6 +1550,36 @@ loser: |
457 #endif | 423 #endif |
458 } | 424 } |
459 | 425 |
460 +SECStatus | 426 +SECStatus |
461 +SSL_GetStapledOCSPResponse(PRFileDesc *fd, unsigned char *out_data, | 427 +SSL_GetStapledOCSPResponse(PRFileDesc *fd, unsigned char *out_data, |
462 + unsigned int *len) { | 428 + unsigned int *len) { |
463 + sslSocket *ss = ssl_FindSocket(fd); | 429 + sslSocket *ss = ssl_FindSocket(fd); |
464 + | 430 + |
465 + if (!ss) { | 431 + if (!ss) { |
466 + SSL_DBG(("%d: SSL[%d]: bad socket in SSL_GetStapledOCSPResponse", | 432 + SSL_DBG(("%d: SSL[%d]: bad socket in SSL_GetStapledOCSPResponse", |
(...skipping 16 matching lines...) Expand all Loading... |
483 + | 449 + |
484 + ssl_ReleaseSSL3HandshakeLock(ss); | 450 + ssl_ReleaseSSL3HandshakeLock(ss); |
485 + ssl_Release1stHandshakeLock(ss); | 451 + ssl_Release1stHandshakeLock(ss); |
486 + | 452 + |
487 + return SECSuccess; | 453 + return SECSuccess; |
488 +} | 454 +} |
489 + | 455 + |
490 /************************************************************************/ | 456 /************************************************************************/ |
491 /* The following functions are the TOP LEVEL SSL functions. | 457 /* The following functions are the TOP LEVEL SSL functions. |
492 ** They all get called through the NSPRIOMethods table below. | 458 ** They all get called through the NSPRIOMethods table below. |
493 diff --git a/mozilla/security/nss/lib/ssl/sslt.h b/mozilla/security/nss/lib/ssl/
sslt.h | 459 diff -up a/src/net/third_party/nss/ssl/sslt.h b/src/net/third_party/nss/ssl/sslt
.h |
494 index f6e0b62..917c093 100644 | 460 --- a/src/net/third_party/nss/ssl/sslt.h» 2012-02-15 13:52:08.000000000 -0
800 |
495 --- a/mozilla/security/nss/lib/ssl/sslt.h | 461 +++ b/src/net/third_party/nss/ssl/sslt.h» 2012-02-28 19:12:51.845953454 -0
800 |
496 +++ b/mozilla/security/nss/lib/ssl/sslt.h | |
497 @@ -198,6 +198,7 @@ typedef enum { | 462 @@ -198,6 +198,7 @@ typedef enum { |
498 /* Update SSL_MAX_EXTENSIONS whenever a new extension type is added. */ | 463 /* Update SSL_MAX_EXTENSIONS whenever a new extension type is added. */ |
499 typedef enum { | 464 typedef enum { |
500 ssl_server_name_xtn = 0, | 465 ssl_server_name_xtn = 0, |
501 + ssl_cert_status_xtn = 5, | 466 + ssl_cert_status_xtn = 5, |
502 #ifdef NSS_ENABLE_ECC | 467 #ifdef NSS_ENABLE_ECC |
503 ssl_elliptic_curves_xtn = 10, | 468 ssl_elliptic_curves_xtn = 10, |
504 ssl_ec_point_formats_xtn = 11, | 469 ssl_ec_point_formats_xtn = 11, |
505 @@ -207,6 +208,6 @@ typedef enum { | 470 @@ -207,6 +208,6 @@ typedef enum { |
506 ssl_renegotiation_info_xtn = 0xff01 /* experimental number */ | 471 ssl_renegotiation_info_xtn = 0xff01 /* experimental number */ |
507 } SSLExtensionType; | 472 } SSLExtensionType; |
508 | 473 |
509 -#define SSL_MAX_EXTENSIONS 6 | 474 -#define SSL_MAX_EXTENSIONS 6 |
510 +#define SSL_MAX_EXTENSIONS 7 | 475 +#define SSL_MAX_EXTENSIONS 7 |
511 | 476 |
512 #endif /* __sslt_h_ */ | 477 #endif /* __sslt_h_ */ |
OLD | NEW |