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

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

Issue 27589002: Support new ChannelID extension. (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
« no previous file with comments | « net/third_party/nss/ssl/ssl3con.c ('k') | net/third_party/nss/ssl/sslimpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 PORT_Assert(0);
822 return 0;
823 }
824
815 if (append) { 825 if (append) {
816 SECStatus rv; 826 SECStatus rv;
817 rv = ssl3_AppendHandshakeNumber(ss, ssl_channel_id_xtn, 2); 827 rv = ssl3_AppendHandshakeNumber(ss, ssl_channel_id_xtn, 2);
818 if (rv != SECSuccess) 828 if (rv != SECSuccess)
819 goto loser; 829 goto loser;
820 rv = ssl3_AppendHandshakeNumber(ss, 0, 2); 830 rv = ssl3_AppendHandshakeNumber(ss, 0, 2);
821 if (rv != SECSuccess) 831 if (rv != SECSuccess)
822 goto loser; 832 goto loser;
823 ss->xtnData.advertised[ss->xtnData.numAdvertised++] = 833 ss->xtnData.advertised[ss->xtnData.numAdvertised++] =
824 ssl_channel_id_xtn; 834 ssl_channel_id_xtn;
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, ssl_padding_xtn, 2)) 2357 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, ssl_padding_xtn, 2))
2348 return -1; 2358 return -1;
2349 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, paddingLen, 2)) 2359 if (SECSuccess != ssl3_AppendHandshakeNumber(ss, paddingLen, 2))
2350 return -1; 2360 return -1;
2351 memset(padding, ' ', paddingLen); 2361 memset(padding, ' ', paddingLen);
2352 if (SECSuccess != ssl3_AppendHandshake(ss, padding, paddingLen)) 2362 if (SECSuccess != ssl3_AppendHandshake(ss, padding, paddingLen))
2353 return -1; 2363 return -1;
2354 2364
2355 return extensionLen; 2365 return extensionLen;
2356 } 2366 }
OLDNEW
« no previous file with comments | « net/third_party/nss/ssl/ssl3con.c ('k') | net/third_party/nss/ssl/sslimpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698