diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-01-05 02:41:36 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-01-05 02:41:36 +0100 |
commit | 69e8407d51ae1cee79dad1af02f942e4dc9c5c7c (patch) | |
tree | a306d71cf7ce9b5788edee1105e2d12eb78f5e4a /src | |
parent | dcde15226558d499bb0636ace4d02263e911ca9f (diff) | |
download | strongswan-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.c | 15 |
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); |