Chromium Code Reviews| Index: net/third_party/nss/ssl/ssl3con.c |
| diff --git a/net/third_party/nss/ssl/ssl3con.c b/net/third_party/nss/ssl/ssl3con.c |
| index 8b8b758c0b47c50fb1b55a51658bf84ee3493a9b..e9118bfca59ae37d2e0ec2b4bb6daf5b3d3b0ff3 100644 |
| --- a/net/third_party/nss/ssl/ssl3con.c |
| +++ b/net/third_party/nss/ssl/ssl3con.c |
| @@ -4975,6 +4975,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending) |
| PRBool isTLS = PR_FALSE; |
| PRBool requestingResume = PR_FALSE; |
| PRInt32 total_exten_len = 0; |
| + unsigned paddingExtensionLen; |
| unsigned numCompressionMethods; |
| PRInt32 flags; |
| @@ -5241,6 +5242,19 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending) |
| length += 1 + ss->ssl3.hs.cookieLen; |
| } |
| + /* A padding extension may be included to ensure that the record containing |
| + * the ClientHello doesn't have a length between 256 and 511 bytes |
| + * (inclusive). Records with such lengths trigger bugs in F5 devices. |
|
wtc
2013/11/08 20:10:06
Nit: Records => Initial ClientHello records
Based
agl
2013/11/08 20:33:23
Done.
|
| + * |
| + * This is not done for DTLS nor for renegotiation. */ |
| + if (!IS_DTLS(ss) && !ss->firstHsDone) { |
| + paddingExtensionLen = ssl3_CalculatePaddingExtensionLength(length); |
| + } else { |
| + paddingExtensionLen = 0; |
| + } |
| + total_exten_len += paddingExtensionLen; |
| + length += paddingExtensionLen; |
|
wtc
2013/11/08 20:10:06
Nit: these two lines can be moved inside the "if"
agl
2013/11/08 20:33:23
Done.
|
| + |
| rv = ssl3_AppendHandshakeHeader(ss, client_hello, length); |
| if (rv != SECSuccess) { |
| return rv; /* err set by ssl3_AppendHandshake* */ |
| @@ -5360,6 +5374,13 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending) |
| return SECFailure; |
| } |
| maxBytes -= extLen; |
| + |
| + extLen = ssl3_AppendPaddingExtension(ss, paddingExtensionLen, maxBytes); |
| + if (extLen < 0) { |
| + return SECFailure; |
| + } |
| + maxBytes -= extLen; |
| + |
| PORT_Assert(!maxBytes); |
| } |
| if (ss->ssl3.hs.sendingSCSV) { |