diff options
author | Jouni Malinen <j@w1.fi> | 2009-01-08 06:32:00 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:00:01 -0500 |
commit | fb7333367632c67d8b6b06fb8d906cdabb11b02a (patch) | |
tree | 337d89f2c8c033b00dfcefbbcbded3f914d51661 /net/mac80211/tx.c | |
parent | 5394af4d86ae51b369ff243c3f75b6f9a74e164b (diff) |
mac80211: 802.11w - CCMP for management frames
Extend CCMP to support encryption and decryption of unicast management
frames.
Signed-off-by: Jouni Malinen <j@w1.fi>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index cd6bc87eec73..50c6c4fabea5 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -330,6 +330,22 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx) | |||
330 | return TX_CONTINUE; | 330 | return TX_CONTINUE; |
331 | } | 331 | } |
332 | 332 | ||
333 | static int ieee80211_use_mfp(__le16 fc, struct sta_info *sta, | ||
334 | struct sk_buff *skb) | ||
335 | { | ||
336 | if (!ieee80211_is_mgmt(fc)) | ||
337 | return 0; | ||
338 | |||
339 | if (sta == NULL || !test_sta_flags(sta, WLAN_STA_MFP)) | ||
340 | return 0; | ||
341 | |||
342 | if (!ieee80211_is_robust_mgmt_frame((struct ieee80211_hdr *) | ||
343 | skb->data)) | ||
344 | return 0; | ||
345 | |||
346 | return 1; | ||
347 | } | ||
348 | |||
333 | static ieee80211_tx_result | 349 | static ieee80211_tx_result |
334 | ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) | 350 | ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) |
335 | { | 351 | { |
@@ -428,10 +444,15 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) | |||
428 | if (ieee80211_is_auth(hdr->frame_control)) | 444 | if (ieee80211_is_auth(hdr->frame_control)) |
429 | break; | 445 | break; |
430 | case ALG_TKIP: | 446 | case ALG_TKIP: |
431 | case ALG_CCMP: | ||
432 | if (!ieee80211_is_data_present(hdr->frame_control)) | 447 | if (!ieee80211_is_data_present(hdr->frame_control)) |
433 | tx->key = NULL; | 448 | tx->key = NULL; |
434 | break; | 449 | break; |
450 | case ALG_CCMP: | ||
451 | if (!ieee80211_is_data_present(hdr->frame_control) && | ||
452 | !ieee80211_use_mfp(hdr->frame_control, tx->sta, | ||
453 | tx->skb)) | ||
454 | tx->key = NULL; | ||
455 | break; | ||
435 | } | 456 | } |
436 | } | 457 | } |
437 | 458 | ||