aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2011-01-05 02:41:36 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2011-01-05 02:41:36 +0100
commit69e8407d51ae1cee79dad1af02f942e4dc9c5c7c (patch)
treea306d71cf7ce9b5788edee1105e2d12eb78f5e4a /src
parentdcde15226558d499bb0636ace4d02263e911ca9f (diff)
downloadstrongswan-69e8407d51ae1cee79dad1af02f942e4dc9c5c7c.tar.bz2
strongswan-69e8407d51ae1cee79dad1af02f942e4dc9c5c7c.tar.xz
detect fragmentation of PB-TNC batch
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/plugins/tnccs_20/tnccs_20.c15
1 files changed, 11 insertions, 4 deletions
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);