]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-SIM/AKA peer: Add support for EAP Method prefix
authorHai Shalom <haishalom@google.com>
Fri, 27 Dec 2019 17:44:49 +0000 (09:44 -0800)
committerJouni Malinen <j@w1.fi>
Fri, 10 Jan 2020 17:16:13 +0000 (19:16 +0200)
Add support for EAP method prefix in the anonymous identity
used during EAP-SIM/AKA/AKA' authentication when encrypted IMSI
is used. The prefix is a single character that indicates which
EAP method is required by the client.

Signed-off-by: Hai Shalom <haishalom@google.com>
src/eap_common/eap_sim_common.c

index 1e0f80879dafdf38e75276882ec77ff55c35c8e2..4a9324406509fe03c2e23432f4df46aa63e787ce 100644 (file)
@@ -1219,6 +1219,10 @@ int eap_sim_anonymous_username(const u8 *id, size_t id_len)
            os_memcmp(id, anonymous_id_prefix, anonymous_id_len) == 0)
                return 1; /* 'anonymous@realm' */
 
+       if (id_len > anonymous_id_len + 1 &&
+           os_memcmp(id + 1, anonymous_id_prefix, anonymous_id_len) == 0)
+               return 1; /* 'Xanonymous@realm' where X is an EAP method code */
+
        if (id_len > 1 && id[0] == '@')
                return 1; /* '@realm' */