All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: Encrypt "Group addressed privacy" action frames
@ 2016-06-15  5:38 Masashi Honma
  2016-06-18  9:11 ` Jouni Malinen
  0 siblings, 1 reply; 15+ messages in thread
From: Masashi Honma @ 2016-06-15  5:38 UTC (permalink / raw)
  To: linux-wireless; +Cc: Masashi Honma

Previously, the action frames to group address was not encrypted. But
[1] "Table 8-38 Category values" indicates "Mesh" and "Multihop" category
action frames should be encrypted (Group addressed privacy == yes). And the
encyption key should be MGTK ([1] 10.13 Group addressed robust management frame
procedures). So this patch modifies the code to make it suitable for spec.

[1] IEEE Std 802.11-2012

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
---
 net/mac80211/tx.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2030443..80afc47 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -578,6 +578,21 @@ ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx)
 	return TX_CONTINUE;
 }
 
+static bool debug_noinline
+ieee80211_is_group_privacy_action(struct ieee80211_hdr *hdr)
+{
+	struct ieee80211_mgmt *mgmt;
+
+	if (!ieee80211_is_action(hdr->frame_control) ||
+	    !is_multicast_ether_addr(hdr->addr1))
+		return false;
+
+	mgmt = (struct ieee80211_mgmt *)hdr;
+
+	return mgmt->u.action.category == WLAN_CATEGORY_MESH_ACTION ||
+		mgmt->u.action.category == WLAN_CATEGORY_MULTIHOP_ACTION;
+}
+
 static ieee80211_tx_result debug_noinline
 ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
 {
@@ -590,6 +605,9 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
 	else if (tx->sta &&
 		 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx])))
 		tx->key = key;
+	else if (ieee80211_is_group_privacy_action(hdr) &&
+		 (key = rcu_dereference(tx->sdata->default_multicast_key)))
+		tx->key = key;
 	else if (ieee80211_is_mgmt(hdr->frame_control) &&
 		 is_multicast_ether_addr(hdr->addr1) &&
 		 ieee80211_is_robust_mgmt_frame(tx->skb) &&
@@ -620,6 +638,8 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
 		case WLAN_CIPHER_SUITE_CCMP_256:
 		case WLAN_CIPHER_SUITE_GCMP:
 		case WLAN_CIPHER_SUITE_GCMP_256:
+			if (ieee80211_is_group_privacy_action(hdr))
+				break;
 			if (!ieee80211_is_data_present(hdr->frame_control) &&
 			    !ieee80211_use_mfp(hdr->frame_control, tx->sta,
 					       tx->skb))
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-06-29 23:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15  5:38 [PATCH] mac80211: Encrypt "Group addressed privacy" action frames Masashi Honma
2016-06-18  9:11 ` Jouni Malinen
2016-06-20  0:51   ` Masashi Honma
2016-06-20 21:25     ` Jouni Malinen
2016-06-21  6:16       ` Masashi Honma
2016-06-21 17:01         ` Jouni Malinen
2016-06-21 19:40           ` Johannes Berg
2016-06-22 10:54           ` Masashi Honma
2016-06-22 10:55           ` [PATCH v3] " Masashi Honma
2016-06-29 15:08             ` Masashi Honma
2016-06-29 16:25               ` Johannes Berg
2016-06-29 23:20                 ` Masashi Honma
2016-06-21  6:23       ` [PATCH v2] " Masashi Honma
2016-06-21 16:42         ` Jouni Malinen
2016-06-22 10:53           ` Masashi Honma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.