eap-mschapv2: Report username if different from EAP-Identity (or IKE identity)

This commit is contained in:
Tobias Brunner
2015-11-12 14:21:06 +01:00
parent 8f5e481953
commit 1d4b767275
@@ -1063,7 +1063,10 @@ static status_t process_server_response(private_eap_mschapv2_t *this,
name_len = min(data.len - RESPONSE_PAYLOAD_LEN, 255);
snprintf(buf, sizeof(buf), "%.*s", name_len, res->name);
userid = identification_create_from_string(buf);
DBG2(DBG_IKE, "EAP-MS-CHAPv2 username: '%Y'", userid);
if (!userid->equals(userid, this->peer))
{
DBG1(DBG_IKE, "EAP-MS-CHAPv2 username: '%Y'", userid);
}
/* userid can only be destroyed after the last use of username */
username = extract_username(userid->get_encoding(userid));