Lines Matching defs:key

984 /* Get the BIP key index from MMIE; return -1 if this is not a BIP frame */
1875 struct ieee80211_key *key = NULL;
1878 /* Make sure key gets set if either BIGTK key index is set so that
1880 * Beacon frames and Beacon frames that claim to use another BIGTK key
1881 * index (i.e., a key that we do not have).
1895 key = rcu_dereference(rx->link_sta->gtk[idx]);
1896 if (!key)
1897 key = rcu_dereference(rx->link->gtk[idx]);
1898 if (!key && rx->link_sta)
1899 key = rcu_dereference(rx->link_sta->gtk[idx2]);
1900 if (!key)
1901 key = rcu_dereference(rx->link->gtk[idx2]);
1903 return key;
1932 * When selecting a key, we have to distinguish between multicast
1936 * then unicast frames can also use key indices like GTKs. Hence, if we
1937 * don't have a PTK/STK we check the key index for a WEP key.
1945 * The spec seems to expect that one negotiates the same key with
1950 /* start without a key */
1951 rx->key = NULL;
1973 rx->key = ptk_idx ? ptk_idx : sta_ptk;
1996 rx->key = ieee80211_rx_get_bigtk(rx, mmie_keyidx);
1997 if (!rx->key)
2013 rx->key = rcu_dereference(rx->link_sta->gtk[mmie_keyidx]);
2015 if (!rx->key)
2016 rx->key = rcu_dereference(rx->link->gtk[mmie_keyidx]);
2020 * need to set rx->key if there is a key that could have been
2024 struct ieee80211_key *key = NULL;
2028 key = ieee80211_rx_get_bigtk(rx, -1);
2031 key = rcu_dereference(rx->link->default_mgmt_key);
2035 key = rcu_dereference(rx->link_sta->gtk[i]);
2036 if (key)
2040 if (!key) {
2042 key = rcu_dereference(rx->link->gtk[i]);
2043 if (key)
2048 if (key)
2049 rx->key = key;
2054 * able to look up the key. That's ok though, we
2057 * Except for key threshold notifications, should
2058 * we somehow allow the driver to tell us which key
2072 rx->key = rcu_dereference(rx->link_sta->gtk[keyidx]);
2074 /* if not found, try default key */
2075 if (!rx->key) {
2077 rx->key = rcu_dereference(rx->link->gtk[keyidx]);
2078 if (!rx->key)
2079 rx->key = rcu_dereference(rx->sdata->keys[keyidx]);
2084 * but for WEP we allow using a key index as well.
2086 if (rx->key &&
2087 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP40 &&
2088 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP104 &&
2090 rx->key = NULL;
2094 if (rx->key) {
2095 if (unlikely(rx->key->flags & KEY_FLAG_TAINTED))
2103 switch (rx->key->conf.cipher) {
2238 return rx->key &&
2239 (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP ||
2240 rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 ||
2241 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP ||
2242 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) &&
2301 entry->key_color = rx->key->color;
2303 rx->key->u.ccmp.rx_pn[queue],
2309 BUILD_BUG_ON(sizeof(rx->key->u.ccmp.rx_pn[queue]) !=
2310 sizeof(rx->key->u.gcmp.rx_pn[queue]));
2313 } else if (rx->key &&
2317 entry->key_color = rx->key->color;
2344 /* Prevent mixed key and fragment cache attacks */
2345 if (entry->key_color != rx->key->color)
2360 (!rx->key ||
2363 rx->key->color != entry->key_color)) {
2364 /* Drop this as a mixed key or fragment cache attack, even
2369 } else if (entry->is_protected && rx->key &&
2370 entry->key_color != rx->key->color &&
2426 /* Drop unencrypted frames if key is set. */
2429 ieee80211_is_data(fc) && rx->key))
2461 * during 4-way-HS (key is installed after HS).
2463 if (!rx->key)
2482 if (unlikely(ieee80211_is_beacon(fc) && rx->key &&
2493 if (unlikely(ieee80211_is_action(fc) && !rx->key &&
2766 struct ieee80211_mesh_fast_tx_key key = {
2778 ether_addr_copy(key.addr, mesh_hdr->eaddr1);
2780 ether_addr_copy(key.addr, skb->data);
2784 entry = mesh_fast_tx_get(sdata, &key);
3140 if (rx->key) {
3147 switch (rx->key->conf.cipher) {
4166 * path (e.g. key data, station data, ...) concurrently when
4571 struct ieee80211_key *key;
4666 key = rcu_dereference(sta->ptk[sta->ptk_idx]);
4667 if (!key)
4668 key = rcu_dereference(sdata->default_unicast_key);
4669 if (key) {
4670 switch (key->conf.cipher) {
4686 fastrx.key = true;
4687 fastrx.icv_len = key->conf.icv_len;
4893 if (fast_rx->key &&
4920 /* assign the key to drop unencrypted frames (later)
4923 if (fast_rx->key && !(status->flag & RX_FLAG_IV_STRIPPED)) {
4950 if (rx->key && !(status->flag & RX_FLAG_MIC_STRIPPED) &&
4954 if (rx->key && !ieee80211_has_protected(hdr->frame_control))
5477 * key references and virtual interfaces are protected using RCU