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 #ifndef NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
6 #define NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 6 #define NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/quic/crypto/channel_id.h" | 10 #include "net/quic/crypto/channel_id.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 enum State { | 99 enum State { |
100 STATE_IDLE, | 100 STATE_IDLE, |
101 STATE_INITIALIZE, | 101 STATE_INITIALIZE, |
102 STATE_SEND_CHLO, | 102 STATE_SEND_CHLO, |
103 STATE_RECV_REJ, | 103 STATE_RECV_REJ, |
104 STATE_VERIFY_PROOF, | 104 STATE_VERIFY_PROOF, |
105 STATE_VERIFY_PROOF_COMPLETE, | 105 STATE_VERIFY_PROOF_COMPLETE, |
106 STATE_GET_CHANNEL_ID, | 106 STATE_GET_CHANNEL_ID, |
107 STATE_GET_CHANNEL_ID_COMPLETE, | 107 STATE_GET_CHANNEL_ID_COMPLETE, |
108 STATE_RECV_SHLO, | 108 STATE_RECV_SHLO, |
| 109 STATE_INITIALIZE_SCUP, |
| 110 STATE_VERIFY_PROOF_SCUP, |
| 111 STATE_VERIFY_PROOF_COMPLETE_SCUP, |
| 112 STATE_VERIFY_PROOF_DONE, |
109 }; | 113 }; |
110 | 114 |
111 // Handles new server config and optional source-address token provided by the | 115 // Handles new server config and optional source-address token provided by the |
112 // server during a connection. | 116 // server during a connection. |
113 void HandleServerConfigUpdateMessage( | 117 void HandleServerConfigUpdateMessage( |
114 const CryptoHandshakeMessage& server_config_update); | 118 const CryptoHandshakeMessage& server_config_update); |
115 | 119 |
116 // DoHandshakeLoop performs a step of the handshake state machine. Note that | 120 // DoHandshakeLoop performs a step of the handshake state machine. Note that |
117 // |in| may be NULL if the call did not result from a received message. | 121 // |in| may be NULL if the call did not result from a received message. |
118 void DoHandshakeLoop(const CryptoHandshakeMessage* in); | 122 void DoHandshakeLoop(const CryptoHandshakeMessage* in); |
119 | 123 |
| 124 // Starts the proof verification. Returns the QuicAsyncStatus returned by the |
| 125 // ProofVerifier's VerifyProof. |
| 126 QuicAsyncStatus DoVerifyProof(QuicCryptoClientConfig::CachedState* cached); |
| 127 |
| 128 // If proof is valid then it sets the proof as valid (which persists the |
| 129 // server config) and returns QUIC_NO_ERROR. If not, it closes the connection |
| 130 // and returns QUIC_PROOF_INVALID. |
| 131 QuicErrorCode DoVerifyProofComplete( |
| 132 QuicCryptoClientConfig::CachedState* cached); |
| 133 |
120 // Called to set the proof of |cached| valid. Also invokes the session's | 134 // Called to set the proof of |cached| valid. Also invokes the session's |
121 // OnProofValid() method. | 135 // OnProofValid() method. |
122 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); | 136 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); |
123 | 137 |
124 // Returns true if the server crypto config in |cached| requires a ChannelID | 138 // Returns true if the server crypto config in |cached| requires a ChannelID |
125 // and the client config settings also allow sending a ChannelID. | 139 // and the client config settings also allow sending a ChannelID. |
126 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); | 140 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); |
127 | 141 |
128 QuicClientSessionBase* client_session(); | 142 QuicClientSessionBase* client_session(); |
129 | 143 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 bool verify_ok_; | 186 bool verify_ok_; |
173 string verify_error_details_; | 187 string verify_error_details_; |
174 scoped_ptr<ProofVerifyDetails> verify_details_; | 188 scoped_ptr<ProofVerifyDetails> verify_details_; |
175 | 189 |
176 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 190 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
177 }; | 191 }; |
178 | 192 |
179 } // namespace net | 193 } // namespace net |
180 | 194 |
181 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 195 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
OLD | NEW |