aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2007-12-13 14:39:38 +0000
committerMartin Willi <martin@strongswan.org>2007-12-13 14:39:38 +0000
commit3243ac6d5e9d24508dcf8ba03895091f4b4ba424 (patch)
tree1c2fd0c0cfac59db4e08d7f82525260753110a2d /src/charon
parent26e24676922445a7f63defac5a675191d987d09b (diff)
downloadstrongswan-3243ac6d5e9d24508dcf8ba03895091f4b4ba424.tar.bz2
strongswan-3243ac6d5e9d24508dcf8ba03895091f4b4ba424.tar.xz
fixed actual ID length when AT_IDENTITY gets padded
Diffstat (limited to 'src/charon')
-rw-r--r--src/charon/sa/authenticators/eap/eap_sim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/charon/sa/authenticators/eap/eap_sim.c b/src/charon/sa/authenticators/eap/eap_sim.c
index 38d7f2534..e369c56e3 100644
--- a/src/charon/sa/authenticators/eap/eap_sim.c
+++ b/src/charon/sa/authenticators/eap/eap_sim.c
@@ -264,6 +264,7 @@ static eap_payload_t *build_payload(private_eap_sim_t *this, u_int8_t identifier
}
case AT_IDENTITY:
{
+ u_int16_t act_len = data.len;
/* align up to four byte */
if (data.len % 4)
{
@@ -275,7 +276,7 @@ static eap_payload_t *build_payload(private_eap_sim_t *this, u_int8_t identifier
*pos.ptr = data.len/4 + 1;
pos = chunk_skip(pos, 1);
/* actual length in bytes */
- *(u_int16_t*)pos.ptr = htons(data.len);
+ *(u_int16_t*)pos.ptr = htons(act_len);
pos = chunk_skip(pos, sizeof(u_int16_t));
memcpy(pos.ptr, data.ptr, data.len);
pos = chunk_skip(pos, data.len);