diff options
author | Jimmy Chen <jimmycmchen@google.com> | 2022-06-10 22:06:47 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-06-10 22:06:47 +0000 |
commit | 57723d67e2d7a7a397be6318a39485b2694571f6 (patch) | |
tree | 8b94e931cf5063f5c3be651f0fa4f1bd367ad75c /src | |
parent | 458a59ad13cbbdb428ce4ddad66ff0e8e5a0baf2 (diff) | |
parent | 43dfd079e391f685171b6eaf3976922234285631 (diff) | |
download | wpa_supplicant_8-57723d67e2d7a7a397be6318a39485b2694571f6.tar.gz |
eap: look for the realm of anonymous identity as well am: 37a3652d1e am: 4d1bdbe5cb am: 35905f7475 am: 43dfd079e3
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/wpa_supplicant_8/+/18799353
Change-Id: Ia881919ec30ae99d547ed5b7243a1c9310f1d521
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/eap_peer/eap_aka.c | 12 | ||||
-rw-r--r-- | src/eap_peer/eap_sim.c | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/eap_peer/eap_aka.c b/src/eap_peer/eap_aka.c index 8caae1d6..b7f86c37 100644 --- a/src/eap_peer/eap_aka.c +++ b/src/eap_peer/eap_aka.c @@ -409,6 +409,7 @@ static int eap_aka_learn_ids(struct eap_sm *sm, struct eap_aka_data *data, size_t identity_len = 0; const u8 *realm = NULL; size_t realm_len = 0; + struct eap_peer_config *config = eap_get_config(sm); wpa_hexdump_ascii(MSG_DEBUG, "EAP-AKA: (encr) AT_NEXT_PSEUDONYM", @@ -424,6 +425,17 @@ static int eap_aka_learn_ids(struct eap_sm *sm, struct eap_aka_data *data, break; } } + // If no realm from the permanent identity, look for the + // realm of the anonymous identity. + if (realm_len == 0 && config && config->anonymous_identity + && config->anonymous_identity_len > 0) { + for (realm = config->anonymous_identity, + realm_len = config->anonymous_identity_len; + realm_len > 0; realm_len--, realm++) { + if (*realm == '@') + break; + } + } data->pseudonym = os_malloc(attr->next_pseudonym_len + realm_len); if (data->pseudonym == NULL) { diff --git a/src/eap_peer/eap_sim.c b/src/eap_peer/eap_sim.c index 3b4c836d..9f66db21 100644 --- a/src/eap_peer/eap_sim.c +++ b/src/eap_peer/eap_sim.c @@ -432,6 +432,7 @@ static int eap_sim_learn_ids(struct eap_sm *sm, struct eap_sim_data *data, size_t identity_len = 0; const u8 *realm = NULL; size_t realm_len = 0; + struct eap_peer_config *config = eap_get_config(sm); wpa_hexdump_ascii(MSG_DEBUG, "EAP-SIM: (encr) AT_NEXT_PSEUDONYM", @@ -447,6 +448,17 @@ static int eap_sim_learn_ids(struct eap_sm *sm, struct eap_sim_data *data, break; } } + // If no realm from the permanent identity, look for the + // realm of the anonymous identity. + if (realm_len == 0 && config && config->anonymous_identity + && config->anonymous_identity_len > 0) { + for (realm = config->anonymous_identity, + realm_len = config->anonymous_identity_len; + realm_len > 0; realm_len--, realm++) { + if (*realm == '@') + break; + } + } data->pseudonym = os_malloc(attr->next_pseudonym_len + realm_len); if (data->pseudonym == NULL) { |