aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_channel.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-07-16 16:01:30 +0000
committerlloyd <[email protected]>2012-07-16 16:01:30 +0000
commit848639860716273e29eb66b0a181d036a534fdae (patch)
tree21a8a4aabe4b74baa6319064951efeb9b0cf7bf8 /src/tls/tls_channel.cpp
parent3d2867a708d9faf1837f5b1e2f44ded75da60780 (diff)
Add a class that handles writing handshake messages instead of pushing
that task to Record_Writer. Needed for DTLS work.
Diffstat (limited to 'src/tls/tls_channel.cpp')
-rw-r--r--src/tls/tls_channel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tls/tls_channel.cpp b/src/tls/tls_channel.cpp
index 84ee69e04..d77f6dbcf 100644
--- a/src/tls/tls_channel.cpp
+++ b/src/tls/tls_channel.cpp
@@ -177,8 +177,8 @@ void Channel::read_handshake(byte rec_type,
if(rec_type == HANDSHAKE)
{
if(!m_state)
- m_state = new Handshake_State(this->new_handshake_reader());
- m_state->handshake_reader()->add_input(&rec_buf[0], rec_buf.size());
+ m_state = new_handshake_state();
+ m_state->handshake_reader().add_input(&rec_buf[0], rec_buf.size());
}
BOTAN_ASSERT_NONNULL(m_state);
@@ -189,10 +189,10 @@ void Channel::read_handshake(byte rec_type,
if(rec_type == HANDSHAKE)
{
- if(m_state->handshake_reader()->have_full_record())
+ if(m_state->handshake_reader().have_full_record())
{
std::pair<Handshake_Type, std::vector<byte> > msg =
- m_state->handshake_reader()->get_next_record();
+ m_state->handshake_reader().get_next_record();
process_handshake_msg(msg.first, msg.second);
}
else
@@ -200,7 +200,7 @@ void Channel::read_handshake(byte rec_type,
}
else if(rec_type == CHANGE_CIPHER_SPEC)
{
- if(m_state->handshake_reader()->empty() && rec_buf.size() == 1 && rec_buf[0] == 1)
+ if(m_state->handshake_reader().empty() && rec_buf.size() == 1 && rec_buf[0] == 1)
process_handshake_msg(HANDSHAKE_CCS, std::vector<byte>());
else
throw Decoding_Error("Malformed ChangeCipherSpec message");
@@ -208,7 +208,7 @@ void Channel::read_handshake(byte rec_type,
else
throw Decoding_Error("Unknown message type in handshake processing");
- if(type == HANDSHAKE_CCS || !m_state || !m_state->handshake_reader()->have_full_record())
+ if(type == HANDSHAKE_CCS || !m_state || !m_state->handshake_reader().have_full_record())
break;
}
}