From 69e8407d51ae1cee79dad1af02f942e4dc9c5c7c Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Wed, 5 Jan 2011 02:41:36 +0100 Subject: detect fragmentation of PB-TNC batch --- src/libcharon/plugins/tnccs_20/tnccs_20.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libcharon/plugins/tnccs_20/tnccs_20.c b/src/libcharon/plugins/tnccs_20/tnccs_20.c index 0bdd8f1e8..8e433b934 100644 --- a/src/libcharon/plugins/tnccs_20/tnccs_20.c +++ b/src/libcharon/plugins/tnccs_20/tnccs_20.c @@ -539,10 +539,17 @@ METHOD(tls_t, build, status_t, pb_tnc_batch_type_names, batch_type, data.len, this->connection_id); DBG3(DBG_TNC, "%B", &data); - *msglen = data.len; - *buflen = data.len; - memcpy(buf, data.ptr, data.len); + + if (data.len > *buflen) + { + DBG1(DBG_TNC, "Fragmentation of PB-TNC Batch not supported yet"); + } + else + { + *buflen = data.len; + } + memcpy(buf, data.ptr, *buflen); status = ALREADY_DONE; } else @@ -557,7 +564,7 @@ METHOD(tls_t, build, status_t, } else { - DBG1(DBG_TNC, "no TNCCS batch to send"); + DBG1(DBG_TNC, "no PB-TNC batch to send"); status = INVALID_STATE; } this->mutex->unlock(this->mutex); -- cgit v1.2.3