diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-08-18 22:07:27 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-08-18 22:07:27 +0200 |
commit | ee346b54c1837cdc36bd95c2d294758a7cbf9fbf (patch) | |
tree | 5e4de886f1ea6897e2224a3f8c781f056fe79cc1 /src/libtls/tls_fragmentation.c | |
parent | ba31fe1fd65feba781434ee4fabd9b1fd6432ecb (diff) | |
download | strongswan-ee346b54c1837cdc36bd95c2d294758a7cbf9fbf.tar.bz2 strongswan-ee346b54c1837cdc36bd95c2d294758a7cbf9fbf.tar.xz |
add TLS handshake packet size to debug output
Diffstat (limited to 'src/libtls/tls_fragmentation.c')
-rw-r--r-- | src/libtls/tls_fragmentation.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libtls/tls_fragmentation.c b/src/libtls/tls_fragmentation.c index d6b6ef1ae..8265b8c95 100644 --- a/src/libtls/tls_fragmentation.c +++ b/src/libtls/tls_fragmentation.c @@ -124,8 +124,8 @@ static status_t process_handshake(private_tls_fragmentation_t *this, 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); @@ -202,6 +202,7 @@ METHOD(tls_fragmentation_t, process, status_t, 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; @@ -242,10 +243,11 @@ METHOD(tls_fragmentation_t, build, status_t, 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; |