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

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

Issue 142283002: Update net/third_party/nss to NSS_3_15_5_BETA2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix applypatches.sh mistakes 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» 2014-01-06 14:58:15.904992214 -0800 2 --- a/nss/lib/ssl/ssl3con.c» 2014-01-17 18:06:41.659713513 -0800
3 +++ b/nss/lib/ssl/ssl3con.c» 2014-01-06 14:58:25.635150408 -0800 3 +++ b/nss/lib/ssl/ssl3con.c» 2014-01-17 18:07:10.270188062 -0800
4 @@ -40,6 +40,21 @@ 4 @@ -40,6 +40,21 @@
5 #define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24) 5 #define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24)
6 #endif 6 #endif
7 7
8 +/* This is a bodge to allow this code to be compiled against older NSS 8 +/* This is a bodge to allow this code to be compiled against older NSS
9 + * headers. */ 9 + * headers. */
10 +#ifndef CKM_NSS_CHACHA20_POLY1305 10 +#ifndef CKM_NSS_CHACHA20_POLY1305
11 +#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 26) 11 +#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 26)
12 + 12 +
13 +typedef struct CK_NSS_AEAD_PARAMS { 13 +typedef struct CK_NSS_AEAD_PARAMS {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 - pwSpec->aead = ssl3_AESGCM; 127 - pwSpec->aead = ssl3_AESGCM;
128 + if (calg == calg_aes_gcm) { 128 + if (calg == calg_aes_gcm) {
129 + pwSpec->aead = ssl3_AESGCM; 129 + pwSpec->aead = ssl3_AESGCM;
130 + } else { 130 + } else {
131 + pwSpec->aead = ssl3_ChaCha20Poly1305; 131 + pwSpec->aead = ssl3_ChaCha20Poly1305;
132 + } 132 + }
133 return SECSuccess; 133 return SECSuccess;
134 } 134 }
135 135
136 diff -pu a/nss/lib/ssl/ssl3ecc.c b/nss/lib/ssl/ssl3ecc.c 136 diff -pu a/nss/lib/ssl/ssl3ecc.c b/nss/lib/ssl/ssl3ecc.c
137 --- a/nss/lib/ssl/ssl3ecc.c» 2014-01-06 14:57:50.984587086 -0800 137 --- a/nss/lib/ssl/ssl3ecc.c» 2014-01-17 18:04:43.127747463 -0800
138 +++ b/nss/lib/ssl/ssl3ecc.c» 2014-01-06 14:58:25.635150408 -0800 138 +++ b/nss/lib/ssl/ssl3ecc.c» 2014-01-17 18:07:10.270188062 -0800
139 @@ -904,6 +904,7 @@ static const ssl3CipherSuite ecdhe_ecdsa 139 @@ -904,6 +904,7 @@ static const ssl3CipherSuite ecdhe_ecdsa
140 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 140 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
141 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 141 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
142 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, 142 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
143 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, 143 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
144 TLS_ECDHE_ECDSA_WITH_NULL_SHA, 144 TLS_ECDHE_ECDSA_WITH_NULL_SHA,
145 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, 145 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
146 0 /* end of list marker */ 146 0 /* end of list marker */
147 @@ -915,6 +916,7 @@ static const ssl3CipherSuite ecdhe_rsa_s 147 @@ -915,6 +916,7 @@ static const ssl3CipherSuite ecdhe_rsa_s
148 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, 148 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
(...skipping 13 matching lines...) Expand all
162 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, 162 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
163 @@ -934,6 +937,7 @@ static const ssl3CipherSuite ecSuites[] 163 @@ -934,6 +937,7 @@ static const ssl3CipherSuite ecSuites[]
164 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, 164 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
165 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 165 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
166 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, 166 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
167 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, 167 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
168 TLS_ECDHE_RSA_WITH_NULL_SHA, 168 TLS_ECDHE_RSA_WITH_NULL_SHA,
169 TLS_ECDHE_RSA_WITH_RC4_128_SHA, 169 TLS_ECDHE_RSA_WITH_RC4_128_SHA,
170 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, 170 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,
171 diff -pu a/nss/lib/ssl/sslenum.c b/nss/lib/ssl/sslenum.c 171 diff -pu a/nss/lib/ssl/sslenum.c b/nss/lib/ssl/sslenum.c
172 --- a/nss/lib/ssl/sslenum.c» 2014-01-06 14:53:43.540566574 -0800 172 --- a/nss/lib/ssl/sslenum.c» 2014-01-17 17:49:26.072517368 -0800
173 +++ b/nss/lib/ssl/sslenum.c» 2014-01-06 15:11:13.167642594 -0800 173 +++ b/nss/lib/ssl/sslenum.c» 2014-01-17 18:08:43.791739267 -0800
174 @@ -37,17 +37,21 @@ 174 @@ -37,17 +37,21 @@
175 * 175 *
176 * Exception: Because some servers ignore the high-order byte of the cipher 176 * Exception: Because some servers ignore the high-order byte of the cipher
177 * suite ID, we must be careful about adding cipher suites with IDs larger 177 * suite ID, we must be careful about adding cipher suites with IDs larger
178 - * than 0x00ff; see bug 946147. For these broken servers, the first four cipher 178 - * than 0x00ff; see bug 946147. For these broken servers, the first four cipher
179 + * than 0x00ff; see bug 946147. For these broken servers, the first six cipher 179 + * than 0x00ff; see bug 946147. For these broken servers, the first six cipher
180 * suites, with the MSB zeroed, look like: 180 * suites, with the MSB zeroed, look like:
181 + * TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA { 0x00,0x14 } 181 + * TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA { 0x00,0x14 }
182 + * TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA { 0x00,0x13 } 182 + * TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA { 0x00,0x13 }
183 * TLS_KRB5_EXPORT_WITH_RC4_40_MD5 {0x00,0x2B } 183 * TLS_KRB5_EXPORT_WITH_RC4_40_MD5 { 0x00,0x2B }
184 * TLS_RSA_WITH_AES_128_CBC_SHA { 0x00,0x2F } 184 * TLS_RSA_WITH_AES_128_CBC_SHA { 0x00,0x2F }
185 * TLS_RSA_WITH_3DES_EDE_CBC_SHA { 0x00,0x0A } 185 * TLS_RSA_WITH_3DES_EDE_CBC_SHA { 0x00,0x0A }
186 * TLS_RSA_WITH_DES_CBC_SHA { 0x00,0x09 } 186 * TLS_RSA_WITH_DES_CBC_SHA { 0x00,0x09 }
187 - * The broken server only supports the third and fourth ones and will select 187 - * The broken server only supports the third and fourth ones and will select
188 - * the third one. 188 - * the third one.
189 + * The broken server only supports the fifth and sixth ones and will select 189 + * The broken server only supports the fifth and sixth ones and will select
190 + * the fifth one. 190 + * the fifth one.
191 */ 191 */
192 const PRUint16 SSL_ImplementedCiphers[] = { 192 const PRUint16 SSL_ImplementedCiphers[] = {
193 #ifdef NSS_ENABLE_ECC 193 #ifdef NSS_ENABLE_ECC
194 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, 194 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
195 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, 195 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
196 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 196 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
197 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 197 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
198 /* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA must appear before 198 /* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA must appear before
199 diff -pu a/nss/lib/ssl/sslimpl.h b/nss/lib/ssl/sslimpl.h 199 diff -pu a/nss/lib/ssl/sslimpl.h b/nss/lib/ssl/sslimpl.h
200 --- a/nss/lib/ssl/sslimpl.h» 2014-01-06 14:57:46.654516696 -0800 200 --- a/nss/lib/ssl/sslimpl.h» 2014-01-17 18:03:47.906831535 -0800
201 +++ b/nss/lib/ssl/sslimpl.h» 2014-01-06 14:58:25.635150408 -0800 201 +++ b/nss/lib/ssl/sslimpl.h» 2014-01-17 18:07:10.270188062 -0800
202 @@ -65,6 +65,7 @@ typedef SSLSignType SSL3SignType; 202 @@ -65,6 +65,7 @@ typedef SSLSignType SSL3SignType;
203 #define calg_camellia ssl_calg_camellia 203 #define calg_camellia ssl_calg_camellia
204 #define calg_seed ssl_calg_seed 204 #define calg_seed ssl_calg_seed
205 #define calg_aes_gcm ssl_calg_aes_gcm 205 #define calg_aes_gcm ssl_calg_aes_gcm
206 +#define calg_chacha20 ssl_calg_chacha20 206 +#define calg_chacha20 ssl_calg_chacha20
207 207
208 #define mac_null ssl_mac_null 208 #define mac_null ssl_mac_null
209 #define mac_md5 ssl_mac_md5 209 #define mac_md5 ssl_mac_md5
210 @@ -292,7 +293,7 @@ typedef struct { 210 @@ -299,7 +300,7 @@ typedef struct {
211 } ssl3CipherSuiteCfg; 211 } ssl3CipherSuiteCfg;
212 212
213 #ifdef NSS_ENABLE_ECC 213 #ifdef NSS_ENABLE_ECC
214 -#define ssl_V3_SUITES_IMPLEMENTED 61 214 -#define ssl_V3_SUITES_IMPLEMENTED 61
215 +#define ssl_V3_SUITES_IMPLEMENTED 63 215 +#define ssl_V3_SUITES_IMPLEMENTED 63
216 #else 216 #else
217 #define ssl_V3_SUITES_IMPLEMENTED 37 217 #define ssl_V3_SUITES_IMPLEMENTED 37
218 #endif /* NSS_ENABLE_ECC */ 218 #endif /* NSS_ENABLE_ECC */
219 @@ -474,6 +475,7 @@ typedef enum { 219 @@ -483,6 +484,7 @@ typedef enum {
220 cipher_camellia_256, 220 cipher_camellia_256,
221 cipher_seed, 221 cipher_seed,
222 cipher_aes_128_gcm, 222 cipher_aes_128_gcm,
223 + cipher_chacha20, 223 + cipher_chacha20,
224 cipher_missing /* reserved for no such supported cipher */ 224 cipher_missing /* reserved for no such supported cipher */
225 /* This enum must match ssl3_cipherName[] in ssl3con.c. */ 225 /* This enum must match ssl3_cipherName[] in ssl3con.c. */
226 } SSL3BulkCipher; 226 } SSL3BulkCipher;
227 diff -pu a/nss/lib/ssl/sslinfo.c b/nss/lib/ssl/sslinfo.c 227 diff -pu a/nss/lib/ssl/sslinfo.c b/nss/lib/ssl/sslinfo.c
228 --- a/nss/lib/ssl/sslinfo.c» 2014-01-06 14:57:21.444106895 -0800 228 --- a/nss/lib/ssl/sslinfo.c» 2014-01-17 18:00:45.503806125 -0800
229 +++ b/nss/lib/ssl/sslinfo.c» 2014-01-06 14:58:25.635150408 -0800 229 +++ b/nss/lib/ssl/sslinfo.c» 2014-01-17 18:07:10.270188062 -0800
230 @@ -110,6 +110,7 @@ SSL_GetChannelInfo(PRFileDesc *fd, SSLCh 230 @@ -110,6 +110,7 @@ SSL_GetChannelInfo(PRFileDesc *fd, SSLCh
231 #define C_NULL "NULL", calg_null 231 #define C_NULL "NULL", calg_null
232 #define C_SJ "SKIPJACK", calg_sj 232 #define C_SJ "SKIPJACK", calg_sj
233 #define C_AESGCM "AES-GCM", calg_aes_gcm 233 #define C_AESGCM "AES-GCM", calg_aes_gcm
234 +#define C_CHACHA20 "CHACHA20POLY1305", calg_chacha20 234 +#define C_CHACHA20 "CHACHA20POLY1305", calg_chacha20
235 235
236 #define B_256 256, 256, 256 236 #define B_256 256, 256, 256
237 #define B_128 128, 128, 128 237 #define B_128 128, 128, 128
238 @@ -188,12 +189,14 @@ static const SSLCipherSuiteInfo suiteInf 238 @@ -188,12 +189,14 @@ static const SSLCipherSuiteInfo suiteInf
239 {0,CS(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA), S_ECDSA, K_ECDHE, C_AES, B_128, M _SHA, 1, 0, 0, }, 239 {0,CS(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA), S_ECDSA, K_ECDHE, C_AES, B_128, M _SHA, 1, 0, 0, },
240 {0,CS(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256), S_ECDSA, K_ECDHE, C_AES, B_128, M_SHA256, 1, 0, 0, }, 240 {0,CS(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256), S_ECDSA, K_ECDHE, C_AES, B_128, M_SHA256, 1, 0, 0, },
241 {0,CS(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA), S_ECDSA, K_ECDHE, C_AES, B_256, M _SHA, 1, 0, 0, }, 241 {0,CS(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA), S_ECDSA, K_ECDHE, C_AES, B_256, M _SHA, 1, 0, 0, },
242 +{0,CS(TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305),S_ECDSA,K_ECDHE,C_CHACHA20,B_256, M_AEAD_128,0, 0, 0, }, 242 +{0,CS(TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305),S_ECDSA,K_ECDHE,C_CHACHA20,B_256, M_AEAD_128,0, 0, 0, },
243 243
244 {0,CS(TLS_ECDH_RSA_WITH_NULL_SHA), S_RSA, K_ECDH, C_NULL, B_0, M_SHA , 0, 0, 0, }, 244 {0,CS(TLS_ECDH_RSA_WITH_NULL_SHA), S_RSA, K_ECDH, C_NULL, B_0, M_SHA , 0, 0, 0, },
245 {0,CS(TLS_ECDH_RSA_WITH_RC4_128_SHA), S_RSA, K_ECDH, C_RC4, B_128, M_SH A, 0, 0, 0, }, 245 {0,CS(TLS_ECDH_RSA_WITH_RC4_128_SHA), S_RSA, K_ECDH, C_RC4, B_128, M_SH A, 0, 0, 0, },
246 {0,CS(TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA), S_RSA, K_ECDH, C_3DES, B_3DES, M_ SHA, 1, 0, 0, }, 246 {0,CS(TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA), S_RSA, K_ECDH, C_3DES, B_3DES, M_ SHA, 1, 0, 0, },
247 {0,CS(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA), S_RSA, K_ECDH, C_AES, B_128, M_SH A, 1, 0, 0, }, 247 {0,CS(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA), S_RSA, K_ECDH, C_AES, B_128, M_SH A, 1, 0, 0, },
248 {0,CS(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA), S_RSA, K_ECDH, C_AES, B_256, M_SH A, 1, 0, 0, }, 248 {0,CS(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA), S_RSA, K_ECDH, C_AES, B_256, M_SH A, 1, 0, 0, },
249 +{0,CS(TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305), S_RSA,K_ECDHE,C_CHACHA20,B_256,M_ AEAD_128, 0, 0, 0, }, 249 +{0,CS(TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305), S_RSA,K_ECDHE,C_CHACHA20,B_256,M_ AEAD_128, 0, 0, 0, },
250 250
251 {0,CS(TLS_ECDHE_RSA_WITH_NULL_SHA), S_RSA, K_ECDHE, C_NULL, B_0, M_SH A, 0, 0, 0, }, 251 {0,CS(TLS_ECDHE_RSA_WITH_NULL_SHA), S_RSA, K_ECDHE, C_NULL, B_0, M_SH A, 0, 0, 0, },
252 {0,CS(TLS_ECDHE_RSA_WITH_RC4_128_SHA), S_RSA, K_ECDHE, C_RC4, B_128, M_S HA, 0, 0, 0, }, 252 {0,CS(TLS_ECDHE_RSA_WITH_RC4_128_SHA), S_RSA, K_ECDHE, C_RC4, B_128, M_S HA, 0, 0, 0, },
253 diff -pu a/nss/lib/ssl/sslproto.h b/nss/lib/ssl/sslproto.h 253 diff -pu a/nss/lib/ssl/sslproto.h b/nss/lib/ssl/sslproto.h
254 --- a/nss/lib/ssl/sslproto.h» 2014-01-06 14:53:43.540566574 -0800 254 --- a/nss/lib/ssl/sslproto.h» 2014-01-17 17:49:26.072517368 -0800
255 +++ b/nss/lib/ssl/sslproto.h» 2014-01-06 14:58:25.635150408 -0800 255 +++ b/nss/lib/ssl/sslproto.h» 2014-01-17 18:07:10.270188062 -0800
256 @@ -213,6 +213,9 @@ 256 @@ -213,6 +213,9 @@
257 #define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F 257 #define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F
258 #define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 258 #define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031
259 259
260 +#define TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 0xCC13 260 +#define TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 0xCC13
261 +#define TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 0xCC14 261 +#define TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 0xCC14
262 + 262 +
263 /* Netscape "experimental" cipher suites. */ 263 /* Netscape "experimental" cipher suites. */
264 #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA 0xffe0 264 #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA 0xffe0
265 #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA 0xffe1 265 #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA 0xffe1
266 diff -pu a/nss/lib/ssl/sslt.h b/nss/lib/ssl/sslt.h 266 diff -pu a/nss/lib/ssl/sslt.h b/nss/lib/ssl/sslt.h
267 --- a/nss/lib/ssl/sslt.h» 2014-01-06 14:58:13.034945554 -0800 267 --- a/nss/lib/ssl/sslt.h» 2014-01-17 18:03:47.906831535 -0800
268 +++ b/nss/lib/ssl/sslt.h» 2014-01-06 14:58:25.635150408 -0800 268 +++ b/nss/lib/ssl/sslt.h» 2014-01-17 18:07:10.270188062 -0800
269 @@ -94,7 +94,8 @@ typedef enum { 269 @@ -94,7 +94,8 @@ typedef enum {
270 ssl_calg_aes = 7, 270 ssl_calg_aes = 7,
271 ssl_calg_camellia = 8, 271 ssl_calg_camellia = 8,
272 ssl_calg_seed = 9, 272 ssl_calg_seed = 9,
273 - ssl_calg_aes_gcm = 10 273 - ssl_calg_aes_gcm = 10
274 + ssl_calg_aes_gcm = 10, 274 + ssl_calg_aes_gcm = 10,
275 + ssl_calg_chacha20 = 11 275 + ssl_calg_chacha20 = 11
276 } SSLCipherAlgorithm; 276 } SSLCipherAlgorithm;
277 277
278 typedef enum { 278 typedef enum {
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698