| 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.lastHandshakeHash.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; |
| 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 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2290 } else if (maxBytes < extension_length) { | 2299 } else if (maxBytes < extension_length) { |
| 2291 PORT_Assert(0); | 2300 PORT_Assert(0); |
| 2292 return 0; | 2301 return 0; |
| 2293 } | 2302 } |
| 2294 | 2303 |
| 2295 return extension_length; | 2304 return extension_length; |
| 2296 | 2305 |
| 2297 loser: | 2306 loser: |
| 2298 return -1; | 2307 return -1; |
| 2299 } | 2308 } |
| OLD | NEW |