OLD | NEW |
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/crypto/crypto_utils.h" |
9 #include "net/quic/quic_protocol.h" | 9 #include "net/quic/quic_protocol.h" |
10 #include "net/quic/quic_session.h" | 10 #include "net/quic/quic_session.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 CloseConnection(QUIC_INVALID_CRYPTO_MESSAGE_TYPE); | 30 CloseConnection(QUIC_INVALID_CRYPTO_MESSAGE_TYPE); |
31 return; | 31 return; |
32 } | 32 } |
33 | 33 |
34 // TODO(rch): correctly validate the message | 34 // TODO(rch): correctly validate the message |
35 SetHandshakeComplete(QUIC_NO_ERROR); | 35 SetHandshakeComplete(QUIC_NO_ERROR); |
36 return; | 36 return; |
37 } | 37 } |
38 | 38 |
39 bool QuicCryptoClientStream::CryptoConnect() { | 39 bool QuicCryptoClientStream::CryptoConnect() { |
40 crypto_config_.SetClientDefaults(); | 40 crypto_config_.SetDefaults(); |
41 CryptoUtils::GenerateNonce(session()->connection()->clock(), | 41 CryptoUtils::GenerateNonce(session()->connection()->clock(), |
42 session()->connection()->random_generator(), | 42 session()->connection()->random_generator(), |
43 &nonce_); | 43 &nonce_); |
44 CryptoHandshakeMessage message; | 44 CryptoHandshakeMessage message; |
45 CryptoUtils::FillClientHelloMessage(crypto_config_, nonce_, | 45 crypto_config_.FillClientHello(nonce_, server_hostname_, &message); |
46 server_hostname_, &message); | |
47 SendHandshakeMessage(message); | 46 SendHandshakeMessage(message); |
48 return true; | 47 return true; |
49 } | 48 } |
50 | 49 |
51 } // namespace net | 50 } // namespace net |
OLD | NEW |