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

Side by Side Diff: net/third_party/nss/ssl/ssl3ext.c

Issue 66553007: net: don't add padding extension for SSLv3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 7 years, 1 month 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 /* 1 /*
2 * SSL3 Protocol 2 * SSL3 Protocol
3 * 3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public 4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 7
8 /* TLS extension code moved here from ssl3ecc.c */ 8 /* TLS extension code moved here from ssl3ecc.c */
9 9
10 #include "nssrenam.h" 10 #include "nssrenam.h"
(...skipping 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 PORT_Assert(0); 2291 PORT_Assert(0);
2292 return 0; 2292 return 0;
2293 } 2293 }
2294 2294
2295 return extension_length; 2295 return extension_length;
2296 2296
2297 loser: 2297 loser:
2298 return -1; 2298 return -1;
2299 } 2299 }
2300 2300
2301 unsigned int 2301 PRInt32
2302 ssl3_CalculatePaddingExtensionLength(unsigned int clientHelloLength) 2302 ssl3_CalculatePaddingExtensionLength(unsigned int clientHelloLength)
2303 { 2303 {
2304 unsigned int recordLength = 1 /* handshake message type */ + 2304 unsigned int recordLength = 1 /* handshake message type */ +
2305 3 /* handshake message length */ + 2305 3 /* handshake message length */ +
2306 clientHelloLength; 2306 clientHelloLength;
2307 unsigned int extensionLength; 2307 unsigned int extensionLength;
2308 2308
2309 if (recordLength < 256 || recordLength >= 512) { 2309 if (recordLength < 256 || recordLength >= 512) {
2310 return 0; 2310 return 0;
2311 } 2311 }
(...skipping 18 matching lines...) Expand all
2330 unsigned char padding[256]; 2330 unsigned char padding[256];
2331 2331
2332 if (extensionLen == 0) { 2332 if (extensionLen == 0) {
2333 return 0; 2333 return 0;
2334 } 2334 }
2335 2335
2336 if (extensionLen < 4 || 2336 if (extensionLen < 4 ||
2337 extensionLen > maxBytes || 2337 extensionLen > maxBytes ||
2338 paddingLen > sizeof(padding)) { 2338 paddingLen > sizeof(padding)) {
2339 PORT_Assert(0); 2339 PORT_Assert(0);
2340 return 0; 2340 return 0;
wtc 2013/11/11 21:50:33 It is this return statement that I think should be
agl 2013/11/12 16:21:57 Gah, sorry. I thought you were talking about ssl3_
2341 } 2341 }
2342 2342
2343 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, ssl_padding_xtn, 2)) 2343 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, ssl_padding_xtn, 2))
2344 return -1; 2344 return -1;
2345 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, paddingLen, 2)) 2345 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, paddingLen, 2))
2346 return -1; 2346 return -1;
2347 memset(padding, ' ', paddingLen); 2347 memset(padding, ' ', paddingLen);
2348 if (SECSuccess != ssl3_AppendHandshake(ss, padding, paddingLen)) 2348 if (SECSuccess != ssl3_AppendHandshake(ss, padding, paddingLen))
2349 return -1; 2349 return -1;
2350 2350
2351 return extensionLen; 2351 return extensionLen;
2352 } 2352 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698