Lines Matching defs:key

963 /* Get the BIP key index from MMIE; return -1 if this is not a BIP frame */
1862 struct ieee80211_key *key = NULL;
1866 /* Make sure key gets set if either BIGTK key index is set so that
1868 * Beacon frames and Beacon frames that claim to use another BIGTK key
1869 * index (i.e., a key that we do not have).
1883 key = rcu_dereference(rx->sta->gtk[idx]);
1884 if (!key)
1885 key = rcu_dereference(sdata->keys[idx]);
1886 if (!key && rx->sta)
1887 key = rcu_dereference(rx->sta->gtk[idx2]);
1888 if (!key)
1889 key = rcu_dereference(sdata->keys[idx2]);
1891 return key;
1921 * When selecting a key, we have to distinguish between multicast
1925 * then unicast frames can also use key indices like GTKs. Hence, if we
1926 * don't have a PTK/STK we check the key index for a WEP key.
1934 * The spec seems to expect that one negotiates the same key with
1939 /* start without a key */
1940 rx->key = NULL;
1963 rx->key = ptk_idx ? ptk_idx : sta_ptk;
1986 rx->key = ieee80211_rx_get_bigtk(rx, mmie_keyidx);
1987 if (!rx->key)
2003 rx->key = rcu_dereference(rx->sta->gtk[mmie_keyidx]);
2005 if (!rx->key)
2006 rx->key = rcu_dereference(rx->sdata->keys[mmie_keyidx]);
2010 * need to set rx->key if there is a key that could have been
2014 struct ieee80211_key *key = NULL;
2019 key = ieee80211_rx_get_bigtk(rx, -1);
2022 key = rcu_dereference(rx->sdata->default_mgmt_key);
2026 key = rcu_dereference(rx->sta->gtk[i]);
2027 if (key)
2031 if (!key) {
2033 key = rcu_dereference(sdata->keys[i]);
2034 if (key)
2039 if (key)
2040 rx->key = key;
2045 * able to look up the key. That's ok though, we
2048 * Except for key threshold notifications, should
2049 * we somehow allow the driver to tell us which key
2063 rx->key = rcu_dereference(rx->sta->gtk[keyidx]);
2065 /* if not found, try default key */
2066 if (!rx->key) {
2067 rx->key = rcu_dereference(rx->sdata->keys[keyidx]);
2072 * but for WEP we allow using a key index as well.
2074 if (rx->key &&
2075 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP40 &&
2076 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP104 &&
2078 rx->key = NULL;
2082 if (rx->key) {
2083 if (unlikely(rx->key->flags & KEY_FLAG_TAINTED))
2091 switch (rx->key->conf.cipher) {
2226 return rx->key &&
2227 (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP ||
2228 rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 ||
2229 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP ||
2230 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) &&
2289 entry->key_color = rx->key->color;
2291 rx->key->u.ccmp.rx_pn[queue],
2297 BUILD_BUG_ON(sizeof(rx->key->u.ccmp.rx_pn[queue]) !=
2298 sizeof(rx->key->u.gcmp.rx_pn[queue]));
2301 } else if (rx->key &&
2305 entry->key_color = rx->key->color;
2332 /* Prevent mixed key and fragment cache attacks */
2333 if (entry->key_color != rx->key->color)
2348 (!rx->key ||
2351 rx->key->color != entry->key_color)) {
2352 /* Drop this as a mixed key or fragment cache attack, even
2357 } else if (entry->is_protected && rx->key &&
2358 entry->key_color != rx->key->color &&
2440 /* Drop unencrypted frames if key is set. */
2443 ieee80211_is_data(fc) && rx->key))
2465 rx->key)) {
2483 if (unlikely(ieee80211_is_beacon(fc) && rx->key &&
2494 if (unlikely(ieee80211_is_action(fc) && !rx->key &&
2811 if (rx->key) {
2818 switch (rx->key->conf.cipher) {
3847 * path (e.g. key data, station data, ...) concurrently when
4191 struct ieee80211_key *key;
4277 key = rcu_dereference(sta->ptk[sta->ptk_idx]);
4278 if (!key)
4279 key = rcu_dereference(sdata->default_unicast_key);
4280 if (key) {
4281 switch (key->conf.cipher) {
4297 fastrx.key = true;
4298 fastrx.icv_len = key->conf.icv_len;
4392 if (fast_rx->key &&
4419 /* assign the key to drop unencrypted frames (later)
4422 if (fast_rx->key && !(status->flag & RX_FLAG_IV_STRIPPED)) {
4448 if (rx->key && !(status->flag & RX_FLAG_MIC_STRIPPED) &&
4478 if (rx->key && !ieee80211_has_protected(hdr->frame_control))
4861 * key references and virtual interfaces are protected using RCU