OLD | NEW |
1 diff --git 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 index 8be517c..53c29f0 100644 | 2 --- a/nss/lib/ssl/ssl3con.c» 2014-01-06 14:58:15.904992214 -0800 |
3 --- a/nss/lib/ssl/ssl3con.c | 3 +++ b/nss/lib/ssl/ssl3con.c» 2014-01-06 14:58:25.635150408 -0800 |
4 +++ b/nss/lib/ssl/ssl3con.c | |
5 @@ -40,6 +40,21 @@ | 4 @@ -40,6 +40,21 @@ |
6 #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) |
7 #endif | 6 #endif |
8 | 7 |
9 +/* 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 |
10 + * headers. */ | 9 + * headers. */ |
11 +#ifndef CKM_NSS_CHACHA20_POLY1305 | 10 +#ifndef CKM_NSS_CHACHA20_POLY1305 |
12 +#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 26) | 11 +#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 26) |
13 + | 12 + |
14 +typedef struct CK_NSS_AEAD_PARAMS { | 13 +typedef struct CK_NSS_AEAD_PARAMS { |
15 + CK_BYTE_PTR pIv; /* This is the nonce. */ | 14 + CK_BYTE_PTR pIv; /* This is the nonce. */ |
16 + CK_ULONG ulIvLen; | 15 + CK_ULONG ulIvLen; |
17 + CK_BYTE_PTR pAAD; | 16 + CK_BYTE_PTR pAAD; |
18 + CK_ULONG ulAADLen; | 17 + CK_ULONG ulAADLen; |
19 + CK_ULONG ulTagLen; | 18 + CK_ULONG ulTagLen; |
20 +} CK_NSS_AEAD_PARAMS; | 19 +} CK_NSS_AEAD_PARAMS; |
21 + | 20 + |
22 +#endif | 21 +#endif |
23 + | 22 + |
24 #include <stdio.h> | 23 #include <stdio.h> |
25 #ifdef NSS_ENABLE_ZLIB | 24 #ifdef NSS_ENABLE_ZLIB |
26 #include "zlib.h" | 25 #include "zlib.h" |
27 @@ -100,6 +115,8 @@ static SECStatus ssl3_AESGCMBypass(ssl3KeyMaterial *keys, PR
Bool doDecrypt, | 26 @@ -104,6 +119,8 @@ static ssl3CipherSuiteCfg cipherSuites[s |
28 static ssl3CipherSuiteCfg cipherSuites[ssl_V3_SUITES_IMPLEMENTED] = { | 27 /* cipher_suite policy enabled isPresent */ |
29 /* cipher_suite policy enabled is_present*
/ | 28 |
30 #ifdef NSS_ENABLE_ECC | 29 #ifdef NSS_ENABLE_ECC |
31 + { TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, SSL_NOT_ALLOWED, PR_FALSE,PR_FALSE}, | 30 + { TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, SSL_ALLOWED, PR_FALSE, PR_FALSE}, |
32 + { TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, SSL_NOT_ALLOWED, PR_FALSE,PR_FALSE}, | 31 + { TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, SSL_ALLOWED, PR_FALSE, PR_FALSE}, |
33 { TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,SSL_NOT_ALLOWED, PR_FALSE,PR_FALSE}, | 32 { TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, SSL_ALLOWED, PR_FALSE, PR_FALSE}, |
34 { TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, SSL_NOT_ALLOWED, PR_FALSE,PR_FALSE}, | 33 { TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, SSL_ALLOWED, PR_FALSE, PR_FALSE}, |
35 #endif /* NSS_ENABLE_ECC */ | 34 /* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA is out of order to work around |
36 @@ -273,6 +290,7 @@ static const ssl3BulkCipherDef bulk_cipher_defs[] = { | 35 @@ -292,6 +309,7 @@ static const ssl3BulkCipherDef bulk_ciph |
37 {cipher_camellia_256, calg_camellia, 32,32, type_block, 16,16, 0, 0}, | 36 {cipher_camellia_256, calg_camellia, 32,32, type_block, 16,16, 0, 0}, |
38 {cipher_seed, calg_seed, 16,16, type_block, 16,16, 0, 0}, | 37 {cipher_seed, calg_seed, 16,16, type_block, 16,16, 0, 0}, |
39 {cipher_aes_128_gcm, calg_aes_gcm, 16,16, type_aead, 4, 0,16, 8}, | 38 {cipher_aes_128_gcm, calg_aes_gcm, 16,16, type_aead, 4, 0,16, 8}, |
40 + {cipher_chacha20, calg_chacha20, 32,32, type_aead, 0, 0,16, 0}, | 39 + {cipher_chacha20, calg_chacha20, 32,32, type_aead, 0, 0,16, 0}, |
41 {cipher_missing, calg_null, 0, 0, type_stream, 0, 0, 0, 0}, | 40 {cipher_missing, calg_null, 0, 0, type_stream, 0, 0, 0, 0}, |
42 }; | 41 }; |
43 | 42 |
44 @@ -399,6 +417,8 @@ static const ssl3CipherSuiteDef cipher_suite_defs[] = | 43 @@ -418,6 +436,8 @@ static const ssl3CipherSuiteDef cipher_s |
45 {TLS_RSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea_rsa}, | 44 {TLS_RSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea_rsa}, |
46 {TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea_e
cdhe_rsa}, | 45 {TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea_e
cdhe_rsa}, |
47 {TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea
_ecdhe_ecdsa}, | 46 {TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, cipher_aes_128_gcm, mac_aead, kea
_ecdhe_ecdsa}, |
48 + {TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, cipher_chacha20, mac_aead, kea_ecdhe
_rsa}, | 47 + {TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, cipher_chacha20, mac_aead, kea_ecdhe
_rsa}, |
49 + {TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, cipher_chacha20, mac_aead, kea_ecd
he_ecdsa}, | 48 + {TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, cipher_chacha20, mac_aead, kea_ecd
he_ecdsa}, |
50 | 49 |
51 #ifdef NSS_ENABLE_ECC | 50 #ifdef NSS_ENABLE_ECC |
52 {TLS_ECDH_ECDSA_WITH_NULL_SHA, cipher_null, mac_sha, kea_ecdh_ecdsa}
, | 51 {TLS_ECDH_ECDSA_WITH_NULL_SHA, cipher_null, mac_sha, kea_ecdh_ecdsa}
, |
53 @@ -464,6 +484,7 @@ static const SSLCipher2Mech alg2Mech[] = { | 52 @@ -483,6 +503,7 @@ static const SSLCipher2Mech alg2Mech[] = |
54 { calg_camellia , CKM_CAMELLIA_CBC }, | 53 { calg_camellia , CKM_CAMELLIA_CBC }, |
55 { calg_seed , CKM_SEED_CBC }, | 54 { calg_seed , CKM_SEED_CBC }, |
56 { calg_aes_gcm , CKM_AES_GCM }, | 55 { calg_aes_gcm , CKM_AES_GCM }, |
57 + { calg_chacha20 , CKM_NSS_CHACHA20_POLY1305 }, | 56 + { calg_chacha20 , CKM_NSS_CHACHA20_POLY1305 }, |
58 /* { calg_init , (CK_MECHANISM_TYPE)0x7fffffffL } */ | 57 /* { calg_init , (CK_MECHANISM_TYPE)0x7fffffffL } */ |
59 }; | 58 }; |
60 | 59 |
61 @@ -2020,6 +2041,46 @@ ssl3_AESGCMBypass(ssl3KeyMaterial *keys, | 60 @@ -647,6 +668,8 @@ ssl3_CipherSuiteAllowedForVersionRange( |
| 61 * SSL_DH_ANON_EXPORT_WITH_DES40_CBC_SHA: never implemented |
| 62 */ |
| 63 » return vrange->min <= SSL_LIBRARY_VERSION_TLS_1_0; |
| 64 + case TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: |
| 65 + case TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: |
| 66 case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: |
| 67 case TLS_RSA_WITH_AES_256_CBC_SHA256: |
| 68 case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: |
| 69 @@ -2043,6 +2066,46 @@ ssl3_AESGCMBypass(ssl3KeyMaterial *keys, |
62 } | 70 } |
63 #endif | 71 #endif |
64 | 72 |
65 +static SECStatus | 73 +static SECStatus |
66 +ssl3_ChaCha20Poly1305( | 74 +ssl3_ChaCha20Poly1305( |
67 + ssl3KeyMaterial *keys, | 75 + ssl3KeyMaterial *keys, |
68 + PRBool doDecrypt, | 76 + PRBool doDecrypt, |
69 + unsigned char *out, | 77 + unsigned char *out, |
70 + int *outlen, | 78 + int *outlen, |
71 + int maxout, | 79 + int maxout, |
(...skipping 26 matching lines...) Expand all Loading... |
98 + out, &uOutLen, maxout, in, inlen); | 106 + out, &uOutLen, maxout, in, inlen); |
99 + } | 107 + } |
100 + *outlen = (int) uOutLen; | 108 + *outlen = (int) uOutLen; |
101 + | 109 + |
102 + return rv; | 110 + return rv; |
103 +} | 111 +} |
104 + | 112 + |
105 /* Initialize encryption and MAC contexts for pending spec. | 113 /* Initialize encryption and MAC contexts for pending spec. |
106 * Master Secret already is derived. | 114 * Master Secret already is derived. |
107 * Caller holds Spec write lock. | 115 * Caller holds Spec write lock. |
108 @@ -2053,13 +2114,17 @@ ssl3_InitPendingContextsPKCS11(sslSocket *ss) | 116 @@ -2076,13 +2139,17 @@ ssl3_InitPendingContextsPKCS11(sslSocket |
109 pwSpec->client.write_mac_context = NULL; | 117 pwSpec->client.write_mac_context = NULL; |
110 pwSpec->server.write_mac_context = NULL; | 118 pwSpec->server.write_mac_context = NULL; |
111 | 119 |
112 - if (calg == calg_aes_gcm) { | 120 - if (calg == calg_aes_gcm) { |
113 + if (calg == calg_aes_gcm || calg == calg_chacha20) { | 121 + if (calg == calg_aes_gcm || calg == calg_chacha20) { |
114 pwSpec->encode = NULL; | 122 pwSpec->encode = NULL; |
115 pwSpec->decode = NULL; | 123 pwSpec->decode = NULL; |
116 pwSpec->destroy = NULL; | 124 pwSpec->destroy = NULL; |
117 pwSpec->encodeContext = NULL; | 125 pwSpec->encodeContext = NULL; |
118 pwSpec->decodeContext = NULL; | 126 pwSpec->decodeContext = NULL; |
119 - pwSpec->aead = ssl3_AESGCM; | 127 - pwSpec->aead = ssl3_AESGCM; |
120 + if (calg == calg_aes_gcm) { | 128 + if (calg == calg_aes_gcm) { |
121 + pwSpec->aead = ssl3_AESGCM; | 129 + pwSpec->aead = ssl3_AESGCM; |
122 + } else { | 130 + } else { |
123 + pwSpec->aead = ssl3_ChaCha20Poly1305; | 131 + pwSpec->aead = ssl3_ChaCha20Poly1305; |
124 + } | 132 + } |
125 return SECSuccess; | 133 return SECSuccess; |
126 } | 134 } |
127 | 135 |
128 diff --git 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 |
129 index a3638e7..21a5e05 100644 | 137 --- a/nss/lib/ssl/ssl3ecc.c» 2014-01-06 14:57:50.984587086 -0800 |
130 --- a/nss/lib/ssl/ssl3ecc.c | 138 +++ b/nss/lib/ssl/ssl3ecc.c» 2014-01-06 14:58:25.635150408 -0800 |
131 +++ b/nss/lib/ssl/ssl3ecc.c | 139 @@ -904,6 +904,7 @@ static const ssl3CipherSuite ecdhe_ecdsa |
132 @@ -913,6 +913,7 @@ static const ssl3CipherSuite ecdhe_ecdsa_suites[] = { | |
133 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, | 140 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, |
134 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | 141 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, |
135 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, | 142 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, |
136 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, | 143 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, |
137 TLS_ECDHE_ECDSA_WITH_NULL_SHA, | 144 TLS_ECDHE_ECDSA_WITH_NULL_SHA, |
138 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, | 145 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, |
139 0 /* end of list marker */ | 146 0 /* end of list marker */ |
140 @@ -924,6 +925,7 @@ static const ssl3CipherSuite ecdhe_rsa_suites[] = { | 147 @@ -915,6 +916,7 @@ static const ssl3CipherSuite ecdhe_rsa_s |
141 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, | 148 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, |
142 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | 149 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, |
143 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, | 150 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, |
144 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, | 151 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, |
145 TLS_ECDHE_RSA_WITH_NULL_SHA, | 152 TLS_ECDHE_RSA_WITH_NULL_SHA, |
146 TLS_ECDHE_RSA_WITH_RC4_128_SHA, | 153 TLS_ECDHE_RSA_WITH_RC4_128_SHA, |
147 0 /* end of list marker */ | 154 0 /* end of list marker */ |
148 @@ -936,6 +938,7 @@ static const ssl3CipherSuite ecSuites[] = { | 155 @@ -927,6 +929,7 @@ static const ssl3CipherSuite ecSuites[] |
149 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, | 156 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, |
150 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | 157 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, |
151 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, | 158 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, |
152 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, | 159 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, |
153 TLS_ECDHE_ECDSA_WITH_NULL_SHA, | 160 TLS_ECDHE_ECDSA_WITH_NULL_SHA, |
154 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, | 161 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, |
155 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, | 162 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, |
156 @@ -943,6 +946,7 @@ static const ssl3CipherSuite ecSuites[] = { | 163 @@ -934,6 +937,7 @@ static const ssl3CipherSuite ecSuites[] |
157 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, | 164 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, |
158 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | 165 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, |
159 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, | 166 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, |
160 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, | 167 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, |
161 TLS_ECDHE_RSA_WITH_NULL_SHA, | 168 TLS_ECDHE_RSA_WITH_NULL_SHA, |
162 TLS_ECDHE_RSA_WITH_RC4_128_SHA, | 169 TLS_ECDHE_RSA_WITH_RC4_128_SHA, |
163 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, | 170 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, |
164 diff --git 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 |
165 index 597ec07..fc6b854 100644 | 172 --- a/nss/lib/ssl/sslenum.c» 2014-01-06 14:53:43.540566574 -0800 |
166 --- a/nss/lib/ssl/sslenum.c | 173 +++ b/nss/lib/ssl/sslenum.c» 2014-01-06 15:11:13.167642594 -0800 |
167 +++ b/nss/lib/ssl/sslenum.c | 174 @@ -37,17 +37,21 @@ |
168 @@ -31,6 +31,8 @@ | 175 * |
| 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 |
| 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 |
| 180 * suites, with the MSB zeroed, look like: |
| 181 + * TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA { 0x00,0x14 } |
| 182 + * TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA { 0x00,0x13 } |
| 183 * TLS_KRB5_EXPORT_WITH_RC4_40_MD5 {0x00,0x2B } |
| 184 * TLS_RSA_WITH_AES_128_CBC_SHA { 0x00,0x2F } |
| 185 * TLS_RSA_WITH_3DES_EDE_CBC_SHA { 0x00,0x0A } |
| 186 * TLS_RSA_WITH_DES_CBC_SHA { 0x00,0x09 } |
| 187 - * The broken server only supports the third and fourth ones and will select |
| 188 - * the third one. |
| 189 + * The broken server only supports the fifth and sixth ones and will select |
| 190 + * the fifth one. |
| 191 */ |
169 const PRUint16 SSL_ImplementedCiphers[] = { | 192 const PRUint16 SSL_ImplementedCiphers[] = { |
170 /* AES-GCM */ | |
171 #ifdef NSS_ENABLE_ECC | 193 #ifdef NSS_ENABLE_ECC |
172 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, | 194 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, |
173 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, | 195 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, |
174 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | 196 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, |
175 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | 197 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, |
176 #endif /* NSS_ENABLE_ECC */ | 198 /* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA must appear before |
177 diff --git 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 |
178 index 0fe12d0..e3ae9ce 100644 | 200 --- a/nss/lib/ssl/sslimpl.h» 2014-01-06 14:57:46.654516696 -0800 |
179 --- a/nss/lib/ssl/sslimpl.h | 201 +++ b/nss/lib/ssl/sslimpl.h» 2014-01-06 14:58:25.635150408 -0800 |
180 +++ b/nss/lib/ssl/sslimpl.h | |
181 @@ -65,6 +65,7 @@ typedef SSLSignType SSL3SignType; | 202 @@ -65,6 +65,7 @@ typedef SSLSignType SSL3SignType; |
182 #define calg_camellia ssl_calg_camellia | 203 #define calg_camellia ssl_calg_camellia |
183 #define calg_seed ssl_calg_seed | 204 #define calg_seed ssl_calg_seed |
184 #define calg_aes_gcm ssl_calg_aes_gcm | 205 #define calg_aes_gcm ssl_calg_aes_gcm |
185 +#define calg_chacha20 ssl_calg_chacha20 | 206 +#define calg_chacha20 ssl_calg_chacha20 |
186 | 207 |
187 #define mac_null ssl_mac_null | 208 #define mac_null ssl_mac_null |
188 #define mac_md5 ssl_mac_md5 | 209 #define mac_md5 ssl_mac_md5 |
189 @@ -292,7 +293,7 @@ typedef struct { | 210 @@ -292,7 +293,7 @@ typedef struct { |
190 } ssl3CipherSuiteCfg; | 211 } ssl3CipherSuiteCfg; |
191 | 212 |
192 #ifdef NSS_ENABLE_ECC | 213 #ifdef NSS_ENABLE_ECC |
193 -#define ssl_V3_SUITES_IMPLEMENTED 61 | 214 -#define ssl_V3_SUITES_IMPLEMENTED 61 |
194 +#define ssl_V3_SUITES_IMPLEMENTED 63 | 215 +#define ssl_V3_SUITES_IMPLEMENTED 63 |
195 #else | 216 #else |
196 #define ssl_V3_SUITES_IMPLEMENTED 37 | 217 #define ssl_V3_SUITES_IMPLEMENTED 37 |
197 #endif /* NSS_ENABLE_ECC */ | 218 #endif /* NSS_ENABLE_ECC */ |
198 @@ -474,6 +475,7 @@ typedef enum { | 219 @@ -474,6 +475,7 @@ typedef enum { |
199 cipher_camellia_256, | 220 cipher_camellia_256, |
200 cipher_seed, | 221 cipher_seed, |
201 cipher_aes_128_gcm, | 222 cipher_aes_128_gcm, |
202 + cipher_chacha20, | 223 + cipher_chacha20, |
203 cipher_missing /* reserved for no such supported cipher */ | 224 cipher_missing /* reserved for no such supported cipher */ |
204 /* This enum must match ssl3_cipherName[] in ssl3con.c. */ | 225 /* This enum must match ssl3_cipherName[] in ssl3con.c. */ |
205 } SSL3BulkCipher; | 226 } SSL3BulkCipher; |
206 diff --git 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 |
207 index 9597209..bfc1676 100644 | 228 --- a/nss/lib/ssl/sslinfo.c» 2014-01-06 14:57:21.444106895 -0800 |
208 --- a/nss/lib/ssl/sslinfo.c | 229 +++ b/nss/lib/ssl/sslinfo.c» 2014-01-06 14:58:25.635150408 -0800 |
209 +++ b/nss/lib/ssl/sslinfo.c | 230 @@ -110,6 +110,7 @@ SSL_GetChannelInfo(PRFileDesc *fd, SSLCh |
210 @@ -118,6 +118,7 @@ SSL_GetChannelInfo(PRFileDesc *fd, SSLChannelInfo *info, PRU
intn len) | |
211 #define C_NULL "NULL", calg_null | 231 #define C_NULL "NULL", calg_null |
212 #define C_SJ "SKIPJACK", calg_sj | 232 #define C_SJ "SKIPJACK", calg_sj |
213 #define C_AESGCM "AES-GCM", calg_aes_gcm | 233 #define C_AESGCM "AES-GCM", calg_aes_gcm |
214 +#define C_CHACHA20 "CHACHA20POLY1305", calg_chacha20 | 234 +#define C_CHACHA20 "CHACHA20POLY1305", calg_chacha20 |
215 | 235 |
216 #define B_256 256, 256, 256 | 236 #define B_256 256, 256, 256 |
217 #define B_128 128, 128, 128 | 237 #define B_128 128, 128, 128 |
218 @@ -196,12 +197,14 @@ static const SSLCipherSuiteInfo suiteInfo[] = { | 238 @@ -188,12 +189,14 @@ static const SSLCipherSuiteInfo suiteInf |
219 {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, }, |
220 {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, }, |
221 {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, }, |
222 +{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, }, |
223 | 243 |
224 {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, }, |
225 {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, }, |
226 {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, }, |
227 {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, }, |
228 {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, }, |
229 +{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, }, |
230 | 250 |
231 {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, }, |
232 {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, }, |
233 diff --git 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 |
234 index 53bba01..6b60a28 100644 | 254 --- a/nss/lib/ssl/sslproto.h» 2014-01-06 14:53:43.540566574 -0800 |
235 --- a/nss/lib/ssl/sslproto.h | 255 +++ b/nss/lib/ssl/sslproto.h» 2014-01-06 14:58:25.635150408 -0800 |
236 +++ b/nss/lib/ssl/sslproto.h | |
237 @@ -213,6 +213,9 @@ | 256 @@ -213,6 +213,9 @@ |
238 #define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F | 257 #define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F |
239 #define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 | 258 #define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 |
240 | 259 |
241 +#define TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 0xCC13 | 260 +#define TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 0xCC13 |
242 +#define TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 0xCC14 | 261 +#define TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 0xCC14 |
243 + | 262 + |
244 /* Netscape "experimental" cipher suites. */ | 263 /* Netscape "experimental" cipher suites. */ |
245 #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA 0xffe0 | 264 #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA 0xffe0 |
246 #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA 0xffe1 | 265 #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA 0xffe1 |
247 diff --git a/nss/lib/ssl/sslsock.c b/nss/lib/ssl/sslsock.c | 266 diff -pu a/nss/lib/ssl/sslt.h b/nss/lib/ssl/sslt.h |
248 index c17c7a3..ffbccc6 100644 | 267 --- a/nss/lib/ssl/sslt.h» 2014-01-06 14:58:13.034945554 -0800 |
249 --- a/nss/lib/ssl/sslsock.c | 268 +++ b/nss/lib/ssl/sslt.h» 2014-01-06 14:58:25.635150408 -0800 |
250 +++ b/nss/lib/ssl/sslsock.c | |
251 @@ -98,6 +98,7 @@ static cipherPolicy ssl_ciphers[] = {» /* Export
France */ | |
252 { TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
253 { TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
254 { TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
255 + { TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
256 { TLS_ECDH_RSA_WITH_NULL_SHA, SSL_ALLOWED, SSL_ALLOWED }, | |
257 { TLS_ECDH_RSA_WITH_RC4_128_SHA, SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
258 { TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
259 @@ -110,6 +111,7 @@ static cipherPolicy ssl_ciphers[] = {» /* Export
France */ | |
260 { TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
261 { TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
262 { TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
263 + { TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, SSL_NOT_ALLOWED, SSL_NOT_ALLOWED }, | |
264 #endif /* NSS_ENABLE_ECC */ | |
265 { 0,»» » » » SSL_NOT_ALLOWED, SSL_NOT_ALLOWED } | |
266 }; | |
267 diff --git a/nss/lib/ssl/sslt.h b/nss/lib/ssl/sslt.h | |
268 index b03422e..a8007d8 100644 | |
269 --- a/nss/lib/ssl/sslt.h | |
270 +++ b/nss/lib/ssl/sslt.h | |
271 @@ -94,7 +94,8 @@ typedef enum { | 269 @@ -94,7 +94,8 @@ typedef enum { |
272 ssl_calg_aes = 7, | 270 ssl_calg_aes = 7, |
273 ssl_calg_camellia = 8, | 271 ssl_calg_camellia = 8, |
274 ssl_calg_seed = 9, | 272 ssl_calg_seed = 9, |
275 - ssl_calg_aes_gcm = 10 | 273 - ssl_calg_aes_gcm = 10 |
276 + ssl_calg_aes_gcm = 10, | 274 + ssl_calg_aes_gcm = 10, |
277 + ssl_calg_chacha20 = 11 | 275 + ssl_calg_chacha20 = 11 |
278 } SSLCipherAlgorithm; | 276 } SSLCipherAlgorithm; |
279 | 277 |
280 typedef enum { | 278 typedef enum { |
OLD | NEW |