OLD | NEW |
1 diff -pu a/nss/lib/ssl/ssl3con.c b/nss/lib/ssl/ssl3con.c | 1 diff --git a/ssl/ssl3con.c b/ssl/ssl3con.c |
2 --- a/nss/lib/ssl/ssl3con.c» 2014-01-17 18:06:41.659713513 -0800 | 2 index 375ed6a..adaa9a4 100644 |
3 +++ b/nss/lib/ssl/ssl3con.c» 2014-01-17 18:07:10.270188062 -0800 | 3 --- a/ssl/ssl3con.c |
4 @@ -40,6 +40,21 @@ | 4 +++ b/ssl/ssl3con.c |
| 5 @@ -41,6 +41,21 @@ |
5 #define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24) | 6 #define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24) |
6 #endif | 7 #endif |
7 | 8 |
8 +/* This is a bodge to allow this code to be compiled against older NSS | 9 +/* This is a bodge to allow this code to be compiled against older NSS |
9 + * headers. */ | 10 + * headers. */ |
10 +#ifndef CKM_NSS_CHACHA20_POLY1305 | 11 +#ifndef CKM_NSS_CHACHA20_POLY1305 |
11 +#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 26) | 12 +#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 26) |
12 + | 13 + |
13 +typedef struct CK_NSS_AEAD_PARAMS { | 14 +typedef struct CK_NSS_AEAD_PARAMS { |
14 + CK_BYTE_PTR pIv; /* This is the nonce. */ | 15 + CK_BYTE_PTR pIv; /* This is the nonce. */ |
15 + CK_ULONG ulIvLen; | 16 + CK_ULONG ulIvLen; |
16 + CK_BYTE_PTR pAAD; | 17 + CK_BYTE_PTR pAAD; |
17 + CK_ULONG ulAADLen; | 18 + CK_ULONG ulAADLen; |
18 + CK_ULONG ulTagLen; | 19 + CK_ULONG ulTagLen; |
19 +} CK_NSS_AEAD_PARAMS; | 20 +} CK_NSS_AEAD_PARAMS; |
20 + | 21 + |
21 +#endif | 22 +#endif |
22 + | 23 + |
23 #include <stdio.h> | 24 #include <stdio.h> |
24 #ifdef NSS_ENABLE_ZLIB | 25 #ifdef NSS_ENABLE_ZLIB |
25 #include "zlib.h" | 26 #include "zlib.h" |
26 @@ -104,6 +119,8 @@ static ssl3CipherSuiteCfg cipherSuites[s | 27 @@ -105,6 +120,8 @@ static ssl3CipherSuiteCfg cipherSuites[ssl_V3_SUITES_IMPLEME
NTED] = { |
27 /* cipher_suite policy enabled isPresent */ | 28 /* cipher_suite policy enabled isPresent */ |
28 | 29 |
29 #ifdef NSS_ENABLE_ECC | 30 #ifndef NSS_DISABLE_ECC |
30 + { TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, SSL_ALLOWED, PR_FALSE, PR_FALSE}, | 31 + { TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, SSL_ALLOWED, PR_FALSE, PR_FALSE}, |
31 + { TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, SSL_ALLOWED, PR_FALSE, PR_FALSE}, | 32 + { TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, SSL_ALLOWED, PR_FALSE, PR_FALSE}, |
32 { TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, SSL_ALLOWED, PR_FALSE, PR_FALSE}, | 33 { TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, SSL_ALLOWED, PR_FALSE, PR_FALSE}, |
33 { TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, SSL_ALLOWED, PR_FALSE, PR_FALSE}, | 34 { TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, SSL_ALLOWED, PR_FALSE, PR_FALSE}, |
34 /* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA is out of order to work around | 35 /* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA is out of order to work around |
35 @@ -292,6 +309,7 @@ static const ssl3BulkCipherDef bulk_ciph | 36 @@ -296,6 +313,7 @@ static const ssl3BulkCipherDef bulk_cipher_defs[] = { |
36 {cipher_camellia_256, calg_camellia, 32,32, type_block, 16,16, 0, 0}, | 37 {cipher_camellia_256, calg_camellia, 32,32, type_block, 16,16, 0, 0}, |
37 {cipher_seed, calg_seed, 16,16, type_block, 16,16, 0, 0}, | 38 {cipher_seed, calg_seed, 16,16, type_block, 16,16, 0, 0}, |
38 {cipher_aes_128_gcm, calg_aes_gcm, 16,16, type_aead, 4, 0,16, 8}, | 39 {cipher_aes_128_gcm, calg_aes_gcm, 16,16, type_aead, 4, 0,16, 8}, |
39 + {cipher_chacha20, calg_chacha20, 32,32, type_aead, 0, 0,16, 0}, | 40 + {cipher_chacha20, calg_chacha20, 32,32, type_aead, 0, 0,16, 0}, |
40 {cipher_missing, calg_null, 0, 0, type_stream, 0, 0, 0, 0}, | 41 {cipher_missing, calg_null, 0, 0, type_stream, 0, 0, 0, 0}, |
41 }; | 42 }; |
42 | 43 |
43 @@ -418,6 +436,8 @@ static const ssl3CipherSuiteDef cipher_s | 44 @@ -422,6 +440,8 @@ static const ssl3CipherSuiteDef cipher_suite_defs[] = |
44 {TLS_RSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea_rsa}, | 45 {TLS_RSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea_rsa}, |
45 {TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea_e
cdhe_rsa}, | 46 {TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea_e
cdhe_rsa}, |
46 {TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea
_ecdhe_ecdsa}, | 47 {TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea
_ecdhe_ecdsa}, |
47 + {TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, cipher_chacha20, mac_aead, kea_ecdhe
_rsa}, | 48 + {TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, cipher_chacha20, mac_aead, kea_ecdhe
_rsa}, |
48 + {TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, cipher_chacha20, mac_aead, kea_ecd
he_ecdsa}, | 49 + {TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, cipher_chacha20, mac_aead, kea_ecd
he_ecdsa}, |
49 | 50 |
50 #ifdef NSS_ENABLE_ECC | 51 #ifndef NSS_DISABLE_ECC |
51 {TLS_ECDH_ECDSA_WITH_NULL_SHA, cipher_null, mac_sha, kea_ecdh_ecdsa}
, | 52 {TLS_ECDH_ECDSA_WITH_NULL_SHA, cipher_null, mac_sha, kea_ecdh_ecdsa}
, |
52 @@ -483,6 +503,7 @@ static const SSLCipher2Mech alg2Mech[] = | 53 @@ -487,6 +507,7 @@ static const SSLCipher2Mech alg2Mech[] = { |
53 { calg_camellia , CKM_CAMELLIA_CBC }, | 54 { calg_camellia , CKM_CAMELLIA_CBC }, |
54 { calg_seed , CKM_SEED_CBC }, | 55 { calg_seed , CKM_SEED_CBC }, |
55 { calg_aes_gcm , CKM_AES_GCM }, | 56 { calg_aes_gcm , CKM_AES_GCM }, |
56 + { calg_chacha20 , CKM_NSS_CHACHA20_POLY1305 }, | 57 + { calg_chacha20 , CKM_NSS_CHACHA20_POLY1305 }, |
57 /* { calg_init , (CK_MECHANISM_TYPE)0x7fffffffL } */ | 58 /* { calg_init , (CK_MECHANISM_TYPE)0x7fffffffL } */ |
58 }; | 59 }; |
59 | 60 |
60 @@ -647,6 +668,8 @@ ssl3_CipherSuiteAllowedForVersionRange( | 61 @@ -662,6 +683,8 @@ ssl3_CipherSuiteAllowedForVersionRange( |
61 * SSL_DH_ANON_EXPORT_WITH_DES40_CBC_SHA: never implemented | 62 case TLS_RSA_WITH_NULL_SHA256: |
62 */ | 63 return vrange->max == SSL_LIBRARY_VERSION_TLS_1_2; |
63 » return vrange->min <= SSL_LIBRARY_VERSION_TLS_1_0; | 64 |
64 + case TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: | 65 + case TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: |
65 + case TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: | 66 + case TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: |
66 case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: | 67 case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: |
67 case TLS_RSA_WITH_AES_256_CBC_SHA256: | 68 case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: |
68 case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: | 69 case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: |
69 @@ -2043,6 +2066,46 @@ ssl3_AESGCMBypass(ssl3KeyMaterial *keys, | 70 @@ -2070,6 +2093,46 @@ ssl3_AESGCMBypass(ssl3KeyMaterial *keys, |
70 } | 71 } |
71 #endif | 72 #endif |
72 | 73 |
73 +static SECStatus | 74 +static SECStatus |
74 +ssl3_ChaCha20Poly1305( | 75 +ssl3_ChaCha20Poly1305( |
75 + ssl3KeyMaterial *keys, | 76 + ssl3KeyMaterial *keys, |
76 + PRBool doDecrypt, | 77 + PRBool doDecrypt, |
77 + unsigned char *out, | 78 + unsigned char *out, |
78 + int *outlen, | 79 + int *outlen, |
79 + int maxout, | 80 + int maxout, |
(...skipping 26 matching lines...) Expand all Loading... |
106 + out, &uOutLen, maxout, in, inlen); | 107 + out, &uOutLen, maxout, in, inlen); |
107 + } | 108 + } |
108 + *outlen = (int) uOutLen; | 109 + *outlen = (int) uOutLen; |
109 + | 110 + |
110 + return rv; | 111 + return rv; |
111 +} | 112 +} |
112 + | 113 + |
113 /* Initialize encryption and MAC contexts for pending spec. | 114 /* Initialize encryption and MAC contexts for pending spec. |
114 * Master Secret already is derived. | 115 * Master Secret already is derived. |
115 * Caller holds Spec write lock. | 116 * Caller holds Spec write lock. |
116 @@ -2076,13 +2139,17 @@ ssl3_InitPendingContextsPKCS11(sslSocket | 117 @@ -2103,13 +2166,17 @@ ssl3_InitPendingContextsPKCS11(sslSocket *ss) |
117 pwSpec->client.write_mac_context = NULL; | 118 pwSpec->client.write_mac_context = NULL; |
118 pwSpec->server.write_mac_context = NULL; | 119 pwSpec->server.write_mac_context = NULL; |
119 | 120 |
120 - if (calg == calg_aes_gcm) { | 121 - if (calg == calg_aes_gcm) { |
121 + if (calg == calg_aes_gcm || calg == calg_chacha20) { | 122 + if (calg == calg_aes_gcm || calg == calg_chacha20) { |
122 pwSpec->encode = NULL; | 123 pwSpec->encode = NULL; |
123 pwSpec->decode = NULL; | 124 pwSpec->decode = NULL; |
124 pwSpec->destroy = NULL; | 125 pwSpec->destroy = NULL; |
125 pwSpec->encodeContext = NULL; | 126 pwSpec->encodeContext = NULL; |
126 pwSpec->decodeContext = NULL; | 127 pwSpec->decodeContext = NULL; |
127 - pwSpec->aead = ssl3_AESGCM; | 128 - pwSpec->aead = ssl3_AESGCM; |
128 + if (calg == calg_aes_gcm) { | 129 + if (calg == calg_aes_gcm) { |
129 + pwSpec->aead = ssl3_AESGCM; | 130 + pwSpec->aead = ssl3_AESGCM; |
130 + } else { | 131 + } else { |
131 + pwSpec->aead = ssl3_ChaCha20Poly1305; | 132 + pwSpec->aead = ssl3_ChaCha20Poly1305; |
132 + } | 133 + } |
133 return SECSuccess; | 134 return SECSuccess; |
134 } | 135 } |
135 | 136 |
136 diff -pu a/nss/lib/ssl/ssl3ecc.c b/nss/lib/ssl/ssl3ecc.c | 137 diff --git a/ssl/ssl3ecc.c b/ssl/ssl3ecc.c |
137 --- a/nss/lib/ssl/ssl3ecc.c» 2014-01-17 18:04:43.127747463 -0800 | 138 index 003ed78..d5d6c9c 100644 |
138 +++ b/nss/lib/ssl/ssl3ecc.c» 2014-01-17 18:07:10.270188062 -0800 | 139 --- a/ssl/ssl3ecc.c |
139 @@ -904,6 +904,7 @@ static const ssl3CipherSuite ecdhe_ecdsa | 140 +++ b/ssl/ssl3ecc.c |
| 141 @@ -920,6 +920,7 @@ static const ssl3CipherSuite ecdhe_ecdsa_suites[] = { |
140 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, | 142 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, |
141 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | 143 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, |
142 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, | 144 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, |
143 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, | 145 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, |
144 TLS_ECDHE_ECDSA_WITH_NULL_SHA, | 146 TLS_ECDHE_ECDSA_WITH_NULL_SHA, |
145 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, | 147 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, |
146 0 /* end of list marker */ | 148 0 /* end of list marker */ |
147 @@ -915,6 +916,7 @@ static const ssl3CipherSuite ecdhe_rsa_s | 149 @@ -931,6 +932,7 @@ static const ssl3CipherSuite ecdhe_rsa_suites[] = { |
148 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, | 150 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, |
149 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | 151 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, |
150 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, | 152 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, |
151 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, | 153 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, |
152 TLS_ECDHE_RSA_WITH_NULL_SHA, | 154 TLS_ECDHE_RSA_WITH_NULL_SHA, |
153 TLS_ECDHE_RSA_WITH_RC4_128_SHA, | 155 TLS_ECDHE_RSA_WITH_RC4_128_SHA, |
154 0 /* end of list marker */ | 156 0 /* end of list marker */ |
155 @@ -927,6 +929,7 @@ static const ssl3CipherSuite ecSuites[] | 157 @@ -943,6 +945,7 @@ static const ssl3CipherSuite ecSuites[] = { |
156 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, | 158 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, |
157 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | 159 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, |
158 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, | 160 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, |
159 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, | 161 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, |
160 TLS_ECDHE_ECDSA_WITH_NULL_SHA, | 162 TLS_ECDHE_ECDSA_WITH_NULL_SHA, |
161 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, | 163 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, |
162 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, | 164 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, |
163 @@ -934,6 +937,7 @@ static const ssl3CipherSuite ecSuites[] | 165 @@ -950,6 +953,7 @@ static const ssl3CipherSuite ecSuites[] = { |
164 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, | 166 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, |
165 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | 167 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, |
166 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, | 168 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, |
167 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, | 169 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, |
168 TLS_ECDHE_RSA_WITH_NULL_SHA, | 170 TLS_ECDHE_RSA_WITH_NULL_SHA, |
169 TLS_ECDHE_RSA_WITH_RC4_128_SHA, | 171 TLS_ECDHE_RSA_WITH_RC4_128_SHA, |
170 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, | 172 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, |
171 diff -pu a/nss/lib/ssl/sslenum.c b/nss/lib/ssl/sslenum.c | 173 diff --git a/ssl/sslenum.c b/ssl/sslenum.c |
172 --- a/nss/lib/ssl/sslenum.c» 2014-01-17 17:49:26.072517368 -0800 | 174 index 09ce43f..a036627 100644 |
173 +++ b/nss/lib/ssl/sslenum.c» 2014-01-17 18:08:43.791739267 -0800 | 175 --- a/ssl/sslenum.c |
| 176 +++ b/ssl/sslenum.c |
174 @@ -37,17 +37,21 @@ | 177 @@ -37,17 +37,21 @@ |
175 * | 178 * |
176 * Exception: Because some servers ignore the high-order byte of the cipher | 179 * 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 | 180 * 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 | 181 - * 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 | 182 + * than 0x00ff; see bug 946147. For these broken servers, the first six cipher |
180 * suites, with the MSB zeroed, look like: | 183 * suites, with the MSB zeroed, look like: |
181 + * TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA { 0x00,0x14 } | 184 + * TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA { 0x00,0x14 } |
182 + * TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA { 0x00,0x13 } | 185 + * TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA { 0x00,0x13 } |
183 * TLS_KRB5_EXPORT_WITH_RC4_40_MD5 { 0x00,0x2B } | 186 * TLS_KRB5_EXPORT_WITH_RC4_40_MD5 { 0x00,0x2B } |
184 * TLS_RSA_WITH_AES_128_CBC_SHA { 0x00,0x2F } | 187 * TLS_RSA_WITH_AES_128_CBC_SHA { 0x00,0x2F } |
185 * TLS_RSA_WITH_3DES_EDE_CBC_SHA { 0x00,0x0A } | 188 * TLS_RSA_WITH_3DES_EDE_CBC_SHA { 0x00,0x0A } |
186 * TLS_RSA_WITH_DES_CBC_SHA { 0x00,0x09 } | 189 * TLS_RSA_WITH_DES_CBC_SHA { 0x00,0x09 } |
187 - * The broken server only supports the third and fourth ones and will select | 190 - * The broken server only supports the third and fourth ones and will select |
188 - * the third one. | 191 - * the third one. |
189 + * The broken server only supports the fifth and sixth ones and will select | 192 + * The broken server only supports the fifth and sixth ones and will select |
190 + * the fifth one. | 193 + * the fifth one. |
191 */ | 194 */ |
192 const PRUint16 SSL_ImplementedCiphers[] = { | 195 const PRUint16 SSL_ImplementedCiphers[] = { |
193 #ifdef NSS_ENABLE_ECC | 196 #ifndef NSS_DISABLE_ECC |
194 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, | 197 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, |
195 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, | 198 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, |
196 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | 199 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, |
197 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | 200 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, |
198 /* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA must appear before | 201 /* 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 | 202 diff --git a/ssl/sslimpl.h b/ssl/sslimpl.h |
200 --- a/nss/lib/ssl/sslimpl.h» 2014-01-17 18:03:47.906831535 -0800 | 203 index 88f559a..643570f 100644 |
201 +++ b/nss/lib/ssl/sslimpl.h» 2014-01-17 18:07:10.270188062 -0800 | 204 --- a/ssl/sslimpl.h |
| 205 +++ b/ssl/sslimpl.h |
202 @@ -65,6 +65,7 @@ typedef SSLSignType SSL3SignType; | 206 @@ -65,6 +65,7 @@ typedef SSLSignType SSL3SignType; |
203 #define calg_camellia ssl_calg_camellia | 207 #define calg_camellia ssl_calg_camellia |
204 #define calg_seed ssl_calg_seed | 208 #define calg_seed ssl_calg_seed |
205 #define calg_aes_gcm ssl_calg_aes_gcm | 209 #define calg_aes_gcm ssl_calg_aes_gcm |
206 +#define calg_chacha20 ssl_calg_chacha20 | 210 +#define calg_chacha20 ssl_calg_chacha20 |
207 | 211 |
208 #define mac_null ssl_mac_null | 212 #define mac_null ssl_mac_null |
209 #define mac_md5 ssl_mac_md5 | 213 #define mac_md5 ssl_mac_md5 |
210 @@ -299,7 +300,7 @@ typedef struct { | 214 @@ -299,7 +300,7 @@ typedef struct { |
211 } ssl3CipherSuiteCfg; | 215 } ssl3CipherSuiteCfg; |
212 | 216 |
213 #ifdef NSS_ENABLE_ECC | 217 #ifndef NSS_DISABLE_ECC |
214 -#define ssl_V3_SUITES_IMPLEMENTED 61 | 218 -#define ssl_V3_SUITES_IMPLEMENTED 61 |
215 +#define ssl_V3_SUITES_IMPLEMENTED 63 | 219 +#define ssl_V3_SUITES_IMPLEMENTED 63 |
216 #else | 220 #else |
217 #define ssl_V3_SUITES_IMPLEMENTED 37 | 221 #define ssl_V3_SUITES_IMPLEMENTED 37 |
218 #endif /* NSS_ENABLE_ECC */ | 222 #endif /* NSS_DISABLE_ECC */ |
219 @@ -483,6 +484,7 @@ typedef enum { | 223 @@ -485,6 +486,7 @@ typedef enum { |
220 cipher_camellia_256, | 224 cipher_camellia_256, |
221 cipher_seed, | 225 cipher_seed, |
222 cipher_aes_128_gcm, | 226 cipher_aes_128_gcm, |
223 + cipher_chacha20, | 227 + cipher_chacha20, |
224 cipher_missing /* reserved for no such supported cipher */ | 228 cipher_missing /* reserved for no such supported cipher */ |
225 /* This enum must match ssl3_cipherName[] in ssl3con.c. */ | 229 /* This enum must match ssl3_cipherName[] in ssl3con.c. */ |
226 } SSL3BulkCipher; | 230 } SSL3BulkCipher; |
227 diff -pu a/nss/lib/ssl/sslinfo.c b/nss/lib/ssl/sslinfo.c | 231 diff --git a/ssl/sslinfo.c b/ssl/sslinfo.c |
228 --- a/nss/lib/ssl/sslinfo.c» 2014-01-17 18:00:45.503806125 -0800 | 232 index ba230d2..845d9f0 100644 |
229 +++ b/nss/lib/ssl/sslinfo.c» 2014-01-17 18:07:10.270188062 -0800 | 233 --- a/ssl/sslinfo.c |
230 @@ -110,6 +110,7 @@ SSL_GetChannelInfo(PRFileDesc *fd, SSLCh | 234 +++ b/ssl/sslinfo.c |
| 235 @@ -110,6 +110,7 @@ SSL_GetChannelInfo(PRFileDesc *fd, SSLChannelInfo *info, PRU
intn len) |
231 #define C_NULL "NULL", calg_null | 236 #define C_NULL "NULL", calg_null |
232 #define C_SJ "SKIPJACK", calg_sj | 237 #define C_SJ "SKIPJACK", calg_sj |
233 #define C_AESGCM "AES-GCM", calg_aes_gcm | 238 #define C_AESGCM "AES-GCM", calg_aes_gcm |
234 +#define C_CHACHA20 "CHACHA20POLY1305", calg_chacha20 | 239 +#define C_CHACHA20 "CHACHA20POLY1305", calg_chacha20 |
235 | 240 |
236 #define B_256 256, 256, 256 | 241 #define B_256 256, 256, 256 |
237 #define B_128 128, 128, 128 | 242 #define B_128 128, 128, 128 |
238 @@ -188,12 +189,14 @@ static const SSLCipherSuiteInfo suiteInf | 243 @@ -188,12 +189,14 @@ static const SSLCipherSuiteInfo suiteInfo[] = { |
239 {0,CS(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA), S_ECDSA, K_ECDHE, C_AES, B_128, M
_SHA, 1, 0, 0, }, | 244 {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, }, | 245 {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, }, | 246 {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, }, | 247 +{0,CS(TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305),S_ECDSA,K_ECDHE,C_CHACHA20,B_256,
M_AEAD_128,0, 0, 0, }, |
243 | 248 |
244 {0,CS(TLS_ECDH_RSA_WITH_NULL_SHA), S_RSA, K_ECDH, C_NULL, B_0, M_SHA
, 0, 0, 0, }, | 249 {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, }, | 250 {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, }, | 251 {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, }, | 252 {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, }, | 253 {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, }, | 254 +{0,CS(TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305), S_RSA,K_ECDHE,C_CHACHA20,B_256,M_
AEAD_128, 0, 0, 0, }, |
250 | 255 |
251 {0,CS(TLS_ECDHE_RSA_WITH_NULL_SHA), S_RSA, K_ECDHE, C_NULL, B_0, M_SH
A, 0, 0, 0, }, | 256 {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, }, | 257 {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 | 258 diff --git a/ssl/sslproto.h b/ssl/sslproto.h |
254 --- a/nss/lib/ssl/sslproto.h» 2014-01-17 17:49:26.072517368 -0800 | 259 index e02442c..dc653c9 100644 |
255 +++ b/nss/lib/ssl/sslproto.h» 2014-01-17 18:07:10.270188062 -0800 | 260 --- a/ssl/sslproto.h |
256 @@ -213,6 +213,9 @@ | 261 +++ b/ssl/sslproto.h |
| 262 @@ -258,6 +258,9 @@ |
257 #define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F | 263 #define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F |
258 #define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 | 264 #define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 |
259 | 265 |
260 +#define TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 0xCC13 | 266 +#define TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 0xCC13 |
261 +#define TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 0xCC14 | 267 +#define TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 0xCC14 |
262 + | 268 + |
263 /* Netscape "experimental" cipher suites. */ | 269 /* Netscape "experimental" cipher suites. */ |
264 #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA» 0xffe0 | 270 #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA 0xffe0 |
265 #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA» 0xffe1 | 271 #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA 0xffe1 |
266 diff -pu a/nss/lib/ssl/sslt.h b/nss/lib/ssl/sslt.h | 272 diff --git a/ssl/sslt.h b/ssl/sslt.h |
267 --- a/nss/lib/ssl/sslt.h» 2014-01-17 18:03:47.906831535 -0800 | 273 index 430d216..fe0ad07 100644 |
268 +++ b/nss/lib/ssl/sslt.h» 2014-01-17 18:07:10.270188062 -0800 | 274 --- a/ssl/sslt.h |
| 275 +++ b/ssl/sslt.h |
269 @@ -94,7 +94,8 @@ typedef enum { | 276 @@ -94,7 +94,8 @@ typedef enum { |
270 ssl_calg_aes = 7, | 277 ssl_calg_aes = 7, |
271 ssl_calg_camellia = 8, | 278 ssl_calg_camellia = 8, |
272 ssl_calg_seed = 9, | 279 ssl_calg_seed = 9, |
273 - ssl_calg_aes_gcm = 10 | 280 - ssl_calg_aes_gcm = 10 |
274 + ssl_calg_aes_gcm = 10, | 281 + ssl_calg_aes_gcm = 10, |
275 + ssl_calg_chacha20 = 11 | 282 + ssl_calg_chacha20 = 11 |
276 } SSLCipherAlgorithm; | 283 } SSLCipherAlgorithm; |
277 | 284 |
278 typedef enum { | 285 typedef enum { |
OLD | NEW |