From 17218a7babd390e3ea9b3e5b2f40602e3a6c91d9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 23 Mar 2012 16:16:25 -0700 Subject: [PATCH] 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 --- wpa_supplicant/interworking.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index 74dacace5..5e8cf7bb4 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -793,6 +793,12 @@ int interworking_connect(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) if (anon == NULL) goto fail; 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 { anon = os_strdup("anonymous"); if (anon == NULL)