]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-MSCHAPv2: Use configured server identity
authorJouni Malinen <j@w1.fi>
Sat, 6 Jul 2013 15:37:54 +0000 (18:37 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 7 Jul 2013 17:30:10 +0000 (20:30 +0300)
Signed-hostap: Jouni Malinen <j@w1.fi>

src/eap_server/eap_server_mschapv2.c

index 8d3dd5233beb57d28321403d406412d28540018d..3153d2ecfb98150ae5d94f786a0c020b9d254766 100644 (file)
@@ -100,7 +100,6 @@ static struct wpabuf * eap_mschapv2_build_challenge(
 {
        struct wpabuf *req;
        struct eap_mschapv2_hdr *ms;
-       char *name = "hostapd"; /* TODO: make this configurable */
        size_t ms_len;
 
        if (!data->auth_challenge_from_tls &&
@@ -111,7 +110,7 @@ static struct wpabuf * eap_mschapv2_build_challenge(
                return NULL;
        }
 
-       ms_len = sizeof(*ms) + 1 + CHALLENGE_LEN + os_strlen(name);
+       ms_len = sizeof(*ms) + 1 + CHALLENGE_LEN + sm->server_id_len;
        req = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_MSCHAPV2, ms_len,
                            EAP_CODE_REQUEST, id);
        if (req == NULL) {
@@ -133,7 +132,7 @@ static struct wpabuf * eap_mschapv2_build_challenge(
                wpabuf_put(req, CHALLENGE_LEN);
        wpa_hexdump(MSG_MSGDUMP, "EAP-MSCHAPV2: Challenge",
                    data->auth_challenge, CHALLENGE_LEN);
-       wpabuf_put_data(req, name, os_strlen(name));
+       wpabuf_put_data(req, sm->server_id, sm->server_id_len);
 
        return req;
 }