From ffcda135d2b0fd2a862f2a710e740c002a8bfc97 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Sat, 21 Oct 2017 01:27:19 +0200 Subject: [PATCH] eapol: Check for "No Group Traffic" group cipher suite --- src/eapol.c | 10 ++++++---- src/wiphy.c | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/eapol.c b/src/eapol.c index 4a02c8a1..986e1d54 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -1268,10 +1268,8 @@ static void eapol_handle_ptk_3_of_4(struct eapol_sm *sm, override); } - /* - * TODO: Handle IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC case - */ - if (!sm->handshake->wpa_ie) { + if (!sm->handshake->wpa_ie && sm->handshake->group_cipher != + IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC) { gtk = handshake_util_find_gtk_kde(decrypted_key_data, decrypted_key_data_size, >k_len); @@ -1555,6 +1553,10 @@ static void eapol_key_handle(struct eapol_sm *sm, if (!sm->handshake->ptk_complete) goto done; + if (sm->handshake->group_cipher == + IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC) + goto done; + if (!decrypted_key_data) goto done; diff --git a/src/wiphy.c b/src/wiphy.c index abff4376..ffa431e3 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -70,6 +70,9 @@ static struct l_queue *wiphy_list = NULL; enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask) { + if (mask == IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC) + return IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC; + mask &= wiphy->supported_ciphers; /* CCMP is our first choice, TKIP second */