Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211.c
| Show First 20 Lines • Show All 2,687 Lines • ▼ Show 20 Lines | |||||
| * This is either a WEP key or a GROUP key. | * This is either a WEP key or a GROUP key. | ||||
| * | * | ||||
| * Note this will NOT return true if it is a IGTK key. | * Note this will NOT return true if it is a IGTK key. | ||||
| */ | */ | ||||
| bool | bool | ||||
| ieee80211_is_key_global(const struct ieee80211vap *vap, | ieee80211_is_key_global(const struct ieee80211vap *vap, | ||||
| const struct ieee80211_key *key) | const struct ieee80211_key *key) | ||||
| { | { | ||||
| return (&vap->iv_nw_keys[0] <= key && | return (&vap->iv_nw_keys[0] <= key && | ||||
| key < &vap->iv_nw_keys[IEEE80211_WEP_NKID]); | key < &vap->iv_nw_keys[IEEE80211_WEP_NKID]); | ||||
| } | } | ||||
| /* | /* | ||||
| * Determine whether the given key in the given VAP is an iGTK key. | * Determine whether the given key in the given VAP is an iGTK key. | ||||
| * (key index 4 and 5, shared between all stations on a VAP.) | * (key index 4 and 5, shared between all stations on a VAP.) | ||||
| */ | */ | ||||
| bool | bool | ||||
| ieee80211_is_key_igtk(const struct ieee80211vap *vap, | ieee80211_is_key_igtk(const struct ieee80211vap *vap, | ||||
| const struct ieee80211_key *key) | const struct ieee80211_key *key) | ||||
| { | { | ||||
| return false; | |||||
| /* TODO: don't hard-code these two key indexes? */ | |||||
| return (key == &vap->iv_nw_keys[4] || key == &vap->iv_nw_keys[5]); | |||||
| } | } | ||||
| /* | /* | ||||
| * Determine whether the given key in the given VAP is a unicast key. | * Determine whether the given key in the given VAP is a unicast key. | ||||
| */ | */ | ||||
| bool | bool | ||||
| ieee80211_is_key_unicast(const struct ieee80211vap *vap, | ieee80211_is_key_unicast(const struct ieee80211vap *vap, | ||||
| const struct ieee80211_key *key) | const struct ieee80211_key *key) | ||||
| { | { | ||||
| /* | |||||
| * This is a short-cut for now; eventually we will need | return (!(ieee80211_is_key_global(vap, key) | ||||
| * to support multiple unicast keys, IGTK, etc) so we | || ieee80211_is_key_igtk(vap, key))); | ||||
| * will absolutely need to fix the key flags. | |||||
| */ | |||||
| return (!ieee80211_is_key_global(vap, key)); | |||||
| } | } | ||||