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

Side by Side Diff: net/quic/quic_crypto_client_stream.cc

Issue 11633030: Send the ClientHello handshake message. Fix a bug in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove an extraneous test:: before TestCryptoVisitor Created 7 years, 11 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/quic/quic_crypto_client_stream.h ('k') | net/quic/quic_crypto_client_stream_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_crypto_client_stream.h" 5 #include "net/quic/quic_crypto_client_stream.h"
6 6
7 #include "net/quic/crypto/crypto_protocol.h" 7 #include "net/quic/crypto/crypto_protocol.h"
8 #include "net/quic/crypto/crypto_utils.h"
8 #include "net/quic/quic_protocol.h" 9 #include "net/quic/quic_protocol.h"
10 #include "net/quic/quic_session.h"
9 11
10 namespace net { 12 namespace net {
11 13
12 QuicCryptoClientStream::QuicCryptoClientStream(QuicSession* session) 14 QuicCryptoClientStream::QuicCryptoClientStream(QuicSession* session)
13 : QuicCryptoStream(session) { 15 : QuicCryptoStream(session) {
14 } 16 }
15 17
16 18
17 void QuicCryptoClientStream::OnHandshakeMessage( 19 void QuicCryptoClientStream::OnHandshakeMessage(
18 const CryptoHandshakeMessage& message) { 20 const CryptoHandshakeMessage& message) {
19 // Do not process handshake messages after the handshake is complete. 21 // Do not process handshake messages after the handshake is complete.
20 if (handshake_complete()) { 22 if (handshake_complete()) {
21 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); 23 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE);
22 return; 24 return;
23 } 25 }
24 26
25 if (message.tag != kSHLO) { 27 if (message.tag != kSHLO) {
26 CloseConnection(QUIC_INVALID_CRYPTO_MESSAGE_TYPE); 28 CloseConnection(QUIC_INVALID_CRYPTO_MESSAGE_TYPE);
27 return; 29 return;
28 } 30 }
29 31
30 // TODO(rch): correctly validate the message 32 // TODO(rch): correctly validate the message
31 SetHandshakeComplete(QUIC_NO_ERROR); 33 SetHandshakeComplete(QUIC_NO_ERROR);
32 return; 34 return;
33 } 35 }
34 36
37 bool QuicCryptoClientStream::CryptoConnect() {
38 client_crypto_config_.SetDefaults();
39 CryptoUtils::GenerateNonce(session()->connection()->clock(),
40 session()->connection()->random_generator(),
41 &nonce_);
42 CryptoHandshakeMessage message;
43 CryptoUtils::FillClientHelloMessage(client_crypto_config_, nonce_, &message);
44 SendHandshakeMessage(message);
45 return true;
46 }
47
35 } // namespace net 48 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_client_stream.h ('k') | net/quic/quic_crypto_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698