aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_tnc.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-07-16 23:17:37 (GMT)
committerJouni Malinen <j@w1.fi>2008-07-16 23:17:37 (GMT)
commit6652b61cd4492f42e523b89effe97c92ac148681 (patch)
treeb35f24f8e49dec6a3b75f98b7fd490baf3ee1e6f /src/eap_peer/eap_tnc.c
parent93ef879f0fedcaed519345b5181690e6d0993c57 (diff)
downloadhostap-6652b61cd4492f42e523b89effe97c92ac148681.zip
hostap-6652b61cd4492f42e523b89effe97c92ac148681.tar.gz
hostap-6652b61cd4492f42e523b89effe97c92ac148681.tar.bz2
Fixed EAP-TNC not to include extra EAP header and TNC flags
The change to support fragmentation added extra function to generate the EAP header, but forgot to remove the original code and ended up getting two EAP headers and TNC flags field in the generated message. These header fields need to be added only in the function that builds the final message (and if necessary, fragments the data).
Diffstat (limited to 'src/eap_peer/eap_tnc.c')
-rw-r--r--src/eap_peer/eap_tnc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/eap_peer/eap_tnc.c b/src/eap_peer/eap_tnc.c
index c8d822f..b2705f7 100644
--- a/src/eap_peer/eap_tnc.c
+++ b/src/eap_peer/eap_tnc.c
@@ -206,7 +206,7 @@ static struct wpabuf * eap_tnc_process(struct eap_sm *sm, void *priv,
struct eap_tnc_data *data = priv;
struct wpabuf *resp;
const u8 *pos, *end;
- u8 *rpos, *rpos1, *start;
+ u8 *rpos, *rpos1;
size_t len, rlen;
size_t imc_len;
char *start_buf, *end_buf;
@@ -380,17 +380,14 @@ static struct wpabuf * eap_tnc_process(struct eap_sm *sm, void *priv,
}
end_len = os_strlen(end_buf);
- rlen = 1 + start_len + imc_len + end_len;
- resp = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_TNC, rlen,
- EAP_CODE_RESPONSE, eap_get_id(reqData));
+ rlen = start_len + imc_len + end_len;
+ resp = wpabuf_alloc(rlen);
if (resp == NULL) {
os_free(start_buf);
os_free(end_buf);
return NULL;
}
- start = wpabuf_put(resp, 0);
- wpabuf_put_u8(resp, EAP_TNC_VERSION);
wpabuf_put_data(resp, start_buf, start_len);
os_free(start_buf);
@@ -401,7 +398,8 @@ static struct wpabuf * eap_tnc_process(struct eap_sm *sm, void *priv,
wpabuf_put_data(resp, end_buf, end_len);
os_free(end_buf);
- wpa_hexdump_ascii(MSG_MSGDUMP, "EAP-TNC: Response", start, rlen);
+ wpa_hexdump_ascii(MSG_MSGDUMP, "EAP-TNC: Response",
+ wpabuf_head(resp), wpabuf_len(resp));
data->out_buf = resp;
data->state = MSG;