| OLD | NEW |
| 1 diff --git a/net/third_party/nss/ssl/ssl.h b/net/third_party/nss/ssl/ssl.h | 1 diff -pu a/nss/lib/ssl/ssl3con.c b/nss/lib/ssl/ssl3con.c |
| 2 index 67cc3a7..4cf02aa 100644 | 2 --- a/nss/lib/ssl/ssl3con.c» 2014-01-03 19:03:55.547150312 -0800 |
| 3 --- a/net/third_party/nss/ssl/ssl.h | 3 +++ b/nss/lib/ssl/ssl3con.c» 2014-01-03 19:04:31.257733748 -0800 |
| 4 +++ b/net/third_party/nss/ssl/ssl.h | 4 @@ -6681,10 +6681,22 @@ ssl3_HandleServerHello(sslSocket *ss, SS |
| 5 @@ -161,6 +161,8 @@ SSL_IMPORT PRFileDesc *DTLS_ImportFD(PRFileDesc *model, PRFi
leDesc *fd); | |
| 6 */ | |
| 7 #define SSL_CBC_RANDOM_IV 23 | |
| 8 #define SSL_ENABLE_OCSP_STAPLING 24 /* Request OCSP stapling (client) */ | |
| 9 +/* Request Signed Certificate Timestamps via TLS extension (client) */ | |
| 10 +#define SSL_ENABLE_SIGNED_CERT_TIMESTAMPS 25 | |
| 11 | |
| 12 #ifdef SSL_DEPRECATED_FUNCTION | |
| 13 /* Old deprecated function names */ | |
| 14 @@ -464,6 +466,23 @@ SSL_IMPORT CERTCertList *SSL_PeerCertificateChain(PRFileDes
c *fd); | |
| 15 */ | |
| 16 SSL_IMPORT const SECItemArray * SSL_PeerStapledOCSPResponses(PRFileDesc *fd); | |
| 17 | |
| 18 +/* SSL_PeerSignedCertTimestamps returns the signed_certificate_timestamp | |
| 19 + * extension data provided by the TLS server. The return value is a pointer | |
| 20 + * to an internal SECItem that contains the returned response (as a serialized | |
| 21 + * SignedCertificateTimestampList, see RFC 6962). The returned pointer is only | |
| 22 + * valid until the callback function that calls SSL_PeerSignedCertTimestamps | |
| 23 + * (e.g. the authenticate certificate hook, or the handshake callback) returns. | |
| 24 + * | |
| 25 + * If no Signed Certificate Timestamps were given by the server then the result | |
| 26 + * will be empty. If there was an error, then the result will be NULL. | |
| 27 + * | |
| 28 + * You must set the SSL_ENABLE_SIGNED_CERT_TIMESTAMPS option to indicate suppor
t | |
| 29 + * for Signed Certificate Timestamps to a server. | |
| 30 + * | |
| 31 + * libssl does not do any parsing or validation of the response itself. | |
| 32 + */ | |
| 33 +SSL_IMPORT const SECItem * SSL_PeerSignedCertTimestamps(PRFileDesc *fd); | |
| 34 + | |
| 35 /* SSL_SetStapledOCSPResponses stores an array of one or multiple OCSP response
s | |
| 36 * in the fd's data, which may be sent as part of a server side cert_status | |
| 37 * handshake message. Parameter |responses| is for the server certificate of | |
| 38 diff --git a/net/third_party/nss/ssl/ssl3con.c b/net/third_party/nss/ssl/ssl3con
.c | |
| 39 index 0f1eea4..c2d9eeb 100644 | |
| 40 --- a/net/third_party/nss/ssl/ssl3con.c | |
| 41 +++ b/net/third_party/nss/ssl/ssl3con.c | |
| 42 @@ -6639,10 +6639,22 @@ ssl3_HandleServerHello(sslSocket *ss, SSL3Opaque *b, PRU
int32 length) | |
| 43 sid->u.ssl3.sessionIDLength = sidBytes.len; | 5 sid->u.ssl3.sessionIDLength = sidBytes.len; |
| 44 PORT_Memcpy(sid->u.ssl3.sessionID, sidBytes.data, sidBytes.len); | 6 PORT_Memcpy(sid->u.ssl3.sessionID, sidBytes.data, sidBytes.len); |
| 45 | 7 |
| 46 + /* Copy Signed Certificate Timestamps, if any. */ | 8 + /* Copy Signed Certificate Timestamps, if any. */ |
| 47 + if (ss->xtnData.signedCertTimestamps.data) { | 9 + if (ss->xtnData.signedCertTimestamps.data) { |
| 48 + rv = SECITEM_CopyItem(NULL, &sid->u.ssl3.signedCertTimestamps, | 10 + rv = SECITEM_CopyItem(NULL, &sid->u.ssl3.signedCertTimestamps, |
| 49 + &ss->xtnData.signedCertTimestamps); | 11 + &ss->xtnData.signedCertTimestamps); |
| 50 + if (rv != SECSuccess) | 12 + if (rv != SECSuccess) |
| 51 + goto loser; | 13 + goto loser; |
| 52 + } | 14 + } |
| 53 + | 15 + |
| 54 ss->ssl3.hs.isResuming = PR_FALSE; | 16 ss->ssl3.hs.isResuming = PR_FALSE; |
| 55 ss->ssl3.hs.ws = wait_server_cert; | 17 ss->ssl3.hs.ws = wait_server_cert; |
| 56 | 18 |
| 57 winner: | 19 winner: |
| 58 + /* Clean up the temporary pointer to the handshake buffer. */ | 20 + /* Clean up the temporary pointer to the handshake buffer. */ |
| 59 + ss->xtnData.signedCertTimestamps.data = NULL; | 21 + ss->xtnData.signedCertTimestamps.data = NULL; |
| 60 + ss->xtnData.signedCertTimestamps.len = 0; | 22 + ss->xtnData.signedCertTimestamps.len = 0; |
| 61 + | 23 + |
| 62 /* If we will need a ChannelID key then we make the callback now. This | 24 /* If we will need a ChannelID key then we make the callback now. This |
| 63 * allows the handshake to be restarted cleanly if the callback returns | 25 * allows the handshake to be restarted cleanly if the callback returns |
| 64 * SECWouldBlock. */ | 26 * SECWouldBlock. */ |
| 65 @@ -6668,6 +6680,9 @@ alert_loser: | 27 @@ -6710,6 +6722,9 @@ alert_loser: |
| 66 (void)SSL3_SendAlert(ss, alert_fatal, desc); | 28 (void)SSL3_SendAlert(ss, alert_fatal, desc); |
| 67 | 29 |
| 68 loser: | 30 loser: |
| 69 + /* Clean up the temporary pointer to the handshake buffer. */ | 31 + /* Clean up the temporary pointer to the handshake buffer. */ |
| 70 + ss->xtnData.signedCertTimestamps.data = NULL; | 32 + ss->xtnData.signedCertTimestamps.data = NULL; |
| 71 + ss->xtnData.signedCertTimestamps.len = 0; | 33 + ss->xtnData.signedCertTimestamps.len = 0; |
| 72 errCode = ssl_MapLowLevelError(errCode); | 34 errCode = ssl_MapLowLevelError(errCode); |
| 73 return SECFailure; | 35 return SECFailure; |
| 74 } | 36 } |
| 75 diff --git a/net/third_party/nss/ssl/ssl3ext.c b/net/third_party/nss/ssl/ssl3ext
.c | 37 diff -pu a/nss/lib/ssl/ssl3ext.c b/nss/lib/ssl/ssl3ext.c |
| 76 index adb81ed..02e104d 100644 | 38 --- a/nss/lib/ssl/ssl3ext.c» 2014-01-03 19:04:20.207553209 -0800 |
| 77 --- a/net/third_party/nss/ssl/ssl3ext.c | 39 +++ b/nss/lib/ssl/ssl3ext.c» 2014-01-03 19:04:31.257733748 -0800 |
| 78 +++ b/net/third_party/nss/ssl/ssl3ext.c | 40 @@ -81,6 +81,12 @@ static PRInt32 ssl3_ClientSendSigAlgsXtn |
| 79 @@ -81,6 +81,12 @@ static PRInt32 ssl3_ClientSendSigAlgsXtn(sslSocket *ss, PRBoo
l append, | |
| 80 PRUint32 maxBytes); | 41 PRUint32 maxBytes); |
| 81 static SECStatus ssl3_ServerHandleSigAlgsXtn(sslSocket *ss, PRUint16 ex_type, | 42 static SECStatus ssl3_ServerHandleSigAlgsXtn(sslSocket *ss, PRUint16 ex_type, |
| 82 SECItem *data); | 43 SECItem *data); |
| 83 +static PRInt32 ssl3_ClientSendSignedCertTimestampXtn(sslSocket *ss, | 44 +static PRInt32 ssl3_ClientSendSignedCertTimestampXtn(sslSocket *ss, |
| 84 + PRBool append, | 45 + PRBool append, |
| 85 + PRUint32 maxBytes); | 46 + PRUint32 maxBytes); |
| 86 +static SECStatus ssl3_ClientHandleSignedCertTimestampXtn(sslSocket *ss, | 47 +static SECStatus ssl3_ClientHandleSignedCertTimestampXtn(sslSocket *ss, |
| 87 + PRUint16 ex_type, | 48 + PRUint16 ex_type, |
| 88 + SECItem *data); | 49 + SECItem *data); |
| 89 | 50 |
| 90 /* | 51 /* |
| 91 * Write bytes. Using this function means the SECItem structure | 52 * Write bytes. Using this function means the SECItem structure |
| 92 @@ -259,6 +265,8 @@ static const ssl3HelloExtensionHandler serverHelloHandlersTL
S[] = { | 53 @@ -259,6 +265,8 @@ static const ssl3HelloExtensionHandler s |
| 93 { ssl_use_srtp_xtn, &ssl3_HandleUseSRTPXtn }, | 54 { ssl_use_srtp_xtn, &ssl3_HandleUseSRTPXtn }, |
| 94 { ssl_channel_id_xtn, &ssl3_ClientHandleChannelIDXtn }, | 55 { ssl_channel_id_xtn, &ssl3_ClientHandleChannelIDXtn }, |
| 95 { ssl_cert_status_xtn, &ssl3_ClientHandleStatusRequestXtn }, | 56 { ssl_cert_status_xtn, &ssl3_ClientHandleStatusRequestXtn }, |
| 96 + { ssl_signed_certificate_timestamp_xtn, | 57 + { ssl_signed_certificate_timestamp_xtn, |
| 97 + &ssl3_ClientHandleSignedCertTimestampXtn }, | 58 + &ssl3_ClientHandleSignedCertTimestampXtn }, |
| 98 { -1, NULL } | 59 { -1, NULL } |
| 99 }; | 60 }; |
| 100 | 61 |
| 101 @@ -287,7 +295,9 @@ ssl3HelloExtensionSender clientHelloSendersTLS[SSL_MAX_EXTEN
SIONS] = { | 62 @@ -287,7 +295,9 @@ ssl3HelloExtensionSender clientHelloSend |
| 102 { ssl_use_srtp_xtn, &ssl3_SendUseSRTPXtn }, | 63 { ssl_use_srtp_xtn, &ssl3_SendUseSRTPXtn }, |
| 103 { ssl_channel_id_xtn, &ssl3_ClientSendChannelIDXtn }, | 64 { ssl_channel_id_xtn, &ssl3_ClientSendChannelIDXtn }, |
| 104 { ssl_cert_status_xtn, &ssl3_ClientSendStatusRequestXtn }, | 65 { ssl_cert_status_xtn, &ssl3_ClientSendStatusRequestXtn }, |
| 105 - { ssl_signature_algorithms_xtn, &ssl3_ClientSendSigAlgsXtn } | 66 - { ssl_signature_algorithms_xtn, &ssl3_ClientSendSigAlgsXtn } |
| 106 + { ssl_signature_algorithms_xtn, &ssl3_ClientSendSigAlgsXtn }, | 67 + { ssl_signature_algorithms_xtn, &ssl3_ClientSendSigAlgsXtn }, |
| 107 + { ssl_signed_certificate_timestamp_xtn, | 68 + { ssl_signed_certificate_timestamp_xtn, |
| 108 + &ssl3_ClientSendSignedCertTimestampXtn } | 69 + &ssl3_ClientSendSignedCertTimestampXtn } |
| 109 /* any extra entries will appear as { 0, NULL } */ | 70 /* any extra entries will appear as { 0, NULL } */ |
| 110 }; | 71 }; |
| 111 | 72 |
| 112 @@ -2364,3 +2374,65 @@ ssl3_AppendPaddingExtension(sslSocket *ss, unsigned int e
xtensionLen, | 73 @@ -2372,3 +2382,65 @@ ssl3_AppendPaddingExtension(sslSocket *s |
| 113 | 74 |
| 114 return extensionLen; | 75 return extensionLen; |
| 115 } | 76 } |
| 116 + | 77 + |
| 117 +/* ssl3_ClientSendSignedCertTimestampXtn sends the signed_certificate_timestamp | 78 +/* ssl3_ClientSendSignedCertTimestampXtn sends the signed_certificate_timestamp |
| 118 + * extension for TLS ClientHellos. */ | 79 + * extension for TLS ClientHellos. */ |
| 119 +static PRInt32 | 80 +static PRInt32 |
| 120 +ssl3_ClientSendSignedCertTimestampXtn(sslSocket *ss, PRBool append, | 81 +ssl3_ClientSendSignedCertTimestampXtn(sslSocket *ss, PRBool append, |
| 121 + PRUint32 maxBytes) | 82 + PRUint32 maxBytes) |
| 122 +{ | 83 +{ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 + | 129 + |
| 169 + if (!data->len) { | 130 + if (!data->len) { |
| 170 + /* Empty extension data: RFC 6962 mandates non-empty contents. */ | 131 + /* Empty extension data: RFC 6962 mandates non-empty contents. */ |
| 171 + return SECFailure; | 132 + return SECFailure; |
| 172 + } | 133 + } |
| 173 + *scts = *data; | 134 + *scts = *data; |
| 174 + /* Keep track of negotiated extensions. */ | 135 + /* Keep track of negotiated extensions. */ |
| 175 + ss->xtnData.negotiated[ss->xtnData.numNegotiated++] = ex_type; | 136 + ss->xtnData.negotiated[ss->xtnData.numNegotiated++] = ex_type; |
| 176 + return SECSuccess; | 137 + return SECSuccess; |
| 177 +} | 138 +} |
| 178 diff --git a/net/third_party/nss/ssl/sslimpl.h b/net/third_party/nss/ssl/sslimpl
.h | 139 diff -pu a/nss/lib/ssl/ssl.h b/nss/lib/ssl/ssl.h |
| 179 index 79aca60..1e4655f 100644 | 140 --- a/nss/lib/ssl/ssl.h»2014-01-03 18:58:03.661401846 -0800 |
| 180 --- a/net/third_party/nss/ssl/sslimpl.h | 141 +++ b/nss/lib/ssl/ssl.h»2014-01-03 19:04:31.257733748 -0800 |
| 181 +++ b/net/third_party/nss/ssl/sslimpl.h | 142 @@ -161,6 +161,8 @@ SSL_IMPORT PRFileDesc *DTLS_ImportFD(PRF |
| 143 */ |
| 144 #define SSL_CBC_RANDOM_IV 23 |
| 145 #define SSL_ENABLE_OCSP_STAPLING 24 /* Request OCSP stapling (client) */ |
| 146 +/* Request Signed Certificate Timestamps via TLS extension (client) */ |
| 147 +#define SSL_ENABLE_SIGNED_CERT_TIMESTAMPS 25 |
| 148 |
| 149 #ifdef SSL_DEPRECATED_FUNCTION |
| 150 /* Old deprecated function names */ |
| 151 @@ -464,6 +466,23 @@ SSL_IMPORT CERTCertList *SSL_PeerCertifi |
| 152 */ |
| 153 SSL_IMPORT const SECItemArray * SSL_PeerStapledOCSPResponses(PRFileDesc *fd); |
| 154 |
| 155 +/* SSL_PeerSignedCertTimestamps returns the signed_certificate_timestamp |
| 156 + * extension data provided by the TLS server. The return value is a pointer |
| 157 + * to an internal SECItem that contains the returned response (as a serialized |
| 158 + * SignedCertificateTimestampList, see RFC 6962). The returned pointer is only |
| 159 + * valid until the callback function that calls SSL_PeerSignedCertTimestamps |
| 160 + * (e.g. the authenticate certificate hook, or the handshake callback) returns. |
| 161 + * |
| 162 + * If no Signed Certificate Timestamps were given by the server then the result |
| 163 + * will be empty. If there was an error, then the result will be NULL. |
| 164 + * |
| 165 + * You must set the SSL_ENABLE_SIGNED_CERT_TIMESTAMPS option to indicate suppor
t |
| 166 + * for Signed Certificate Timestamps to a server. |
| 167 + * |
| 168 + * libssl does not do any parsing or validation of the response itself. |
| 169 + */ |
| 170 +SSL_IMPORT const SECItem * SSL_PeerSignedCertTimestamps(PRFileDesc *fd); |
| 171 + |
| 172 /* SSL_SetStapledOCSPResponses stores an array of one or multiple OCSP response
s |
| 173 * in the fd's data, which may be sent as part of a server side cert_status |
| 174 * handshake message. Parameter |responses| is for the server certificate of |
| 175 diff -pu a/nss/lib/ssl/sslimpl.h b/nss/lib/ssl/sslimpl.h |
| 176 --- a/nss/lib/ssl/sslimpl.h» 2014-01-03 19:03:55.557150476 -0800 |
| 177 +++ b/nss/lib/ssl/sslimpl.h» 2014-01-03 19:04:31.257733748 -0800 |
| 182 @@ -312,29 +312,30 @@ typedef struct sslOptionsStr { | 178 @@ -312,29 +312,30 @@ typedef struct sslOptionsStr { |
| 183 * list of supported protocols. */ | 179 * list of supported protocols. */ |
| 184 SECItem nextProtoNego; | 180 SECItem nextProtoNego; |
| 185 | 181 |
| 186 - unsigned int useSecurity : 1; /* 1 */ | 182 - unsigned int useSecurity : 1; /* 1 */ |
| 187 - unsigned int useSocks : 1; /* 2 */ | 183 - unsigned int useSocks : 1; /* 2 */ |
| 188 - unsigned int requestCertificate : 1; /* 3 */ | 184 - unsigned int requestCertificate : 1; /* 3 */ |
| 189 - unsigned int requireCertificate : 2; /* 4-5 */ | 185 - unsigned int requireCertificate : 2; /* 4-5 */ |
| 190 - unsigned int handshakeAsClient : 1; /* 6 */ | 186 - unsigned int handshakeAsClient : 1; /* 6 */ |
| 191 - unsigned int handshakeAsServer : 1; /* 7 */ | 187 - unsigned int handshakeAsServer : 1; /* 7 */ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 + unsigned int enableDeflate : 1; /* 19 */ | 222 + unsigned int enableDeflate : 1; /* 19 */ |
| 227 + unsigned int enableRenegotiation : 2; /* 20-21 */ | 223 + unsigned int enableRenegotiation : 2; /* 20-21 */ |
| 228 + unsigned int requireSafeNegotiation : 1; /* 22 */ | 224 + unsigned int requireSafeNegotiation : 1; /* 22 */ |
| 229 + unsigned int enableFalseStart : 1; /* 23 */ | 225 + unsigned int enableFalseStart : 1; /* 23 */ |
| 230 + unsigned int cbcRandomIV : 1; /* 24 */ | 226 + unsigned int cbcRandomIV : 1; /* 24 */ |
| 231 + unsigned int enableOCSPStapling : 1; /* 25 */ | 227 + unsigned int enableOCSPStapling : 1; /* 25 */ |
| 232 + unsigned int enableSignedCertTimestamps : 1; /* 26 */ | 228 + unsigned int enableSignedCertTimestamps : 1; /* 26 */ |
| 233 } sslOptions; | 229 } sslOptions; |
| 234 | 230 |
| 235 typedef enum { sslHandshakingUndetermined = 0, | 231 typedef enum { sslHandshakingUndetermined = 0, |
| 236 @@ -713,6 +714,11 @@ struct sslSessionIDStr { | 232 @@ -717,6 +718,11 @@ struct sslSessionIDStr { |
| 237 * negotiated as it's used to bind the ChannelID signature on the | |
| 238 * resumption handshake to the original handshake. */ | 233 * resumption handshake to the original handshake. */ |
| 239 SECItem originalHandshakeHash; | 234 SECItem originalHandshakeHash; |
| 240 + | 235 |
| 241 + /* Signed certificate timestamps received in a TLS extension. | 236 + /* Signed certificate timestamps received in a TLS extension. |
| 242 + ** (used only in client). | 237 + ** (used only in client). |
| 243 + */ | 238 + */ |
| 244 + SECItem signedCertTimestamps; | 239 + SECItem signedCertTimestamps; |
| 245 » } ssl3; | 240 + |
| 246 } u; | 241 » /* This lock is lazily initialized by CacheSID when a sid is first |
| 247 }; | 242 » * cached. Before then, there is no need to lock anything because |
| 248 @@ -804,6 +810,18 @@ struct TLSExtensionDataStr { | 243 » * the sid isn't being shared by anything. |
| 244 @@ -825,6 +831,18 @@ struct TLSExtensionDataStr { |
| 249 * is beyond ssl3_HandleClientHello function. */ | 245 * is beyond ssl3_HandleClientHello function. */ |
| 250 SECItem *sniNameArr; | 246 SECItem *sniNameArr; |
| 251 PRUint32 sniNameArrSize; | 247 PRUint32 sniNameArrSize; |
| 252 + | 248 + |
| 253 + /* Signed Certificate Timestamps extracted from the TLS extension. | 249 + /* Signed Certificate Timestamps extracted from the TLS extension. |
| 254 + * (client only). | 250 + * (client only). |
| 255 + * This container holds a temporary pointer to the extension data, | 251 + * This container holds a temporary pointer to the extension data, |
| 256 + * until a session structure (the sec.ci.sid of an sslSocket) is setup | 252 + * until a session structure (the sec.ci.sid of an sslSocket) is setup |
| 257 + * that can hold a permanent copy of the data | 253 + * that can hold a permanent copy of the data |
| 258 + * (in sec.ci.sid.u.ssl3.signedCertTimestamps). | 254 + * (in sec.ci.sid.u.ssl3.signedCertTimestamps). |
| 259 + * The data pointed to by this structure is neither explicitly allocated | 255 + * The data pointed to by this structure is neither explicitly allocated |
| 260 + * nor copied: the pointer points to the handshake message buffer and is | 256 + * nor copied: the pointer points to the handshake message buffer and is |
| 261 + * only valid in the scope of ssl3_HandleServerHello. | 257 + * only valid in the scope of ssl3_HandleServerHello. |
| 262 + */ | 258 + */ |
| 263 + SECItem signedCertTimestamps; | 259 + SECItem signedCertTimestamps; |
| 264 }; | 260 }; |
| 265 | 261 |
| 266 typedef SECStatus (*sslRestartTarget)(sslSocket *); | 262 typedef SECStatus (*sslRestartTarget)(sslSocket *); |
| 267 diff --git a/net/third_party/nss/ssl/sslnonce.c b/net/third_party/nss/ssl/sslnon
ce.c | 263 diff -pu a/nss/lib/ssl/sslnonce.c b/nss/lib/ssl/sslnonce.c |
| 268 index eb5004c..1ca19ca 100644 | 264 --- a/nss/lib/ssl/sslnonce.c» 2014-01-03 19:03:25.356657071 -0800 |
| 269 --- a/net/third_party/nss/ssl/sslnonce.c | 265 +++ b/nss/lib/ssl/sslnonce.c» 2014-01-03 19:05:48.568996889 -0800 |
| 270 +++ b/net/third_party/nss/ssl/sslnonce.c | 266 @@ -133,6 +133,9 @@ ssl_DestroySID(sslSessionID *sid) |
| 271 @@ -122,7 +122,21 @@ ssl_DestroySID(sslSessionID *sid) | 267 if (sid->u.ssl3.originalHandshakeHash.data) { |
| 272 if (sid->version < SSL_LIBRARY_VERSION_3_0) { | 268 SECITEM_FreeItem(&sid->u.ssl3.originalHandshakeHash, PR_FALSE); |
| 273 » SECITEM_ZfreeItem(&sid->u.ssl2.masterKey, PR_FALSE); | 269 } |
| 274 » SECITEM_ZfreeItem(&sid->u.ssl2.cipherArg, PR_FALSE); | 270 + if (sid->u.ssl3.signedCertTimestamps.data) { |
| 275 + } else { | 271 + SECITEM_FreeItem(&sid->u.ssl3.signedCertTimestamps, PR_FALSE); |
| 276 +» if (sid->u.ssl3.sessionTicket.ticket.data) { | 272 + } |
| 277 +» SECITEM_FreeItem(&sid->u.ssl3.sessionTicket.ticket, PR_FALSE); | |
| 278 +» } | |
| 279 +» if (sid->u.ssl3.srvName.data) { | |
| 280 +» SECITEM_FreeItem(&sid->u.ssl3.srvName, PR_FALSE); | |
| 281 +» } | |
| 282 +» if (sid->u.ssl3.signedCertTimestamps.data) { | |
| 283 +» SECITEM_FreeItem(&sid->u.ssl3.signedCertTimestamps, PR_FALSE); | |
| 284 +» } | |
| 285 +» if (sid->u.ssl3.originalHandshakeHash.data) { | |
| 286 +» SECITEM_FreeItem(&sid->u.ssl3.originalHandshakeHash, PR_FALSE); | |
| 287 +» } | |
| 288 } | |
| 289 + | |
| 290 if (sid->peerID != NULL) | |
| 291 » PORT_Free((void *)sid->peerID);»» /* CONST */ | |
| 292 | 273 |
| 293 @@ -142,16 +156,7 @@ ssl_DestroySID(sslSessionID *sid) | 274 if (sid->u.ssl3.lock) { |
| 294 if ( sid->localCert ) { | 275 PR_DestroyRWLock(sid->u.ssl3.lock); |
| 295 » CERT_DestroyCertificate(sid->localCert); | 276 diff -pu a/nss/lib/ssl/sslsock.c b/nss/lib/ssl/sslsock.c |
| 296 } | 277 --- a/nss/lib/ssl/sslsock.c» 2014-01-03 18:57:38.240986619 -0800 |
| 297 - if (sid->u.ssl3.sessionTicket.ticket.data) { | 278 +++ b/nss/lib/ssl/sslsock.c» 2014-01-03 19:06:53.560058775 -0800 |
| 298 -» SECITEM_FreeItem(&sid->u.ssl3.sessionTicket.ticket, PR_FALSE); | 279 @@ -85,7 +85,8 @@ static sslOptions ssl_defaults = { |
| 299 - } | |
| 300 - if (sid->u.ssl3.srvName.data) { | |
| 301 -» SECITEM_FreeItem(&sid->u.ssl3.srvName, PR_FALSE); | |
| 302 - } | |
| 303 - if (sid->u.ssl3.originalHandshakeHash.data) { | |
| 304 -» SECITEM_FreeItem(&sid->u.ssl3.originalHandshakeHash, PR_FALSE); | |
| 305 - } | |
| 306 - | |
| 307 + | |
| 308 PORT_ZFree(sid, sizeof(sslSessionID)); | |
| 309 } | |
| 310 | |
| 311 diff --git a/net/third_party/nss/ssl/sslsock.c b/net/third_party/nss/ssl/sslsock
.c | |
| 312 index b5c17f0..965215d 100644 | |
| 313 --- a/net/third_party/nss/ssl/sslsock.c | |
| 314 +++ b/net/third_party/nss/ssl/sslsock.c | |
| 315 @@ -173,7 +173,8 @@ static sslOptions ssl_defaults = { | |
| 316 PR_FALSE, /* requireSafeNegotiation */ | 280 PR_FALSE, /* requireSafeNegotiation */ |
| 317 PR_FALSE, /* enableFalseStart */ | 281 PR_FALSE, /* enableFalseStart */ |
| 318 PR_TRUE, /* cbcRandomIV */ | 282 PR_TRUE, /* cbcRandomIV */ |
| 319 - PR_FALSE /* enableOCSPStapling */ | 283 - PR_FALSE /* enableOCSPStapling */ |
| 320 + PR_FALSE, /* enableOCSPStapling */ | 284 + PR_FALSE, /* enableOCSPStapling */ |
| 321 + PR_FALSE /* enableSignedCertTimestamps */ | 285 + PR_FALSE /* enableSignedCertTimestamps */ |
| 322 }; | 286 }; |
| 323 | 287 |
| 324 /* | 288 /* |
| 325 @@ -865,6 +866,10 @@ SSL_OptionSet(PRFileDesc *fd, PRInt32 which, PRBool on) | 289 @@ -777,6 +778,10 @@ SSL_OptionSet(PRFileDesc *fd, PRInt32 wh |
| 326 ss->opt.enableOCSPStapling = on; | 290 ss->opt.enableOCSPStapling = on; |
| 327 break; | 291 break; |
| 328 | 292 |
| 329 + case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS: | 293 + case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS: |
| 330 + ss->opt.enableSignedCertTimestamps = on; | 294 + ss->opt.enableSignedCertTimestamps = on; |
| 331 + break; | 295 + break; |
| 332 + | 296 + |
| 333 default: | 297 default: |
| 334 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 298 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 335 rv = SECFailure; | 299 rv = SECFailure; |
| 336 @@ -935,6 +940,9 @@ SSL_OptionGet(PRFileDesc *fd, PRInt32 which, PRBool *pOn) | 300 @@ -847,6 +852,9 @@ SSL_OptionGet(PRFileDesc *fd, PRInt32 wh |
| 337 case SSL_ENABLE_FALSE_START: on = ss->opt.enableFalseStart; break; | 301 case SSL_ENABLE_FALSE_START: on = ss->opt.enableFalseStart; break; |
| 338 case SSL_CBC_RANDOM_IV: on = ss->opt.cbcRandomIV; break; | 302 case SSL_CBC_RANDOM_IV: on = ss->opt.cbcRandomIV; break; |
| 339 case SSL_ENABLE_OCSP_STAPLING: on = ss->opt.enableOCSPStapling; break; | 303 case SSL_ENABLE_OCSP_STAPLING: on = ss->opt.enableOCSPStapling; break; |
| 340 + case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS: | 304 + case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS: |
| 341 + on = ss->opt.enableSignedCertTimestamps; | 305 + on = ss->opt.enableSignedCertTimestamps; |
| 342 + break; | 306 + break; |
| 343 | 307 |
| 344 default: | 308 default: |
| 345 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 309 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 346 @@ -996,6 +1004,9 @@ SSL_OptionGetDefault(PRInt32 which, PRBool *pOn) | 310 @@ -908,6 +916,9 @@ SSL_OptionGetDefault(PRInt32 which, PRBo |
| 347 case SSL_ENABLE_OCSP_STAPLING: | 311 case SSL_ENABLE_OCSP_STAPLING: |
| 348 on = ssl_defaults.enableOCSPStapling; | 312 on = ssl_defaults.enableOCSPStapling; |
| 349 break; | 313 break; |
| 350 + case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS: | 314 + case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS: |
| 351 + on = ssl_defaults.enableSignedCertTimestamps; | 315 + on = ssl_defaults.enableSignedCertTimestamps; |
| 352 + break; | 316 + break; |
| 353 | 317 |
| 354 default: | 318 default: |
| 355 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 319 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 356 @@ -1163,6 +1174,10 @@ SSL_OptionSetDefault(PRInt32 which, PRBool on) | 320 @@ -1075,6 +1086,10 @@ SSL_OptionSetDefault(PRInt32 which, PRBo |
| 357 ssl_defaults.enableOCSPStapling = on; | 321 ssl_defaults.enableOCSPStapling = on; |
| 358 break; | 322 break; |
| 359 | 323 |
| 360 + case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS: | 324 + case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS: |
| 361 + ssl_defaults.enableSignedCertTimestamps = on; | 325 + ssl_defaults.enableSignedCertTimestamps = on; |
| 362 + break; | 326 + break; |
| 363 + | 327 + |
| 364 default: | 328 default: |
| 365 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 329 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 366 return SECFailure; | 330 return SECFailure; |
| 367 @@ -1993,6 +2008,29 @@ SSL_PeerStapledOCSPResponses(PRFileDesc *fd) | 331 @@ -1899,6 +1914,29 @@ SSL_PeerStapledOCSPResponses(PRFileDesc |
| 368 return &ss->sec.ci.sid->peerCertStatus; | 332 return &ss->sec.ci.sid->peerCertStatus; |
| 369 } | 333 } |
| 370 | 334 |
| 371 +const SECItem * | 335 +const SECItem * |
| 372 +SSL_PeerSignedCertTimestamps(PRFileDesc *fd) | 336 +SSL_PeerSignedCertTimestamps(PRFileDesc *fd) |
| 373 +{ | 337 +{ |
| 374 + sslSocket *ss = ssl_FindSocket(fd); | 338 + sslSocket *ss = ssl_FindSocket(fd); |
| 375 + | 339 + |
| 376 + if (!ss) { | 340 + if (!ss) { |
| 377 + SSL_DBG(("%d: SSL[%d]: bad socket in SSL_PeerSignedCertTimestamps", | 341 + SSL_DBG(("%d: SSL[%d]: bad socket in SSL_PeerSignedCertTimestamps", |
| 378 + SSL_GETPID(), fd)); | 342 + SSL_GETPID(), fd)); |
| 379 + return NULL; | 343 + return NULL; |
| 380 + } | 344 + } |
| 381 + | 345 + |
| 382 + if (!ss->sec.ci.sid) { | 346 + if (!ss->sec.ci.sid) { |
| 383 + PORT_SetError(SEC_ERROR_NOT_INITIALIZED); | 347 + PORT_SetError(SEC_ERROR_NOT_INITIALIZED); |
| 384 + return NULL; | 348 + return NULL; |
| 385 + } | 349 + } |
| 386 + | 350 + |
| 387 + if (ss->sec.ci.sid->version < SSL_LIBRARY_VERSION_3_0) { | 351 + if (ss->sec.ci.sid->version < SSL_LIBRARY_VERSION_3_0) { |
| 388 + PORT_SetError(SSL_ERROR_FEATURE_NOT_SUPPORTED_FOR_SSL2); | 352 + PORT_SetError(SSL_ERROR_FEATURE_NOT_SUPPORTED_FOR_SSL2); |
| 389 + return NULL; | 353 + return NULL; |
| 390 + } | 354 + } |
| 391 + return &ss->sec.ci.sid->u.ssl3.signedCertTimestamps; | 355 + return &ss->sec.ci.sid->u.ssl3.signedCertTimestamps; |
| 392 +} | 356 +} |
| 393 + | 357 + |
| 394 SECStatus | 358 SECStatus |
| 395 SSL_HandshakeResumedSession(PRFileDesc *fd, PRBool *handshake_resumed) { | 359 SSL_HandshakeResumedSession(PRFileDesc *fd, PRBool *handshake_resumed) { |
| 396 sslSocket *ss = ssl_FindSocket(fd); | 360 sslSocket *ss = ssl_FindSocket(fd); |
| 397 @@ -3133,4 +3171,3 @@ loser: | 361 diff -pu a/nss/lib/ssl/sslt.h b/nss/lib/ssl/sslt.h |
| 398 } | 362 --- a/nss/lib/ssl/sslt.h» 2014-01-03 19:03:55.557150476 -0800 |
| 399 return ss; | 363 +++ b/nss/lib/ssl/sslt.h» 2014-01-03 19:04:31.257733748 -0800 |
| 400 } | |
| 401 - | |
| 402 diff --git a/net/third_party/nss/ssl/sslt.h b/net/third_party/nss/ssl/sslt.h | |
| 403 index b813c04..1f5e2c6 100644 | |
| 404 --- a/net/third_party/nss/ssl/sslt.h | |
| 405 +++ b/net/third_party/nss/ssl/sslt.h | |
| 406 @@ -202,6 +202,7 @@ typedef enum { | 364 @@ -202,6 +202,7 @@ typedef enum { |
| 407 ssl_signature_algorithms_xtn = 13, | 365 ssl_signature_algorithms_xtn = 13, |
| 408 ssl_use_srtp_xtn = 14, | 366 ssl_use_srtp_xtn = 14, |
| 409 ssl_app_layer_protocol_xtn = 16, | 367 ssl_app_layer_protocol_xtn = 16, |
| 410 + ssl_signed_certificate_timestamp_xtn = 18, /* RFC 6962 */ | 368 + ssl_signed_certificate_timestamp_xtn = 18, /* RFC 6962 */ |
| 411 ssl_session_ticket_xtn = 35, | 369 ssl_session_ticket_xtn = 35, |
| 412 ssl_next_proto_nego_xtn = 13172, | 370 ssl_next_proto_nego_xtn = 13172, |
| 413 ssl_channel_id_xtn = 30032, | 371 ssl_channel_id_xtn = 30032, |
| 414 @@ -209,6 +210,6 @@ typedef enum { | 372 @@ -209,6 +210,6 @@ typedef enum { |
| 415 ssl_renegotiation_info_xtn = 0xff01 /* experimental number */ | 373 ssl_renegotiation_info_xtn = 0xff01 /* experimental number */ |
| 416 } SSLExtensionType; | 374 } SSLExtensionType; |
| 417 | 375 |
| 418 -#define SSL_MAX_EXTENSIONS 11 /* doesn't include ssl_padding_xtn. *
/ | 376 -#define SSL_MAX_EXTENSIONS 11 /* doesn't include ssl_padding_xtn. *
/ |
| 419 +#define SSL_MAX_EXTENSIONS 12 /* doesn't include ssl_padding_xtn. *
/ | 377 +#define SSL_MAX_EXTENSIONS 12 /* doesn't include ssl_padding_xtn. *
/ |
| 420 | 378 |
| 421 #endif /* __sslt_h_ */ | 379 #endif /* __sslt_h_ */ |
| OLD | NEW |