Interworking: Add realm to the anonymous identity from realm

If the username part in the credential does not include a realm,
generate one automatically based on the configured realm information.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2012-03-23 16:16:25 -07:00 committed by Jouni Malinen
parent 08410f08b9
commit 17218a7bab

View file

@ -793,6 +793,12 @@ int interworking_connect(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
if (anon == NULL) if (anon == NULL)
goto fail; goto fail;
os_snprintf(anon, buflen, "anonymous%s", pos); os_snprintf(anon, buflen, "anonymous%s", pos);
} else if (cred->realm) {
size_t buflen = 10 + os_strlen(cred->realm) + 1;
anon = os_malloc(buflen);
if (anon == NULL)
goto fail;
os_snprintf(anon, buflen, "anonymous@%s", cred->realm);
} else { } else {
anon = os_strdup("anonymous"); anon = os_strdup("anonymous");
if (anon == NULL) if (anon == NULL)