aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_common
diff options
context:
space:
mode:
authorHai Shalom <haishalom@google.com>2019-12-27 17:44:49 (GMT)
committerJouni Malinen <j@w1.fi>2020-01-10 17:16:13 (GMT)
commitd20365db17373c7dc989ab9539fa752034779ed8 (patch)
treec91e7ca3c558254b00ebef67858bbb43b8ab489c /src/eap_common
parent991e6b9e7971e77fe50cd9578e61a41b84acf74f (diff)
downloadhostap-d20365db17373c7dc989ab9539fa752034779ed8.zip
hostap-d20365db17373c7dc989ab9539fa752034779ed8.tar.gz
hostap-d20365db17373c7dc989ab9539fa752034779ed8.tar.bz2
EAP-SIM/AKA peer: Add support for EAP Method prefix
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>
Diffstat (limited to 'src/eap_common')
-rw-r--r--src/eap_common/eap_sim_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/eap_common/eap_sim_common.c b/src/eap_common/eap_sim_common.c
index 1e0f808..4a93244 100644
--- a/src/eap_common/eap_sim_common.c
+++ b/src/eap_common/eap_sim_common.c
@@ -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' */