diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-11 01:19:30 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-11 01:19:30 +0000 |
commit | 9251a8681cdf164191f31603e7319eb44dfc1e73 (patch) | |
tree | 0e80812da590dc9d901c4cba6a8ad7db672b4cec | |
parent | 473b4a619b8f7de3e9aa34afd64f7921e221e75d (diff) | |
parent | 37a3652d1e3e7b7724d7e0a7c68197c396979d97 (diff) | |
download | wpa_supplicant_8-android-security-13.0.0_r1.tar.gz |
Snap for 8710048 from 37a3652d1e3e7b7724d7e0a7c68197c396979d97 to tm-releaseandroid-vts-13.0_r1android-security-13.0.0_r9android-security-13.0.0_r8android-security-13.0.0_r7android-security-13.0.0_r6android-security-13.0.0_r5android-security-13.0.0_r4android-security-13.0.0_r3android-security-13.0.0_r2android-security-13.0.0_r18android-security-13.0.0_r17android-security-13.0.0_r16android-security-13.0.0_r15android-security-13.0.0_r14android-security-13.0.0_r13android-security-13.0.0_r12android-security-13.0.0_r11android-security-13.0.0_r10android-security-13.0.0_r1android-cts-13.0_r1android-13.0.0_r3android-13.0.0_r2android-13.0.0_r1android13-security-releaseandroid13-s1-release
Change-Id: Ia91aa730a85c36d84d59d055c6c82b9fd9236b88
-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 8c475f13..ee7010d4 100644 --- a/src/eap_peer/eap_aka.c +++ b/src/eap_peer/eap_aka.c @@ -385,6 +385,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", @@ -400,6 +401,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 09866277..de423e8b 100644 --- a/src/eap_peer/eap_sim.c +++ b/src/eap_peer/eap_sim.c @@ -407,6 +407,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", @@ -422,6 +423,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) { |