eap-mschapv2: Report username if different from EAP-Identity (or IKE identity)
authorTobias Brunner <tobias@strongswan.org>
Thu, 5 Nov 2015 13:07:49 +0000 (14:07 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 12 Nov 2015 13:21:06 +0000 (14:21 +0100)
src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c

index 3411bdb..69d9d2b 100644 (file)
@@ -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));