diff options
author | Jack Lloyd <[email protected]> | 2019-07-11 06:07:56 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-07-13 06:56:30 -0400 |
commit | c50cc377956733736e65422f731a554341fa4799 (patch) | |
tree | 5d6a43de5d6647d5fd0f00b6fd2d8e39131cd868 /src/lib/tls/tls_channel.h | |
parent | bce64096b499a98a8879a334f822be709dad8560 (diff) |
Fix DTLS reconnection
Diffstat (limited to 'src/lib/tls/tls_channel.h')
-rw-r--r-- | src/lib/tls/tls_channel.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/tls/tls_channel.h b/src/lib/tls/tls_channel.h index 2a2b74332..8f977932b 100644 --- a/src/lib/tls/tls_channel.h +++ b/src/lib/tls/tls_channel.h @@ -66,6 +66,7 @@ class BOTAN_PUBLIC_API(2,0) Channel Session_Manager& session_manager, RandomNumberGenerator& rng, const Policy& policy, + bool is_server, bool is_datagram, size_t io_buf_sz = IO_BUF_DEFAULT_SIZE); @@ -83,6 +84,7 @@ class BOTAN_PUBLIC_API(2,0) Channel Session_Manager& session_manager, RandomNumberGenerator& rng, const Policy& policy, + bool is_server, bool is_datagram, size_t io_buf_sz = IO_BUF_DEFAULT_SIZE); @@ -160,7 +162,6 @@ class BOTAN_PUBLIC_API(2,0) Channel */ bool is_closed() const; - /** * @return certificate chain of the peer (may be empty) */ @@ -205,7 +206,8 @@ class BOTAN_PUBLIC_API(2,0) Channel virtual void process_handshake_msg(const Handshake_State* active_state, Handshake_State& pending_state, Handshake_Type type, - const std::vector<uint8_t>& contents) = 0; + const std::vector<uint8_t>& contents, + bool epoch0_restart) = 0; virtual void initiate_handshake(Handshake_State& state, bool force_full_renegotiation) = 0; @@ -242,6 +244,9 @@ class BOTAN_PUBLIC_API(2,0) Channel bool save_session(const Session& session); Callbacks& callbacks() const { return m_callbacks; } + + void reset_active_association_state(); + private: void init(size_t io_buf_sze); @@ -256,14 +261,14 @@ class BOTAN_PUBLIC_API(2,0) Channel void write_record(Connection_Cipher_State* cipher_state, uint16_t epoch, uint8_t type, const uint8_t input[], size_t length); + void reset_state(); + Connection_Sequence_Numbers& sequence_numbers() const; std::shared_ptr<Connection_Cipher_State> read_cipher_state_epoch(uint16_t epoch) const; std::shared_ptr<Connection_Cipher_State> write_cipher_state_epoch(uint16_t epoch) const; - void reset_state(); - const Handshake_State* active_state() const { return m_active_state.get(); } const Handshake_State* pending_state() const { return m_pending_state.get(); } @@ -272,13 +277,15 @@ class BOTAN_PUBLIC_API(2,0) Channel void process_handshake_ccs(const secure_vector<uint8_t>& record, uint64_t record_sequence, Record_Type record_type, - Protocol_Version record_version); + Protocol_Version record_version, + bool epoch0_restart); void process_application_data(uint64_t req_no, const secure_vector<uint8_t>& record); void process_alert(const secure_vector<uint8_t>& record); - bool m_is_datagram; + const bool m_is_server; + const bool m_is_datagram; /* callbacks */ std::unique_ptr<Compat_Callbacks> m_compat_callbacks; |