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

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

Issue 18346010: net: support ALPN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the new error. Created 7 years, 5 months 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
OLDNEW
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 /* $Id$ */ 8 /* $Id$ */
9 9
10 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ 10 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */
(...skipping 9889 matching lines...) Expand 10 before | Expand all | Expand 10 after
9900 9900
9901 /* called from ssl3_HandleServerHelloDone 9901 /* called from ssl3_HandleServerHelloDone
9902 */ 9902 */
9903 static SECStatus 9903 static SECStatus
9904 ssl3_SendNextProto(sslSocket *ss) 9904 ssl3_SendNextProto(sslSocket *ss)
9905 { 9905 {
9906 SECStatus rv; 9906 SECStatus rv;
9907 int padding_len; 9907 int padding_len;
9908 static const unsigned char padding[32] = {0}; 9908 static const unsigned char padding[32] = {0};
9909 9909
9910 if (ss->ssl3.nextProto.len == 0) 9910 if (ss->ssl3.nextProto.len == 0 ||
9911 ss->ssl3.nextProtoState == SSL_NEXT_PROTO_SELECTED) {
9911 return SECSuccess; 9912 return SECSuccess;
9913 }
9912 9914
9913 PORT_Assert( ss->opt.noLocks || ssl_HaveXmitBufLock(ss)); 9915 PORT_Assert( ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
9914 PORT_Assert( ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss)); 9916 PORT_Assert( ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
9915 9917
9916 padding_len = 32 - ((ss->ssl3.nextProto.len + 2) % 32); 9918 padding_len = 32 - ((ss->ssl3.nextProto.len + 2) % 32);
9917 9919
9918 rv = ssl3_AppendHandshakeHeader(ss, next_proto, ss->ssl3.nextProto.len + 9920 rv = ssl3_AppendHandshakeHeader(ss, next_proto, ss->ssl3.nextProto.len +
9919 2 + padding_len); 9921 2 + padding_len);
9920 if (rv != SECSuccess) { 9922 if (rv != SECSuccess) {
9921 return rv; /* error code set by AppendHandshakeHeader */ 9923 return rv; /* error code set by AppendHandshakeHeader */
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
11976 PORT_Free(ss->ssl3.hs.recvdFragments.buf); 11978 PORT_Free(ss->ssl3.hs.recvdFragments.buf);
11977 } 11979 }
11978 } 11980 }
11979 11981
11980 ss->ssl3.initialized = PR_FALSE; 11982 ss->ssl3.initialized = PR_FALSE;
11981 11983
11982 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); 11984 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE);
11983 } 11985 }
11984 11986
11985 /* End of ssl3con.c */ 11987 /* End of ssl3con.c */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698