OLD | NEW |
---|---|
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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
805 PRInt32 extension_length = 4; | 805 PRInt32 extension_length = 4; |
806 | 806 |
807 if (!ss->getChannelID) | 807 if (!ss->getChannelID) |
808 return 0; | 808 return 0; |
809 | 809 |
810 if (maxBytes < extension_length) { | 810 if (maxBytes < extension_length) { |
811 PORT_Assert(0); | 811 PORT_Assert(0); |
812 return 0; | 812 return 0; |
813 } | 813 } |
814 | 814 |
815 if (ss->ssl3.hs.isResuming && | |
816 ss->sec.ci.sid->u.ssl3.originalHandshakeHash.len == 0) { | |
817 /* We can't do ChannelID on a connection if we're resuming and didn't | |
818 * do ChannelID on the original connection: without ChannelID on the | |
819 * original connection we didn't record the handshake hashes needed for | |
820 * the signature. */ | |
821 return 0; | |
wtc
2013/11/14 20:25:00
We probably should add a PORT_Assert(0) here becau
agl
2013/11/15 18:48:27
Done.
| |
822 } | |
823 | |
815 if (append) { | 824 if (append) { |
816 SECStatus rv; | 825 SECStatus rv; |
817 rv = ssl3_AppendHandshakeNumber(ss, ssl_channel_id_xtn, 2); | 826 rv = ssl3_AppendHandshakeNumber(ss, ssl_channel_id_xtn, 2); |
818 if (rv != SECSuccess) | 827 if (rv != SECSuccess) |
819 goto loser; | 828 goto loser; |
820 rv = ssl3_AppendHandshakeNumber(ss, 0, 2); | 829 rv = ssl3_AppendHandshakeNumber(ss, 0, 2); |
821 if (rv != SECSuccess) | 830 if (rv != SECSuccess) |
822 goto loser; | 831 goto loser; |
823 ss->xtnData.advertised[ss->xtnData.numAdvertised++] = | 832 ss->xtnData.advertised[ss->xtnData.numAdvertised++] = |
824 ssl_channel_id_xtn; | 833 ssl_channel_id_xtn; |
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2347 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, ssl_padding_xtn, 2)) | 2356 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, ssl_padding_xtn, 2)) |
2348 return -1; | 2357 return -1; |
2349 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, paddingLen, 2)) | 2358 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, paddingLen, 2)) |
2350 return -1; | 2359 return -1; |
2351 memset(padding, ' ', paddingLen); | 2360 memset(padding, ' ', paddingLen); |
2352 if (SECSuccess != ssl3_AppendHandshake(ss, padding, paddingLen)) | 2361 if (SECSuccess != ssl3_AppendHandshake(ss, padding, paddingLen)) |
2353 return -1; | 2362 return -1; |
2354 | 2363 |
2355 return extensionLen; | 2364 return extensionLen; |
2356 } | 2365 } |
OLD | NEW |