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).
This commit is contained in:
parent
93ef879f0f
commit
6652b61cd4
2 changed files with 15 additions and 21 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue