LEFT | RIGHT |
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* vim: set ts=2 et sw=2 tw=80: */ | 2 /* vim: set ts=2 et sw=2 tw=80: */ |
3 /* This Source Code Form is subject to the terms of the Mozilla Public | 3 /* This Source Code Form is subject to the terms of the Mozilla Public |
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | 6 |
7 #ifndef tls_connect_h_ | 7 #ifndef tls_connect_h_ |
8 #define tls_connect_h_ | 8 #define tls_connect_h_ |
9 | 9 |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Connect and check that it works. | 67 // Connect and check that it works. |
68 void Connect(); | 68 void Connect(); |
69 // Check that the connection was successfully established. | 69 // Check that the connection was successfully established. |
70 void CheckConnected(); | 70 void CheckConnected(); |
71 // Connect and expect it to fail. | 71 // Connect and expect it to fail. |
72 void ConnectExpectFail(); | 72 void ConnectExpectFail(); |
73 void ConnectWithCipherSuite(uint16_t cipher_suite); | 73 void ConnectWithCipherSuite(uint16_t cipher_suite); |
74 void CheckKeys(SSLKEAType kea_type, SSLAuthType auth_type, | 74 void CheckKeys(SSLKEAType kea_type, SSLAuthType auth_type, |
75 size_t kea_size = 0) const; | 75 size_t kea_size = 0) const; |
76 void CheckGroups(const DataBuffer& groups, | 76 void CheckGroups(const DataBuffer& groups, |
77 std::function<void(uint16_t, int)> check_group); | 77 std::function<void(uint16_t)> check_group); |
78 void CheckShares(const DataBuffer& shares, | 78 void CheckShares(const DataBuffer& shares, |
79 std::function<void(uint16_t, int)> check_group); | 79 std::function<void(uint16_t)> check_group); |
80 | 80 |
81 void SetExpectedVersion(uint16_t version); | 81 void SetExpectedVersion(uint16_t version); |
82 // Expect resumption of a particular type. | 82 // Expect resumption of a particular type. |
83 void ExpectResumption(SessionResumptionMode expected); | 83 void ExpectResumption(SessionResumptionMode expected); |
84 void DisableAllCiphers(); | 84 void DisableAllCiphers(); |
85 void EnableOnlyStaticRsaCiphers(); | 85 void EnableOnlyStaticRsaCiphers(); |
86 void EnableOnlyDheCiphers(); | 86 void EnableOnlyDheCiphers(); |
87 void EnableSomeEcdhCiphers(); | 87 void EnableSomeEcdhCiphers(); |
88 void EnableExtendedMasterSecret(); | 88 void EnableExtendedMasterSecret(); |
89 void ConfigureSessionCache(SessionResumptionMode client, | 89 void ConfigureSessionCache(SessionResumptionMode client, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 private: | 122 private: |
123 void CheckResumption(SessionResumptionMode expected); | 123 void CheckResumption(SessionResumptionMode expected); |
124 void CheckExtendedMasterSecret(); | 124 void CheckExtendedMasterSecret(); |
125 void CheckEarlyDataAccepted(); | 125 void CheckEarlyDataAccepted(); |
126 | 126 |
127 bool expect_extended_master_secret_; | 127 bool expect_extended_master_secret_; |
128 bool expect_early_data_accepted_; | 128 bool expect_early_data_accepted_; |
129 | 129 |
130 // Track groups and make sure that there are no duplicates. | 130 // Track groups and make sure that there are no duplicates. |
131 class CheckDuplicateGroup { | 131 class DuplicateGroupChecker { |
132 public: | 132 public: |
133 void AddAndCheckGroup(uint16_t group) { | 133 void AddAndCheckGroup(uint16_t group) { |
134 EXPECT_EQ(groups_.end(), groups_.find(group)) | 134 EXPECT_EQ(groups_.end(), groups_.find(group)) |
135 << "Group " << group << " should not be duplicated"; | 135 << "Group " << group << " should not be duplicated"; |
136 groups_.insert(group); | 136 groups_.insert(group); |
137 } | 137 } |
138 | 138 |
139 private: | 139 private: |
140 std::set<uint16_t> groups_; | 140 std::set<uint16_t> groups_; |
141 }; | 141 }; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 TlsConnectDatagram13() | 215 TlsConnectDatagram13() |
216 : TlsConnectTestBase(DGRAM, SSL_LIBRARY_VERSION_TLS_1_3) {} | 216 : TlsConnectTestBase(DGRAM, SSL_LIBRARY_VERSION_TLS_1_3) {} |
217 }; | 217 }; |
218 | 218 |
219 // A variant that is used only with Pre13. | 219 // A variant that is used only with Pre13. |
220 class TlsConnectGenericPre13 : public TlsConnectGeneric {}; | 220 class TlsConnectGenericPre13 : public TlsConnectGeneric {}; |
221 | 221 |
222 } // namespace nss_test | 222 } // namespace nss_test |
223 | 223 |
224 #endif | 224 #endif |
LEFT | RIGHT |