diff options
author | Jimmy Chen <jimmycmchen@google.com> | 2022-06-10 20:32:21 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-06-10 20:32:21 +0000 |
commit | ff2ecb6ba1a4bcf9679937a8cd8343af97dd9233 (patch) | |
tree | 75fa7f0e366d0861a88765e6fa3f22a69156b5dd | |
parent | 5813d4385331f592c91e79e573f6748dd88930a5 (diff) | |
parent | 4e6190d484a6b972f5fc7efab72e2c206171a4e1 (diff) | |
download | wpa_supplicant_8-ff2ecb6ba1a4bcf9679937a8cd8343af97dd9233.tar.gz |
eap: look for the realm of anonymous identity as well am: 37a3652d1e am: 4e6190d484
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/wpa_supplicant_8/+/18799353
Change-Id: I2209bbe2eae14fd129abfbfd3f7663104aba2ce0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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) { |