| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_CRYPTO_CRYPTO_HANDSHAKE_H_ | 5 #ifndef NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ |
| 6 #define NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ | 6 #define NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // A CrypterPair contains the encrypter and decrypter for an encryption level. | 93 // A CrypterPair contains the encrypter and decrypter for an encryption level. |
| 94 struct NET_EXPORT_PRIVATE CrypterPair { | 94 struct NET_EXPORT_PRIVATE CrypterPair { |
| 95 CrypterPair(); | 95 CrypterPair(); |
| 96 ~CrypterPair(); | 96 ~CrypterPair(); |
| 97 std::unique_ptr<QuicEncrypter> encrypter; | 97 std::unique_ptr<QuicEncrypter> encrypter; |
| 98 std::unique_ptr<QuicDecrypter> decrypter; | 98 std::unique_ptr<QuicDecrypter> decrypter; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 // Parameters negotiated by the crypto handshake. | 101 // Parameters negotiated by the crypto handshake. |
| 102 struct NET_EXPORT_PRIVATE QuicCryptoNegotiatedParameters { | 102 struct NET_EXPORT_PRIVATE QuicCryptoNegotiatedParameters |
| 103 : public base::RefCounted<QuicCryptoNegotiatedParameters> { |
| 103 // Initializes the members to 0 or empty values. | 104 // Initializes the members to 0 or empty values. |
| 104 QuicCryptoNegotiatedParameters(); | 105 QuicCryptoNegotiatedParameters(); |
| 105 ~QuicCryptoNegotiatedParameters(); | |
| 106 | 106 |
| 107 QuicTag key_exchange; | 107 QuicTag key_exchange; |
| 108 QuicTag aead; | 108 QuicTag aead; |
| 109 std::string initial_premaster_secret; | 109 std::string initial_premaster_secret; |
| 110 std::string forward_secure_premaster_secret; | 110 std::string forward_secure_premaster_secret; |
| 111 // initial_subkey_secret is used as the PRK input to the HKDF used when | 111 // initial_subkey_secret is used as the PRK input to the HKDF used when |
| 112 // performing key extraction that needs to happen before forward-secure keys | 112 // performing key extraction that needs to happen before forward-secure keys |
| 113 // are available. | 113 // are available. |
| 114 std::string initial_subkey_secret; | 114 std::string initial_subkey_secret; |
| 115 // subkey_secret is used as the PRK input to the HKDF used for key extraction. | 115 // subkey_secret is used as the PRK input to the HKDF used for key extraction. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 142 bool x509_ecdsa_supported; | 142 bool x509_ecdsa_supported; |
| 143 bool x509_supported; | 143 bool x509_supported; |
| 144 | 144 |
| 145 // Used to generate cert chain when sending server config updates. | 145 // Used to generate cert chain when sending server config updates. |
| 146 std::string client_common_set_hashes; | 146 std::string client_common_set_hashes; |
| 147 std::string client_cached_cert_hashes; | 147 std::string client_cached_cert_hashes; |
| 148 | 148 |
| 149 // Default to false; set to true if the client indicates that it supports sct | 149 // Default to false; set to true if the client indicates that it supports sct |
| 150 // by sending CSCT tag with an empty value in client hello. | 150 // by sending CSCT tag with an empty value in client hello. |
| 151 bool sct_supported_by_client; | 151 bool sct_supported_by_client; |
| 152 |
| 153 private: |
| 154 friend class base::RefCounted<QuicCryptoNegotiatedParameters>; |
| 155 virtual ~QuicCryptoNegotiatedParameters(); |
| 152 }; | 156 }; |
| 153 | 157 |
| 154 // QuicCryptoConfig contains common configuration between clients and servers. | 158 // QuicCryptoConfig contains common configuration between clients and servers. |
| 155 class NET_EXPORT_PRIVATE QuicCryptoConfig { | 159 class NET_EXPORT_PRIVATE QuicCryptoConfig { |
| 156 public: | 160 public: |
| 157 // kInitialLabel is a constant that is used when deriving the initial | 161 // kInitialLabel is a constant that is used when deriving the initial |
| 158 // (non-forward secure) keys for the connection in order to tie the resulting | 162 // (non-forward secure) keys for the connection in order to tie the resulting |
| 159 // key to this protocol. | 163 // key to this protocol. |
| 160 static const char kInitialLabel[]; | 164 static const char kInitialLabel[]; |
| 161 | 165 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 183 | 187 |
| 184 const CommonCertSets* common_cert_sets; | 188 const CommonCertSets* common_cert_sets; |
| 185 | 189 |
| 186 private: | 190 private: |
| 187 DISALLOW_COPY_AND_ASSIGN(QuicCryptoConfig); | 191 DISALLOW_COPY_AND_ASSIGN(QuicCryptoConfig); |
| 188 }; | 192 }; |
| 189 | 193 |
| 190 } // namespace net | 194 } // namespace net |
| 191 | 195 |
| 192 #endif // NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ | 196 #endif // NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ |
| OLD | NEW |