Add AT_KDF attributes to Synchronization-Failure in EAP-AKA'

Message ID 1500953058-4961-1-git-send-email-tomoharu.hatano@sony.com
State Accepted
Headers show

Commit Message

Hatano, Tomoharu (Sony Mobile) July 25, 2017, 3:24 a.m.
From: Akihiro Onodera <akihiro.onodera@sony.com>

AT_KDF attributes need to be included in Synchronization-Failure
according to EAP-AKA' specification RFC5448.

Change-Id: I5d1c2c1371094fdc39ee155ef83d6143ac8f37eb
Signed-off-by: Tomoharu Hatano <tomoharu.hatano@sony.com>
---
 src/eap_peer/eap_aka.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Hatano, Tomoharu (Sony Mobile) Aug. 31, 2017, 11:43 a.m. | #1
Hi Hostap,

I'm waiting for your feedback.
When you can start the review?

Best Regards,
Tomoharu Hatano

-----Original Message-----
From: Hatano, Tomoharu (Sony Mobile) 
Sent: Wednesday, August 16, 2017 9:52 PM
To: 'Tomoharu Hatano' <tomoharu.hatano@sony.com>; hostap@lists.infradead.org
Cc: Sogo, Shinji (Sony Mobile) <Shinji.Sogo@sony.com>; Nanbu, Tomonori (Sony Mobile) <Tomonori.Nanbu@sony.com>; Onodera, Akihiro X (Sony Mobile) <Akihiro.Onodera@sony.com>; Hatano, Tomoharu (Sony Mobile) <Tomoharu.Hatano@sony.com>
Subject: RE: [PATCH] Add AT_KDF attributes to Synchronization-Failure in EAP-AKA'

Hi Hostap,

Do you have any progress about review?

Best Regards,
Tomoharu Hatano

-----Original Message-----
From: Tomoharu Hatano [mailto:tomoharu.hatano@sony.com] 
Sent: Tuesday, July 25, 2017 12:24 PM
To: hostap@lists.infradead.org
Cc: Sogo, Shinji (Sony Mobile) <Shinji.Sogo@sony.com>; Nanbu, Tomonori (Sony Mobile) <Tomonori.Nanbu@sony.com>; Onodera, Akihiro X (Sony Mobile) <Akihiro.Onodera@sony.com>; Hatano, Tomoharu (Sony Mobile) <Tomoharu.Hatano@sony.com>
Subject: [PATCH] Add AT_KDF attributes to Synchronization-Failure in EAP-AKA'

From: Akihiro Onodera <akihiro.onodera@sony.com>

AT_KDF attributes need to be included in Synchronization-Failure according to EAP-AKA' specification RFC5448.

Change-Id: I5d1c2c1371094fdc39ee155ef83d6143ac8f37eb
Signed-off-by: Tomoharu Hatano <tomoharu.hatano@sony.com>
---
 src/eap_peer/eap_aka.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/eap_peer/eap_aka.c b/src/eap_peer/eap_aka.c index 0bac62d..981bea2 100644
--- a/src/eap_peer/eap_aka.c
+++ b/src/eap_peer/eap_aka.c
@@ -570,7 +570,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;
 
@@ -584,6 +584,12 @@ 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++) {
+			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);  }
 
@@ -966,7 +972,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;
--
2.7.4
Jouni Malinen Sept. 9, 2017, 11:19 p.m. | #2
On Tue, Jul 25, 2017 at 12:24:18PM +0900, Tomoharu Hatano wrote:
> AT_KDF attributes need to be included in Synchronization-Failure
> according to EAP-AKA' specification RFC5448.

Thanks, applied.
Hatano, Tomoharu (Sony Mobile) Sept. 11, 2017, 5:52 a.m. | #3
Hi Jouni,

Thank you for your approval.

Best Regards,
Tomoharu Hatano

-----Original Message-----
From: Jouni Malinen [mailto:j@w1.fi] 
Sent: Sunday, September 10, 2017 8:19 AM
To: Hatano, Tomoharu (Sony Mobile) <Tomoharu.Hatano@sony.com>
Cc: hostap@lists.infradead.org; Akihiro Onodera <akihiro.onodera@sony.com>; Nanbu, Tomonori (Sony Mobile) <Tomonori.Nanbu@sony.com>; Sogo, Shinji (Sony Mobile) <Shinji.Sogo@sony.com>
Subject: Re: [PATCH] Add AT_KDF attributes to Synchronization-Failure in EAP-AKA'

On Tue, Jul 25, 2017 at 12:24:18PM +0900, Tomoharu Hatano wrote:
> AT_KDF attributes need to be included in Synchronization-Failure 
> according to EAP-AKA' specification RFC5448.

Thanks, applied.

Patch

diff --git a/src/eap_peer/eap_aka.c b/src/eap_peer/eap_aka.c
index 0bac62d..981bea2 100644
--- a/src/eap_peer/eap_aka.c
+++ b/src/eap_peer/eap_aka.c
@@ -570,7 +570,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;
 
@@ -584,6 +584,12 @@  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++) {
+			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);
 }
 
@@ -966,7 +972,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;