9#include <botan/internal/tls_handshake_transitions.h>
11#include <botan/tls_exceptn.h>
89std::string handshake_mask_to_string(uint32_t mask,
char combiner)
113 std::ostringstream o;
116 for(
auto&& t : types)
118 if(mask & bitmask_for_handshake_type(t))
134 const uint32_t mask = bitmask_for_handshake_type(msg_type);
136 return (m_hand_received_mask & mask) != 0;
141 const uint32_t mask = bitmask_for_handshake_type(msg_type);
143 m_hand_received_mask |= mask;
145 const bool ok = (m_hand_expecting_mask & mask) != 0;
149 const uint32_t seen_so_far = m_hand_received_mask & ~mask;
151 std::ostringstream msg;
155 if(m_hand_expecting_mask == 0)
156 { msg <<
" not expecting messages"; }
158 { msg <<
" expected " << handshake_mask_to_string(m_hand_expecting_mask,
'|'); }
161 { msg <<
" seen " << handshake_mask_to_string(seen_so_far,
'+'); }
170 m_hand_expecting_mask = 0;
175 m_hand_expecting_mask |= bitmask_for_handshake_type(msg_type);
180 for (
const auto type : msg_types)
188 return (bitmask_for_handshake_type(
HANDSHAKE_CCS) & m_hand_expecting_mask) != 0;
void confirm_transition_to(Handshake_Type msg_type)
bool received_handshake_msg(Handshake_Type msg_type) const
void set_expected_next(Handshake_Type msg_type)
bool change_cipher_spec_expected() const
std::string to_string(const BER_Object &obj)
const char * handshake_type_to_string(Handshake_Type type)