]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add AT_KDF attributes to Synchronization-Failure in EAP-AKA'
authorAkihiro Onodera <akihiro.onodera@sony.com>
Tue, 25 Jul 2017 03:24:18 +0000 (12:24 +0900)
committerJouni Malinen <j@w1.fi>
Sat, 9 Sep 2017 22:39:37 +0000 (01:39 +0300)
AT_KDF attributes need to be included in Synchronization-Failure
according to EAP-AKA' specification RFC 5448.

Signed-off-by: Tomoharu Hatano <tomoharu.hatano@sony.com>
src/eap_peer/eap_aka.c

index 8553667c5103310d0c6c8793c2125d8c0b339eed..430d9a236e5fdfc1d70d2c9d27868ba967885a34 100644 (file)
@@ -574,7 +574,7 @@ static struct wpabuf * eap_aka_authentication_reject(struct eap_aka_data *data,
 
 
 static struct wpabuf * eap_aka_synchronization_failure(
-       struct eap_aka_data *data, u8 id)
+       struct eap_aka_data *data, u8 id, struct eap_sim_attrs *attr)
 {
        struct eap_sim_msg *msg;
 
@@ -588,6 +588,15 @@ static struct wpabuf * eap_aka_synchronization_failure(
        wpa_printf(MSG_DEBUG, "   AT_AUTS");
        eap_sim_msg_add_full(msg, EAP_SIM_AT_AUTS, data->auts,
                             EAP_AKA_AUTS_LEN);
+       if (data->eap_method == EAP_TYPE_AKA_PRIME) {
+               size_t i;
+
+               for (i = 0; i < attr->kdf_count; i++) {
+                       wpa_printf(MSG_DEBUG, "   AT_KDF");
+                       eap_sim_msg_add(msg, EAP_SIM_AT_KDF, attr->kdf[i],
+                                       NULL, 0);
+               }
+       }
        return eap_sim_msg_finish(msg, data->eap_method, NULL, NULL, 0);
 }
 
@@ -969,7 +978,7 @@ static struct wpabuf * eap_aka_process_challenge(struct eap_sm *sm,
        } else if (res == -2) {
                wpa_printf(MSG_WARNING, "EAP-AKA: UMTS authentication "
                           "failed (AUTN seq# -> AUTS)");
-               return eap_aka_synchronization_failure(data, id);
+               return eap_aka_synchronization_failure(data, id, attr);
        } else if (res > 0) {
                wpa_printf(MSG_DEBUG, "EAP-AKA: Wait for external USIM processing");
                return NULL;