aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/tls/tls_channel.cpp4
-rw-r--r--src/lib/tls/tls_channel.h8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/tls/tls_channel.cpp b/src/lib/tls/tls_channel.cpp
index 8ed876b3f..30f30d623 100644
--- a/src/lib/tls/tls_channel.cpp
+++ b/src/lib/tls/tls_channel.cpp
@@ -33,6 +33,10 @@ Channel::Channel(std::function<void (const byte[], size_t)> output_fn,
m_rng(rng),
m_session_manager(session_manager)
{
+ /* epoch 0 is plaintext, thus null cipher state */
+ m_write_cipher_states[0] = nullptr;
+ m_read_cipher_states[0] = nullptr;
+
m_writebuf.reserve(reserved_io_buffer_size);
m_readbuf.reserve(reserved_io_buffer_size);
}
diff --git a/src/lib/tls/tls_channel.h b/src/lib/tls/tls_channel.h
index 4e8fb47e5..6c159689a 100644
--- a/src/lib/tls/tls_channel.h
+++ b/src/lib/tls/tls_channel.h
@@ -240,11 +240,9 @@ class BOTAN_DLL Channel
std::unique_ptr<Handshake_State> m_active_state;
std::unique_ptr<Handshake_State> m_pending_state;
- /* cipher states for each epoch - epoch 0 is plaintext, thus null cipher state */
- std::map<u16bit, std::shared_ptr<Connection_Cipher_State>> m_write_cipher_states =
- { { 0, nullptr } };
- std::map<u16bit, std::shared_ptr<Connection_Cipher_State>> m_read_cipher_states =
- { { 0, nullptr } };
+ /* cipher states for each epoch */
+ std::map<u16bit, std::shared_ptr<Connection_Cipher_State>> m_write_cipher_states;
+ std::map<u16bit, std::shared_ptr<Connection_Cipher_State>> m_read_cipher_states;
/* I/O buffers */
secure_vector<byte> m_writebuf;