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

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

Issue 319573002: Ignore out-of-order DTLS ChangeCipherSpec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 6 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
« no previous file with comments | « net/third_party/nss/patches/ignorechangecipherspec.patch ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 3603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3614 SSL3WaitState ws = ss->ssl3.hs.ws; 3614 SSL3WaitState ws = ss->ssl3.hs.ws;
3615 SSL3ChangeCipherSpecChoice change; 3615 SSL3ChangeCipherSpecChoice change;
3616 3616
3617 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) ); 3617 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) );
3618 PORT_Assert( ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss) ); 3618 PORT_Assert( ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss) );
3619 3619
3620 SSL_TRC(3, ("%d: SSL3[%d]: handle change_cipher_spec record", 3620 SSL_TRC(3, ("%d: SSL3[%d]: handle change_cipher_spec record",
3621 SSL_GETPID(), ss->fd)); 3621 SSL_GETPID(), ss->fd));
3622 3622
3623 if (ws != wait_change_cipher) { 3623 if (ws != wait_change_cipher) {
3624 if (IS_DTLS(ss)) {
3625 /* Ignore this because it's out of order. */
3626 SSL_TRC(3, ("%d: SSL3[%d]: discard out of order "
3627 "DTLS change_cipher_spec",
3628 SSL_GETPID(), ss->fd));
3629 buf->len = 0;
3630 return SECSuccess;
3631 }
3624 (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message); 3632 (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
3625 PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER); 3633 PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER);
3626 return SECFailure; 3634 return SECFailure;
3627 } 3635 }
3628 3636
3629 if(buf->len != 1) { 3637 if(buf->len != 1) {
3630 (void)ssl3_DecodeError(ss); 3638 (void)ssl3_DecodeError(ss);
3631 PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER); 3639 PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
3632 return SECFailure; 3640 return SECFailure;
3633 } 3641 }
(...skipping 9207 matching lines...) Expand 10 before | Expand all | Expand 10 after
12841 PORT_Free(ss->ssl3.hs.recvdFragments.buf); 12849 PORT_Free(ss->ssl3.hs.recvdFragments.buf);
12842 } 12850 }
12843 } 12851 }
12844 12852
12845 ss->ssl3.initialized = PR_FALSE; 12853 ss->ssl3.initialized = PR_FALSE;
12846 12854
12847 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); 12855 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE);
12848 } 12856 }
12849 12857
12850 /* End of ssl3con.c */ 12858 /* End of ssl3con.c */
OLDNEW
« no previous file with comments | « net/third_party/nss/patches/ignorechangecipherspec.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698