diff options
author | sam <sam@FreeBSD.org> | 2006-03-07 05:47:04 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2006-03-07 05:47:04 +0000 |
commit | 84f883d618d0eca94f2e20b3d29474005c455cc6 (patch) | |
tree | 161a6132f61b543e3759ff389bacc462dacf3d72 /contrib/hostapd/eap_identity.c | |
parent | f87f3cf9d3ac68ade33194941f85722ffdff2195 (diff) | |
parent | 8d55057fb42bf9070fd379acbcb6fc4ef793d2a7 (diff) | |
download | FreeBSD-src-84f883d618d0eca94f2e20b3d29474005c455cc6.zip FreeBSD-src-84f883d618d0eca94f2e20b3d29474005c455cc6.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r156373,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/hostapd/eap_identity.c')
-rw-r--r-- | contrib/hostapd/eap_identity.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/hostapd/eap_identity.c b/contrib/hostapd/eap_identity.c index 31aedc4..54efc47 100644 --- a/contrib/hostapd/eap_identity.c +++ b/contrib/hostapd/eap_identity.c @@ -66,8 +66,17 @@ static u8 * eap_identity_buildReq(struct eap_sm *sm, void *priv, int id, struct eap_identity_data *data = priv; struct eap_hdr *req; u8 *pos; + const char *req_data; + size_t req_data_len; - *reqDataLen = sizeof(*req) + 1; + if (sm->eapol_cb->get_eap_req_id_text) { + req_data = sm->eapol_cb->get_eap_req_id_text(sm->eapol_ctx, + &req_data_len); + } else { + req_data = NULL; + req_data_len = 0; + } + *reqDataLen = sizeof(*req) + 1 + req_data_len; req = malloc(*reqDataLen); if (req == NULL) { wpa_printf(MSG_ERROR, "EAP-Identity: Failed to allocate " @@ -80,7 +89,9 @@ static u8 * eap_identity_buildReq(struct eap_sm *sm, void *priv, int id, req->identifier = id; req->length = htons(*reqDataLen); pos = (u8 *) (req + 1); - *pos = EAP_TYPE_IDENTITY; + *pos++ = EAP_TYPE_IDENTITY; + if (req_data) + memcpy(pos, req_data, req_data_len); return (u8 *) req; } |