if (this->input.len == this->inpos)
{ /* message completely defragmented, process */
msg = tls_reader_create(this->input);
- DBG2(DBG_IKE, "received TLS %N message",
- tls_handshake_type_names, this->type);
+ DBG2(DBG_IKE, "received TLS %N message (%u bytes)",
+ tls_handshake_type_names, this->type, 4 + this->input.len);
status = this->handshake->process(this->handshake, this->type, msg);
msg->destroy(msg);
chunk_free(&this->input);
METHOD(tls_fragmentation_t, build, status_t,
private_tls_fragmentation_t *this, tls_content_type_t *type, chunk_t *data)
{
+ chunk_t hs_data;
tls_handshake_type_t hs_type;
tls_writer_t *writer, *msg;
status_t status = INVALID_STATE;
switch (status)
{
case NEED_MORE:
- DBG2(DBG_IKE, "sending TLS %N message",
- tls_handshake_type_names, hs_type);
+ hs_data = writer->get_buf(writer);
msg->write_uint8(msg, hs_type);
- msg->write_data24(msg, writer->get_buf(writer));
+ msg->write_data24(msg, hs_data);
+ DBG2(DBG_IKE, "sending TLS %N message (%u bytes)",
+ tls_handshake_type_names, hs_type, 4 + hs_data.len);
break;
case INVALID_STATE:
*type = TLS_HANDSHAKE;