mac80211: 802.11w - Use BIP (AES-128-CMAC)

Add mechanism for managing BIP keys (IGTK) and integrate BIP into the
TX/RX paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Jouni Malinen
2009-01-08 13:32:02 +02:00
committed by John W. Linville
parent 765cb46a3f
commit 3cfcf6ac6d
14 changed files with 317 additions and 21 deletions

View File

@@ -133,6 +133,9 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
case WLAN_CIPHER_SUITE_CCMP:
alg = ALG_CCMP;
break;
case WLAN_CIPHER_SUITE_AES_CMAC:
alg = ALG_AES_CMAC;
break;
default:
return -EINVAL;
}
@@ -275,6 +278,17 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
else
params.cipher = WLAN_CIPHER_SUITE_WEP104;
break;
case ALG_AES_CMAC:
params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
seq[0] = key->u.aes_cmac.tx_pn[5];
seq[1] = key->u.aes_cmac.tx_pn[4];
seq[2] = key->u.aes_cmac.tx_pn[3];
seq[3] = key->u.aes_cmac.tx_pn[2];
seq[4] = key->u.aes_cmac.tx_pn[1];
seq[5] = key->u.aes_cmac.tx_pn[0];
params.seq = seq;
params.seq_len = 6;
break;
}
params.key = key->conf.key;
@@ -304,6 +318,22 @@ static int ieee80211_config_default_key(struct wiphy *wiphy,
return 0;
}
static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy,
struct net_device *dev,
u8 key_idx)
{
struct ieee80211_sub_if_data *sdata;
rcu_read_lock();
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
ieee80211_set_default_mgmt_key(sdata, key_idx);
rcu_read_unlock();
return 0;
}
static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
{
struct ieee80211_sub_if_data *sdata = sta->sdata;
@@ -1153,6 +1183,7 @@ struct cfg80211_ops mac80211_config_ops = {
.del_key = ieee80211_del_key,
.get_key = ieee80211_get_key,
.set_default_key = ieee80211_config_default_key,
.set_default_mgmt_key = ieee80211_config_default_mgmt_key,
.add_beacon = ieee80211_add_beacon,
.set_beacon = ieee80211_set_beacon,
.del_beacon = ieee80211_del_beacon,