]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Interworking: Add realm to the anonymous identity from realm
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 23 Mar 2012 23:16:25 +0000 (16:16 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 30 Mar 2012 08:13:25 +0000 (11:13 +0300)
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>

wpa_supplicant/interworking.c

index 74dacace542d9c64612a49f9581016f689bf8ee5..5e8cf7bb4741c732554ebc8826fa940a5e7ebaca 100644 (file)
@@ -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)