Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 /* | 2 /* |
| 3 * SSL3 Protocol | 3 * SSL3 Protocol |
| 4 * | 4 * |
| 5 * This Source Code Form is subject to the terms of the Mozilla Public | 5 * This Source Code Form is subject to the terms of the Mozilla Public |
| 6 * License, v. 2.0. If a copy of the MPL was not distributed with this | 6 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 8 | 8 |
| 9 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ | 9 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ |
| 10 | 10 |
| (...skipping 5230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5241 if (IS_DTLS(ss)) { | 5241 if (IS_DTLS(ss)) { |
| 5242 length += 1 + ss->ssl3.hs.cookieLen; | 5242 length += 1 + ss->ssl3.hs.cookieLen; |
| 5243 } | 5243 } |
| 5244 | 5244 |
| 5245 /* A padding extension may be included to ensure that the record containing | 5245 /* A padding extension may be included to ensure that the record containing |
| 5246 * the ClientHello doesn't have a length between 256 and 511 bytes | 5246 * the ClientHello doesn't have a length between 256 and 511 bytes |
| 5247 * (inclusive). Initial, ClientHello records with such lengths trigger bugs | 5247 * (inclusive). Initial, ClientHello records with such lengths trigger bugs |
| 5248 * in F5 devices. | 5248 * in F5 devices. |
| 5249 * | 5249 * |
| 5250 * This is not done for DTLS nor for renegotiation. */ | 5250 * This is not done for DTLS nor for renegotiation. */ |
| 5251 if (!IS_DTLS(ss) && !ss->firstHsDone) { | 5251 if (!IS_DTLS(ss) && |
| 5252 ss->version > SSL_LIBRARY_VERSION_3_0 && | |
|
wtc
2013/11/11 19:49:53
We can just test the local variable 'isTLS'.
(We
agl
2013/11/11 20:23:49
Done.
| |
| 5253 !ss->firstHsDone) { | |
| 5252 paddingExtensionLen = ssl3_CalculatePaddingExtensionLength(length); | 5254 paddingExtensionLen = ssl3_CalculatePaddingExtensionLength(length); |
| 5253 total_exten_len += paddingExtensionLen; | 5255 total_exten_len += paddingExtensionLen; |
| 5254 length += paddingExtensionLen; | 5256 length += paddingExtensionLen; |
| 5255 } else { | 5257 } else { |
| 5256 paddingExtensionLen = 0; | 5258 paddingExtensionLen = 0; |
| 5257 } | 5259 } |
| 5258 | 5260 |
| 5259 rv = ssl3_AppendHandshakeHeader(ss, client_hello, length); | 5261 rv = ssl3_AppendHandshakeHeader(ss, client_hello, length); |
| 5260 if (rv != SECSuccess) { | 5262 if (rv != SECSuccess) { |
| 5261 return rv; /* err set by ssl3_AppendHandshake* */ | 5263 return rv; /* err set by ssl3_AppendHandshake* */ |
| (...skipping 7328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12590 PORT_Free(ss->ssl3.hs.recvdFragments.buf); | 12592 PORT_Free(ss->ssl3.hs.recvdFragments.buf); |
| 12591 } | 12593 } |
| 12592 } | 12594 } |
| 12593 | 12595 |
| 12594 ss->ssl3.initialized = PR_FALSE; | 12596 ss->ssl3.initialized = PR_FALSE; |
| 12595 | 12597 |
| 12596 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); | 12598 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); |
| 12597 } | 12599 } |
| 12598 | 12600 |
| 12599 /* End of ssl3con.c */ | 12601 /* End of ssl3con.c */ |
| OLD | NEW |