Lines Matching full:key

32  * DOC: Key handling basics
34 * Key handling in mac80211 is done based on per-interface (sub_if_data)
36 * each station key also belongs to that interface.
39 * that are implemented in software, for each key the hardware is asked
40 * to enable that key for offloading but if it cannot do that the key is
43 * There is currently no way of knowing whether a key is handled in SW
46 * All key management is internally protected by a mutex. Within all
47 * other parts of mac80211, key references are, just as STA structure
49 * unprotected, namely the key->sta dereferences within the hardware
51 * remove the key which waits for an RCU grace period.
87 * 1. SKB resize was skipped because no key was added but just before in increment_tailroom_need_count()
88 * the xmit key is added and SW encryption kicks off. in increment_tailroom_need_count()
91 * just before xmit one of the key is deleted and SW encryption kicks in increment_tailroom_need_count()
125 static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key) in ieee80211_key_enable_hw_accel() argument
127 struct ieee80211_sub_if_data *sdata = key->sdata; in ieee80211_key_enable_hw_accel()
133 if (key->flags & KEY_FLAG_TAINTED) { in ieee80211_key_enable_hw_accel()
134 /* If we get here, it's during resume and the key is in ieee80211_key_enable_hw_accel()
141 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE && in ieee80211_key_enable_hw_accel()
142 !(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC | in ieee80211_key_enable_hw_accel()
147 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; in ieee80211_key_enable_hw_accel()
151 if (!key->local->ops->set_key) in ieee80211_key_enable_hw_accel()
154 assert_key_lock(key->local); in ieee80211_key_enable_hw_accel()
156 sta = key->sta; in ieee80211_key_enable_hw_accel()
162 if (sta && !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE) && in ieee80211_key_enable_hw_accel()
163 !ieee80211_hw_check(&key->local->hw, SUPPORTS_PER_STA_GTK)) in ieee80211_key_enable_hw_accel()
174 if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) { in ieee80211_key_enable_hw_accel()
180 ret = drv_set_key(key->local, SET_KEY, sdata, in ieee80211_key_enable_hw_accel()
181 sta ? &sta->sta : NULL, &key->conf); in ieee80211_key_enable_hw_accel()
184 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; in ieee80211_key_enable_hw_accel()
186 if (!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC | in ieee80211_key_enable_hw_accel()
191 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && in ieee80211_key_enable_hw_accel()
192 (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)); in ieee80211_key_enable_hw_accel()
194 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_MIC_SPACE) && in ieee80211_key_enable_hw_accel()
195 (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)); in ieee80211_key_enable_hw_accel()
202 "failed to set key (%d, %pM) to hardware (%d)\n", in ieee80211_key_enable_hw_accel()
203 key->conf.keyidx, in ieee80211_key_enable_hw_accel()
207 switch (key->conf.cipher) { in ieee80211_key_enable_hw_accel()
222 if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL)) in ieee80211_key_enable_hw_accel()
230 static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) in ieee80211_key_disable_hw_accel() argument
238 if (!key || !key->local->ops->set_key) in ieee80211_key_disable_hw_accel()
241 assert_key_lock(key->local); in ieee80211_key_disable_hw_accel()
243 if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) in ieee80211_key_disable_hw_accel()
246 sta = key->sta; in ieee80211_key_disable_hw_accel()
247 sdata = key->sdata; in ieee80211_key_disable_hw_accel()
249 if (!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC | in ieee80211_key_disable_hw_accel()
254 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; in ieee80211_key_disable_hw_accel()
255 ret = drv_set_key(key->local, DISABLE_KEY, sdata, in ieee80211_key_disable_hw_accel()
256 sta ? &sta->sta : NULL, &key->conf); in ieee80211_key_disable_hw_accel()
260 "failed to remove key (%d, %pM) from hardware (%d)\n", in ieee80211_key_disable_hw_accel()
261 key->conf.keyidx, in ieee80211_key_disable_hw_accel()
265 static int _ieee80211_set_tx_key(struct ieee80211_key *key, bool force) in _ieee80211_set_tx_key() argument
267 struct sta_info *sta = key->sta; in _ieee80211_set_tx_key()
268 struct ieee80211_local *local = key->local; in _ieee80211_set_tx_key()
274 sta->ptk_idx = key->conf.keyidx; in _ieee80211_set_tx_key()
283 int ieee80211_set_tx_key(struct ieee80211_key *key) in ieee80211_set_tx_key() argument
285 return _ieee80211_set_tx_key(key, false); in ieee80211_set_tx_key()
298 /* Extended Key ID key install, initial one or rekey */ in ieee80211_pairwise_rekey()
302 /* Aggregation Sessions with Extended Key ID must not in ieee80211_pairwise_rekey()
307 * supporting A-MPDU key borders. (Blocking Tx only in ieee80211_pairwise_rekey()
319 /* Rekey without Extended Key ID. in ieee80211_pairwise_rekey()
327 /* Stop Tx till we are on the new key */ in ieee80211_pairwise_rekey()
350 struct ieee80211_key *key = NULL; in __ieee80211_set_default_key() local
355 key = key_mtx_dereference(sdata->local, sdata->keys[idx]); in __ieee80211_set_default_key()
358 rcu_assign_pointer(sdata->default_unicast_key, key); in __ieee80211_set_default_key()
365 rcu_assign_pointer(sdata->default_multicast_key, key); in __ieee80211_set_default_key()
381 struct ieee80211_key *key = NULL; in __ieee80211_set_default_mgmt_key() local
387 key = key_mtx_dereference(sdata->local, sdata->keys[idx]); in __ieee80211_set_default_mgmt_key()
389 rcu_assign_pointer(sdata->default_mgmt_key, key); in __ieee80211_set_default_mgmt_key()
405 struct ieee80211_key *key = NULL; in __ieee80211_set_default_beacon_key() local
412 key = key_mtx_dereference(sdata->local, sdata->keys[idx]); in __ieee80211_set_default_beacon_key()
414 rcu_assign_pointer(sdata->default_beacon_key, key); in __ieee80211_set_default_beacon_key()
447 /* Unicast rekey needs special handling. With Extended Key ID in ieee80211_key_replace()
481 /* Only needed for transition from no key -> key. in ieee80211_key_replace()
482 * Still triggers unnecessary when using Extended Key ID in ieee80211_key_replace()
483 * and installing the second key ID the first time. in ieee80211_key_replace()
537 struct ieee80211_key *key; in ieee80211_key_alloc() local
545 key = kzalloc(sizeof(struct ieee80211_key) + key_len, GFP_KERNEL); in ieee80211_key_alloc()
546 if (!key) in ieee80211_key_alloc()
551 * key to the hardware if possible. in ieee80211_key_alloc()
553 key->conf.flags = 0; in ieee80211_key_alloc()
554 key->flags = 0; in ieee80211_key_alloc()
556 key->conf.cipher = cipher; in ieee80211_key_alloc()
557 key->conf.keyidx = idx; in ieee80211_key_alloc()
558 key->conf.keylen = key_len; in ieee80211_key_alloc()
562 key->conf.iv_len = IEEE80211_WEP_IV_LEN; in ieee80211_key_alloc()
563 key->conf.icv_len = IEEE80211_WEP_ICV_LEN; in ieee80211_key_alloc()
566 key->conf.iv_len = IEEE80211_TKIP_IV_LEN; in ieee80211_key_alloc()
567 key->conf.icv_len = IEEE80211_TKIP_ICV_LEN; in ieee80211_key_alloc()
570 key->u.tkip.rx[i].iv32 = in ieee80211_key_alloc()
572 key->u.tkip.rx[i].iv16 = in ieee80211_key_alloc()
576 spin_lock_init(&key->u.tkip.txlock); in ieee80211_key_alloc()
579 key->conf.iv_len = IEEE80211_CCMP_HDR_LEN; in ieee80211_key_alloc()
580 key->conf.icv_len = IEEE80211_CCMP_MIC_LEN; in ieee80211_key_alloc()
584 key->u.ccmp.rx_pn[i][j] = in ieee80211_key_alloc()
588 * Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
591 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
593 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
594 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
595 kfree(key); in ieee80211_key_alloc()
600 key->conf.iv_len = IEEE80211_CCMP_256_HDR_LEN; in ieee80211_key_alloc()
601 key->conf.icv_len = IEEE80211_CCMP_256_MIC_LEN; in ieee80211_key_alloc()
604 key->u.ccmp.rx_pn[i][j] = in ieee80211_key_alloc()
606 /* Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
609 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
611 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
612 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
613 kfree(key); in ieee80211_key_alloc()
619 key->conf.iv_len = 0; in ieee80211_key_alloc()
621 key->conf.icv_len = sizeof(struct ieee80211_mmie); in ieee80211_key_alloc()
623 key->conf.icv_len = sizeof(struct ieee80211_mmie_16); in ieee80211_key_alloc()
626 key->u.aes_cmac.rx_pn[j] = in ieee80211_key_alloc()
629 * Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
632 key->u.aes_cmac.tfm = in ieee80211_key_alloc()
634 if (IS_ERR(key->u.aes_cmac.tfm)) { in ieee80211_key_alloc()
635 err = PTR_ERR(key->u.aes_cmac.tfm); in ieee80211_key_alloc()
636 kfree(key); in ieee80211_key_alloc()
642 key->conf.iv_len = 0; in ieee80211_key_alloc()
643 key->conf.icv_len = sizeof(struct ieee80211_mmie_16); in ieee80211_key_alloc()
646 key->u.aes_gmac.rx_pn[j] = in ieee80211_key_alloc()
648 /* Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
651 key->u.aes_gmac.tfm = in ieee80211_key_alloc()
653 if (IS_ERR(key->u.aes_gmac.tfm)) { in ieee80211_key_alloc()
654 err = PTR_ERR(key->u.aes_gmac.tfm); in ieee80211_key_alloc()
655 kfree(key); in ieee80211_key_alloc()
661 key->conf.iv_len = IEEE80211_GCMP_HDR_LEN; in ieee80211_key_alloc()
662 key->conf.icv_len = IEEE80211_GCMP_MIC_LEN; in ieee80211_key_alloc()
665 key->u.gcmp.rx_pn[i][j] = in ieee80211_key_alloc()
667 /* Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
670 key->u.gcmp.tfm = ieee80211_aes_gcm_key_setup_encrypt(key_data, in ieee80211_key_alloc()
672 if (IS_ERR(key->u.gcmp.tfm)) { in ieee80211_key_alloc()
673 err = PTR_ERR(key->u.gcmp.tfm); in ieee80211_key_alloc()
674 kfree(key); in ieee80211_key_alloc()
681 kfree(key); in ieee80211_key_alloc()
685 key->conf.iv_len = cs->hdr_len; in ieee80211_key_alloc()
686 key->conf.icv_len = cs->mic_len; in ieee80211_key_alloc()
689 key->u.gen.rx_pn[i][j] = in ieee80211_key_alloc()
691 key->flags |= KEY_FLAG_CIPHER_SCHEME; in ieee80211_key_alloc()
694 memcpy(key->conf.key, key_data, key_len); in ieee80211_key_alloc()
695 INIT_LIST_HEAD(&key->list); in ieee80211_key_alloc()
697 return key; in ieee80211_key_alloc()
700 static void ieee80211_key_free_common(struct ieee80211_key *key) in ieee80211_key_free_common() argument
702 switch (key->conf.cipher) { in ieee80211_key_free_common()
705 ieee80211_aes_key_free(key->u.ccmp.tfm); in ieee80211_key_free_common()
709 ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); in ieee80211_key_free_common()
713 ieee80211_aes_gmac_key_free(key->u.aes_gmac.tfm); in ieee80211_key_free_common()
717 ieee80211_aes_gcm_key_free(key->u.gcmp.tfm); in ieee80211_key_free_common()
720 kfree_sensitive(key); in ieee80211_key_free_common()
723 static void __ieee80211_key_destroy(struct ieee80211_key *key, in __ieee80211_key_destroy() argument
726 if (key->local) { in __ieee80211_key_destroy()
727 struct ieee80211_sub_if_data *sdata = key->sdata; in __ieee80211_key_destroy()
729 ieee80211_debugfs_key_remove(key); in __ieee80211_key_destroy()
741 ieee80211_key_free_common(key); in __ieee80211_key_destroy()
744 static void ieee80211_key_destroy(struct ieee80211_key *key, in ieee80211_key_destroy() argument
747 if (!key) in ieee80211_key_destroy()
751 * Synchronize so the TX path and rcu key iterators in ieee80211_key_destroy()
752 * can no longer be using this key before we free/remove it. in ieee80211_key_destroy()
756 __ieee80211_key_destroy(key, delay_tailroom); in ieee80211_key_destroy()
759 void ieee80211_key_free_unused(struct ieee80211_key *key) in ieee80211_key_free_unused() argument
761 WARN_ON(key->sdata || key->local); in ieee80211_key_free_unused()
762 ieee80211_key_free_common(key); in ieee80211_key_free_unused()
775 tk_old = old->conf.key; in ieee80211_key_identical()
776 tk_new = new->conf.key; in ieee80211_key_identical()
779 * In station mode, don't compare the TX MIC key, as it's never used in ieee80211_key_identical()
798 int ieee80211_key_link(struct ieee80211_key *key, in ieee80211_key_link() argument
803 int idx = key->conf.keyidx; in ieee80211_key_link()
804 bool pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE; in ieee80211_key_link()
821 /* The rekey code assumes that the old and new key are using in ieee80211_key_link()
824 if ((alt_key && alt_key->conf.cipher != key->conf.cipher) || in ieee80211_key_link()
825 (old_key && old_key->conf.cipher != key->conf.cipher)) in ieee80211_key_link()
835 if (old_key && old_key->conf.cipher != key->conf.cipher) in ieee80211_key_link()
840 * Silently accept key re-installation without really installing the in ieee80211_key_link()
841 * new version of the key to avoid nonce reuse or replay issues. in ieee80211_key_link()
843 if (ieee80211_key_identical(sdata, old_key, key)) { in ieee80211_key_link()
844 ieee80211_key_free_unused(key); in ieee80211_key_link()
849 key->local = sdata->local; in ieee80211_key_link()
850 key->sdata = sdata; in ieee80211_key_link()
851 key->sta = sta; in ieee80211_key_link()
855 ret = ieee80211_key_replace(sdata, sta, pairwise, old_key, key); in ieee80211_key_link()
858 ieee80211_debugfs_key_add(key); in ieee80211_key_link()
861 ieee80211_key_free(key, delay_tailroom); in ieee80211_key_link()
870 void ieee80211_key_free(struct ieee80211_key *key, bool delay_tailroom) in ieee80211_key_free() argument
872 if (!key) in ieee80211_key_free()
876 * Replace key with nothingness if it was ever used. in ieee80211_key_free()
878 if (key->sdata) in ieee80211_key_free()
879 ieee80211_key_replace(key->sdata, key->sta, in ieee80211_key_free()
880 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_key_free()
881 key, NULL); in ieee80211_key_free()
882 ieee80211_key_destroy(key, delay_tailroom); in ieee80211_key_free()
887 struct ieee80211_key *key; in ieee80211_reenable_keys() local
905 list_for_each_entry(key, &sdata->key_list, list) { in ieee80211_reenable_keys()
907 ieee80211_key_enable_hw_accel(key); in ieee80211_reenable_keys()
919 struct ieee80211_key_conf *key, in ieee80211_iter_keys() argument
924 struct ieee80211_key *key, *tmp; in ieee80211_iter_keys() local
932 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) in ieee80211_iter_keys()
934 key->sta ? &key->sta->sta : NULL, in ieee80211_iter_keys()
935 &key->conf, iter_data); in ieee80211_iter_keys()
938 list_for_each_entry_safe(key, tmp, in ieee80211_iter_keys()
941 key->sta ? &key->sta->sta : NULL, in ieee80211_iter_keys()
942 &key->conf, iter_data); in ieee80211_iter_keys()
954 struct ieee80211_key_conf *key, in _ieee80211_iter_keys_rcu() argument
958 struct ieee80211_key *key; in _ieee80211_iter_keys_rcu() local
960 list_for_each_entry_rcu(key, &sdata->key_list, list) { in _ieee80211_iter_keys_rcu()
962 if (key->sta && key->sta->removed) in _ieee80211_iter_keys_rcu()
964 if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) in _ieee80211_iter_keys_rcu()
968 key->sta ? &key->sta->sta : NULL, in _ieee80211_iter_keys_rcu()
969 &key->conf, iter_data); in _ieee80211_iter_keys_rcu()
978 struct ieee80211_key_conf *key, in ieee80211_iter_keys_rcu() argument
998 struct ieee80211_key *key, *tmp; in ieee80211_free_keys_iface() local
1007 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) { in ieee80211_free_keys_iface()
1008 ieee80211_key_replace(key->sdata, key->sta, in ieee80211_free_keys_iface()
1009 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_free_keys_iface()
1010 key, NULL); in ieee80211_free_keys_iface()
1011 list_add_tail(&key->list, keys); in ieee80211_free_keys_iface()
1023 struct ieee80211_key *key, *tmp; in ieee80211_free_keys() local
1039 list_for_each_entry_safe(key, tmp, &keys, list) in ieee80211_free_keys()
1040 __ieee80211_key_destroy(key, false); in ieee80211_free_keys()
1068 struct ieee80211_key *key; in ieee80211_free_sta_keys() local
1073 key = key_mtx_dereference(local, sta->gtk[i]); in ieee80211_free_sta_keys()
1074 if (!key) in ieee80211_free_sta_keys()
1076 ieee80211_key_replace(key->sdata, key->sta, in ieee80211_free_sta_keys()
1077 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_free_sta_keys()
1078 key, NULL); in ieee80211_free_sta_keys()
1079 __ieee80211_key_destroy(key, key->sdata->vif.type == in ieee80211_free_sta_keys()
1084 key = key_mtx_dereference(local, sta->ptk[i]); in ieee80211_free_sta_keys()
1085 if (!key) in ieee80211_free_sta_keys()
1087 ieee80211_key_replace(key->sdata, key->sta, in ieee80211_free_sta_keys()
1088 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_free_sta_keys()
1089 key, NULL); in ieee80211_free_sta_keys()
1090 __ieee80211_key_destroy(key, key->sdata->vif.type == in ieee80211_free_sta_keys()
1107 * and then new keys are installed. The first new key causes the in ieee80211_delayed_tailroom_dec()
1111 * key removal for a while, so if we roam the value is larger than in ieee80211_delayed_tailroom_dec()
1141 struct ieee80211_key *key; in ieee80211_get_key_rx_seq() local
1144 key = container_of(keyconf, struct ieee80211_key, conf); in ieee80211_get_key_rx_seq()
1146 switch (key->conf.cipher) { in ieee80211_get_key_rx_seq()
1150 seq->tkip.iv32 = key->u.tkip.rx[tid].iv32; in ieee80211_get_key_rx_seq()
1151 seq->tkip.iv16 = key->u.tkip.rx[tid].iv16; in ieee80211_get_key_rx_seq()
1158 pn = key->u.ccmp.rx_pn[IEEE80211_NUM_TIDS]; in ieee80211_get_key_rx_seq()
1160 pn = key->u.ccmp.rx_pn[tid]; in ieee80211_get_key_rx_seq()
1167 pn = key->u.aes_cmac.rx_pn; in ieee80211_get_key_rx_seq()
1174 pn = key->u.aes_gmac.rx_pn; in ieee80211_get_key_rx_seq()
1182 pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; in ieee80211_get_key_rx_seq()
1184 pn = key->u.gcmp.rx_pn[tid]; in ieee80211_get_key_rx_seq()
1194 struct ieee80211_key *key; in ieee80211_set_key_rx_seq() local
1197 key = container_of(keyconf, struct ieee80211_key, conf); in ieee80211_set_key_rx_seq()
1199 switch (key->conf.cipher) { in ieee80211_set_key_rx_seq()
1203 key->u.tkip.rx[tid].iv32 = seq->tkip.iv32; in ieee80211_set_key_rx_seq()
1204 key->u.tkip.rx[tid].iv16 = seq->tkip.iv16; in ieee80211_set_key_rx_seq()
1211 pn = key->u.ccmp.rx_pn[IEEE80211_NUM_TIDS]; in ieee80211_set_key_rx_seq()
1213 pn = key->u.ccmp.rx_pn[tid]; in ieee80211_set_key_rx_seq()
1220 pn = key->u.aes_cmac.rx_pn; in ieee80211_set_key_rx_seq()
1227 pn = key->u.aes_gmac.rx_pn; in ieee80211_set_key_rx_seq()
1235 pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; in ieee80211_set_key_rx_seq()
1237 pn = key->u.gcmp.rx_pn[tid]; in ieee80211_set_key_rx_seq()
1249 struct ieee80211_key *key; in ieee80211_remove_key() local
1251 key = container_of(keyconf, struct ieee80211_key, conf); in ieee80211_remove_key()
1253 assert_key_lock(key->local); in ieee80211_remove_key()
1256 * if key was uploaded, we assume the driver will/has remove(d) in ieee80211_remove_key()
1259 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { in ieee80211_remove_key()
1260 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; in ieee80211_remove_key()
1262 if (!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC | in ieee80211_remove_key()
1265 increment_tailroom_need_count(key->sdata); in ieee80211_remove_key()
1268 ieee80211_key_free(key, false); in ieee80211_remove_key()
1278 struct ieee80211_key *key; in ieee80211_gtk_rekey_add() local
1287 key = ieee80211_key_alloc(keyconf->cipher, keyconf->keyidx, in ieee80211_gtk_rekey_add()
1288 keyconf->keylen, keyconf->key, in ieee80211_gtk_rekey_add()
1290 if (IS_ERR(key)) in ieee80211_gtk_rekey_add()
1291 return ERR_CAST(key); in ieee80211_gtk_rekey_add()
1294 key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT; in ieee80211_gtk_rekey_add()
1296 err = ieee80211_key_link(key, sdata, NULL); in ieee80211_gtk_rekey_add()
1300 return &key->conf; in ieee80211_gtk_rekey_add()