diff options
Diffstat (limited to 'security/nss/gtests/ssl_gtest/tls_agent.h')
-rw-r--r-- | security/nss/gtests/ssl_gtest/tls_agent.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/security/nss/gtests/ssl_gtest/tls_agent.h b/security/nss/gtests/ssl_gtest/tls_agent.h index 5385a6173..f9bb26aee 100644 --- a/security/nss/gtests/ssl_gtest/tls_agent.h +++ b/security/nss/gtests/ssl_gtest/tls_agent.h @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -8,6 +9,7 @@ #include "prio.h" #include "ssl.h" +#include "sslproto.h" #include <functional> #include <iostream> @@ -75,8 +77,9 @@ class TlsAgent : public PollTarget { static const std::string kServerEcdhEcdsa; static const std::string kServerEcdhRsa; static const std::string kServerDsa; - static const std::string kDelegatorEcdsa256; // draft-ietf-tls-subcerts - static const std::string kDelegatorRsae2048; // draft-ietf-tls-subcerts + static const std::string kDelegatorEcdsa256; // draft-ietf-tls-subcerts + static const std::string kDelegatorRsae2048; // draft-ietf-tls-subcerts + static const std::string kDelegatorRsaPss2048; // draft-ietf-tls-subcerts TlsAgent(const std::string& name, Role role, SSLProtocolVariant variant); virtual ~TlsAgent(); @@ -155,6 +158,7 @@ class TlsAgent : public PollTarget { void SetServerKeyBits(uint16_t bits); void ExpectReadWriteError(); void EnableFalseStart(); + void ExpectPsk(); void ExpectResumption(); void SkipVersionChecks(); void SetSignatureSchemes(const SSLSignatureScheme* schemes, size_t count); @@ -174,8 +178,11 @@ class TlsAgent : public PollTarget { // Send data directly to the underlying socket, skipping the TLS layer. void SendDirect(const DataBuffer& buf); void SendRecordDirect(const TlsRecord& record); + void AddPsk(const ScopedPK11SymKey& psk, std::string label, SSLHashType hash, + uint16_t zeroRttSuite = TLS_NULL_WITH_NULL_NULL); + void RemovePsk(std::string label); void ReadBytes(size_t max = 16384U); - void ResetSentBytes(); // Hack to test drops. + void ResetSentBytes(size_t bytes = 0); // Hack to test drops. void EnableExtendedMasterSecret(); void CheckExtendedMasterSecret(bool expected); void CheckEarlyDataAccepted(bool expected); @@ -246,6 +253,8 @@ class TlsAgent : public PollTarget { return true; } + void expected_cipher_suite(uint16_t suite) { expected_cipher_suite_ = suite; } + std::string cipher_suite_name() const { if (state_ != STATE_CONNECTED) return "UNKNOWN"; @@ -416,8 +425,8 @@ class TlsAgent : public PollTarget { bool falsestart_enabled_; uint16_t expected_version_; uint16_t expected_cipher_suite_; - bool expect_resumption_; bool expect_client_auth_; + SSLPskType expect_psk_; bool can_falsestart_hook_called_; bool sni_hook_called_; bool auth_certificate_hook_called_; |