mac80111: Add BIP-CMAC-256 cipher
[deliverable/linux.git] / net / mac80211 / key.c
CommitLineData
1f5a7e47
JB
1/*
2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2005-2006, Devicescape Software, Inc.
4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
3b96766f 5 * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net>
d98ad83e 6 * Copyright 2013-2014 Intel Mobile Communications GmbH
1f5a7e47
JB
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
11a843b7
JB
13#include <linux/if_ether.h>
14#include <linux/etherdevice.h>
15#include <linux/list.h>
d4e46a3d 16#include <linux/rcupdate.h>
db4d1169 17#include <linux/rtnetlink.h>
5a0e3ad6 18#include <linux/slab.h>
bc3b2d7f 19#include <linux/export.h>
1f5a7e47 20#include <net/mac80211.h>
d26ad377 21#include <asm/unaligned.h>
1f5a7e47 22#include "ieee80211_i.h"
24487981 23#include "driver-ops.h"
1f5a7e47
JB
24#include "debugfs_key.h"
25#include "aes_ccm.h"
3cfcf6ac 26#include "aes_cmac.h"
00b9cfa3 27#include "aes_gcm.h"
1f5a7e47 28
11a843b7 29
dbbea671
JB
30/**
31 * DOC: Key handling basics
11a843b7
JB
32 *
33 * Key handling in mac80211 is done based on per-interface (sub_if_data)
34 * keys and per-station keys. Since each station belongs to an interface,
35 * each station key also belongs to that interface.
36 *
b5c34f66
JB
37 * Hardware acceleration is done on a best-effort basis for algorithms
38 * that are implemented in software, for each key the hardware is asked
39 * to enable that key for offloading but if it cannot do that the key is
40 * simply kept for software encryption (unless it is for an algorithm
41 * that isn't implemented in software).
42 * There is currently no way of knowing whether a key is handled in SW
43 * or HW except by looking into debugfs.
11a843b7 44 *
b5c34f66
JB
45 * All key management is internally protected by a mutex. Within all
46 * other parts of mac80211, key references are, just as STA structure
47 * references, protected by RCU. Note, however, that some things are
48 * unprotected, namely the key->sta dereferences within the hardware
49 * acceleration functions. This means that sta_info_destroy() must
50 * remove the key which waits for an RCU grace period.
11a843b7
JB
51 */
52
53static const u8 bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
11a843b7 54
ad0e2b5a 55static void assert_key_lock(struct ieee80211_local *local)
3b96766f 56{
46a5ebaf 57 lockdep_assert_held(&local->key_mtx);
3b96766f
JB
58}
59
3bff1865
YAP
60static void increment_tailroom_need_count(struct ieee80211_sub_if_data *sdata)
61{
62 /*
63 * When this count is zero, SKB resizing for allocating tailroom
64 * for IV or MMIC is skipped. But, this check has created two race
65 * cases in xmit path while transiting from zero count to one:
66 *
67 * 1. SKB resize was skipped because no key was added but just before
68 * the xmit key is added and SW encryption kicks off.
69 *
70 * 2. SKB resize was skipped because all the keys were hw planted but
71 * just before xmit one of the key is deleted and SW encryption kicks
72 * off.
73 *
74 * In both the above case SW encryption will find not enough space for
75 * tailroom and exits with WARN_ON. (See WARN_ONs at wpa.c)
76 *
77 * Solution has been explained at
78 * http://mid.gmane.org/1308590980.4322.19.camel@jlt3.sipsolutions.net
79 */
80
81 if (!sdata->crypto_tx_tailroom_needed_cnt++) {
82 /*
83 * Flush all XMIT packets currently using HW encryption or no
84 * encryption at all if the count transition is from 0 -> 1.
85 */
86 synchronize_net();
87 }
88}
89
3ffc2a90 90static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
11a843b7 91{
dc822b5d 92 struct ieee80211_sub_if_data *sdata;
89c91cae 93 struct sta_info *sta;
fa7e1fbc 94 int ret = -EOPNOTSUPP;
11a843b7 95
3b96766f
JB
96 might_sleep();
97
4619194a
JB
98 if (key->flags & KEY_FLAG_TAINTED) {
99 /* If we get here, it's during resume and the key is
100 * tainted so shouldn't be used/programmed any more.
101 * However, its flags may still indicate that it was
102 * programmed into the device (since we're in resume)
103 * so clear that flag now to avoid trying to remove
104 * it again later.
105 */
106 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
27b3eb9c 107 return -EINVAL;
4619194a 108 }
27b3eb9c 109
e31b8213 110 if (!key->local->ops->set_key)
3ffc2a90 111 goto out_unsupported;
11a843b7 112
ad0e2b5a
JB
113 assert_key_lock(key->local);
114
89c91cae 115 sta = key->sta;
dc822b5d 116
e31b8213
JB
117 /*
118 * If this is a per-STA GTK, check if it
119 * is supported; if not, return.
120 */
121 if (sta && !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE) &&
122 !(key->local->hw.flags & IEEE80211_HW_SUPPORTS_PER_STA_GTK))
123 goto out_unsupported;
124
89c91cae
JB
125 if (sta && !sta->uploaded)
126 goto out_unsupported;
127
dc822b5d 128 sdata = key->sdata;
18890d4b
HS
129 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
130 /*
131 * The driver doesn't know anything about VLAN interfaces.
132 * Hence, don't send GTKs for VLAN interfaces to the driver.
133 */
134 if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE))
135 goto out_unsupported;
18890d4b 136 }
11a843b7 137
89c91cae
JB
138 ret = drv_set_key(key->local, SET_KEY, sdata,
139 sta ? &sta->sta : NULL, &key->conf);
11a843b7 140
e31b8213 141 if (!ret) {
11a843b7 142 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
3bff1865 143
1e359a5d 144 if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
db12847c 145 (key->conf.flags & IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
3bff1865
YAP
146 sdata->crypto_tx_tailroom_needed_cnt--;
147
077a9154
AN
148 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) &&
149 (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV));
150
e31b8213
JB
151 return 0;
152 }
11a843b7 153
fa7e1fbc 154 if (ret != -ENOSPC && ret != -EOPNOTSUPP && ret != 1)
bdcbd8e0 155 sdata_err(sdata,
0fb9a9ec 156 "failed to set key (%d, %pM) to hardware (%d)\n",
89c91cae
JB
157 key->conf.keyidx,
158 sta ? sta->sta.addr : bcast_addr, ret);
3ffc2a90 159
e31b8213
JB
160 out_unsupported:
161 switch (key->conf.cipher) {
162 case WLAN_CIPHER_SUITE_WEP40:
163 case WLAN_CIPHER_SUITE_WEP104:
164 case WLAN_CIPHER_SUITE_TKIP:
165 case WLAN_CIPHER_SUITE_CCMP:
2b2ba0db 166 case WLAN_CIPHER_SUITE_CCMP_256:
e31b8213 167 case WLAN_CIPHER_SUITE_AES_CMAC:
56c52da2 168 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
00b9cfa3
JM
169 case WLAN_CIPHER_SUITE_GCMP:
170 case WLAN_CIPHER_SUITE_GCMP_256:
fa7e1fbc
JB
171 /* all of these we can do in software - if driver can */
172 if (ret == 1)
173 return 0;
174 if (key->local->hw.flags & IEEE80211_HW_SW_CRYPTO_CONTROL)
175 return -EINVAL;
e31b8213
JB
176 return 0;
177 default:
178 return -EINVAL;
3ffc2a90 179 }
11a843b7
JB
180}
181
182static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
183{
dc822b5d 184 struct ieee80211_sub_if_data *sdata;
89c91cae 185 struct sta_info *sta;
11a843b7
JB
186 int ret;
187
3b96766f
JB
188 might_sleep();
189
db4d1169 190 if (!key || !key->local->ops->set_key)
11a843b7
JB
191 return;
192
ad0e2b5a
JB
193 assert_key_lock(key->local);
194
195 if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
11a843b7
JB
196 return;
197
89c91cae 198 sta = key->sta;
dc822b5d
JB
199 sdata = key->sdata;
200
1e359a5d 201 if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
db12847c 202 (key->conf.flags & IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
3bff1865
YAP
203 increment_tailroom_need_count(sdata);
204
12375ef9 205 ret = drv_set_key(key->local, DISABLE_KEY, sdata,
89c91cae 206 sta ? &sta->sta : NULL, &key->conf);
11a843b7
JB
207
208 if (ret)
bdcbd8e0 209 sdata_err(sdata,
0fb9a9ec 210 "failed to remove key (%d, %pM) from hardware (%d)\n",
89c91cae
JB
211 key->conf.keyidx,
212 sta ? sta->sta.addr : bcast_addr, ret);
11a843b7 213
3b96766f 214 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
3b96766f
JB
215}
216
217static void __ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata,
f7e0104c 218 int idx, bool uni, bool multi)
3b96766f
JB
219{
220 struct ieee80211_key *key = NULL;
221
ad0e2b5a
JB
222 assert_key_lock(sdata->local);
223
3b96766f 224 if (idx >= 0 && idx < NUM_DEFAULT_KEYS)
40b275b6 225 key = key_mtx_dereference(sdata->local, sdata->keys[idx]);
3b96766f 226
de5fad81 227 if (uni) {
f7e0104c 228 rcu_assign_pointer(sdata->default_unicast_key, key);
de5fad81
YD
229 drv_set_default_unicast_key(sdata->local, sdata, idx);
230 }
231
f7e0104c
JB
232 if (multi)
233 rcu_assign_pointer(sdata->default_multicast_key, key);
3b96766f 234
f7e0104c 235 ieee80211_debugfs_key_update_default(sdata);
3b96766f
JB
236}
237
f7e0104c
JB
238void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx,
239 bool uni, bool multi)
3b96766f 240{
ad0e2b5a 241 mutex_lock(&sdata->local->key_mtx);
f7e0104c 242 __ieee80211_set_default_key(sdata, idx, uni, multi);
ad0e2b5a 243 mutex_unlock(&sdata->local->key_mtx);
3b96766f
JB
244}
245
3cfcf6ac
JM
246static void
247__ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata, int idx)
248{
249 struct ieee80211_key *key = NULL;
250
ad0e2b5a
JB
251 assert_key_lock(sdata->local);
252
3cfcf6ac
JM
253 if (idx >= NUM_DEFAULT_KEYS &&
254 idx < NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS)
40b275b6 255 key = key_mtx_dereference(sdata->local, sdata->keys[idx]);
3cfcf6ac
JM
256
257 rcu_assign_pointer(sdata->default_mgmt_key, key);
258
f7e0104c 259 ieee80211_debugfs_key_update_default(sdata);
3cfcf6ac
JM
260}
261
262void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata,
263 int idx)
264{
ad0e2b5a 265 mutex_lock(&sdata->local->key_mtx);
3cfcf6ac 266 __ieee80211_set_default_mgmt_key(sdata, idx);
ad0e2b5a 267 mutex_unlock(&sdata->local->key_mtx);
3cfcf6ac
JM
268}
269
3b96766f 270
3b8d9c29
JB
271static void ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
272 struct sta_info *sta,
273 bool pairwise,
274 struct ieee80211_key *old,
275 struct ieee80211_key *new)
3b96766f 276{
f7e0104c
JB
277 int idx;
278 bool defunikey, defmultikey, defmgmtkey;
3b96766f 279
5282c3ba
JB
280 /* caller must provide at least one old/new */
281 if (WARN_ON(!new && !old))
282 return;
283
3b96766f 284 if (new)
f850e00f 285 list_add_tail(&new->list, &sdata->key_list);
3b96766f 286
2475b1cc 287 WARN_ON(new && old && new->conf.keyidx != old->conf.keyidx);
3b96766f 288
2475b1cc
MS
289 if (old)
290 idx = old->conf.keyidx;
291 else
292 idx = new->conf.keyidx;
3b96766f 293
2475b1cc
MS
294 if (sta) {
295 if (pairwise) {
296 rcu_assign_pointer(sta->ptk[idx], new);
297 sta->ptk_idx = idx;
298 } else {
299 rcu_assign_pointer(sta->gtk[idx], new);
300 sta->gtk_idx = idx;
301 }
302 } else {
40b275b6
JB
303 defunikey = old &&
304 old == key_mtx_dereference(sdata->local,
305 sdata->default_unicast_key);
306 defmultikey = old &&
307 old == key_mtx_dereference(sdata->local,
308 sdata->default_multicast_key);
309 defmgmtkey = old &&
310 old == key_mtx_dereference(sdata->local,
311 sdata->default_mgmt_key);
3b96766f 312
f7e0104c
JB
313 if (defunikey && !new)
314 __ieee80211_set_default_key(sdata, -1, true, false);
315 if (defmultikey && !new)
316 __ieee80211_set_default_key(sdata, -1, false, true);
3cfcf6ac
JM
317 if (defmgmtkey && !new)
318 __ieee80211_set_default_mgmt_key(sdata, -1);
3b96766f
JB
319
320 rcu_assign_pointer(sdata->keys[idx], new);
f7e0104c
JB
321 if (defunikey && new)
322 __ieee80211_set_default_key(sdata, new->conf.keyidx,
323 true, false);
324 if (defmultikey && new)
325 __ieee80211_set_default_key(sdata, new->conf.keyidx,
326 false, true);
3cfcf6ac
JM
327 if (defmgmtkey && new)
328 __ieee80211_set_default_mgmt_key(sdata,
329 new->conf.keyidx);
3b96766f
JB
330 }
331
b5c34f66
JB
332 if (old)
333 list_del(&old->list);
11a843b7
JB
334}
335
2475b1cc
MS
336struct ieee80211_key *
337ieee80211_key_alloc(u32 cipher, int idx, size_t key_len,
338 const u8 *key_data,
339 size_t seq_len, const u8 *seq,
340 const struct ieee80211_cipher_scheme *cs)
1f5a7e47
JB
341{
342 struct ieee80211_key *key;
1ac62ba7 343 int i, j, err;
1f5a7e47 344
8c5bb1fa
JB
345 if (WARN_ON(idx < 0 || idx >= NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS))
346 return ERR_PTR(-EINVAL);
11a843b7
JB
347
348 key = kzalloc(sizeof(struct ieee80211_key) + key_len, GFP_KERNEL);
1f5a7e47 349 if (!key)
1ac62ba7 350 return ERR_PTR(-ENOMEM);
11a843b7
JB
351
352 /*
353 * Default to software encryption; we'll later upload the
354 * key to the hardware if possible.
355 */
11a843b7
JB
356 key->conf.flags = 0;
357 key->flags = 0;
358
97359d12 359 key->conf.cipher = cipher;
11a843b7
JB
360 key->conf.keyidx = idx;
361 key->conf.keylen = key_len;
97359d12
JB
362 switch (cipher) {
363 case WLAN_CIPHER_SUITE_WEP40:
364 case WLAN_CIPHER_SUITE_WEP104:
4325f6ca
JB
365 key->conf.iv_len = IEEE80211_WEP_IV_LEN;
366 key->conf.icv_len = IEEE80211_WEP_ICV_LEN;
76708dee 367 break;
97359d12 368 case WLAN_CIPHER_SUITE_TKIP:
4325f6ca
JB
369 key->conf.iv_len = IEEE80211_TKIP_IV_LEN;
370 key->conf.icv_len = IEEE80211_TKIP_ICV_LEN;
9f26a952 371 if (seq) {
5a306f58 372 for (i = 0; i < IEEE80211_NUM_TIDS; i++) {
faa8fdc8
JM
373 key->u.tkip.rx[i].iv32 =
374 get_unaligned_le32(&seq[2]);
375 key->u.tkip.rx[i].iv16 =
376 get_unaligned_le16(seq);
377 }
378 }
523b02ea 379 spin_lock_init(&key->u.tkip.txlock);
76708dee 380 break;
97359d12 381 case WLAN_CIPHER_SUITE_CCMP:
4325f6ca
JB
382 key->conf.iv_len = IEEE80211_CCMP_HDR_LEN;
383 key->conf.icv_len = IEEE80211_CCMP_MIC_LEN;
9f26a952 384 if (seq) {
5a306f58 385 for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++)
4325f6ca 386 for (j = 0; j < IEEE80211_CCMP_PN_LEN; j++)
faa8fdc8 387 key->u.ccmp.rx_pn[i][j] =
4325f6ca 388 seq[IEEE80211_CCMP_PN_LEN - j - 1];
faa8fdc8 389 }
11a843b7
JB
390 /*
391 * Initialize AES key state here as an optimization so that
392 * it does not need to be initialized for every packet.
393 */
2b2ba0db
JM
394 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt(
395 key_data, key_len, IEEE80211_CCMP_MIC_LEN);
396 if (IS_ERR(key->u.ccmp.tfm)) {
397 err = PTR_ERR(key->u.ccmp.tfm);
398 kfree(key);
399 return ERR_PTR(err);
400 }
401 break;
402 case WLAN_CIPHER_SUITE_CCMP_256:
403 key->conf.iv_len = IEEE80211_CCMP_256_HDR_LEN;
404 key->conf.icv_len = IEEE80211_CCMP_256_MIC_LEN;
405 for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++)
406 for (j = 0; j < IEEE80211_CCMP_256_PN_LEN; j++)
407 key->u.ccmp.rx_pn[i][j] =
408 seq[IEEE80211_CCMP_256_PN_LEN - j - 1];
409 /* Initialize AES key state here as an optimization so that
410 * it does not need to be initialized for every packet.
411 */
412 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt(
413 key_data, key_len, IEEE80211_CCMP_256_MIC_LEN);
1ac62ba7
BH
414 if (IS_ERR(key->u.ccmp.tfm)) {
415 err = PTR_ERR(key->u.ccmp.tfm);
3b96766f 416 kfree(key);
1f951a7f 417 return ERR_PTR(err);
11a843b7 418 }
60ae0f20
JB
419 break;
420 case WLAN_CIPHER_SUITE_AES_CMAC:
56c52da2 421 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
60ae0f20 422 key->conf.iv_len = 0;
56c52da2
JM
423 if (cipher == WLAN_CIPHER_SUITE_AES_CMAC)
424 key->conf.icv_len = sizeof(struct ieee80211_mmie);
425 else
426 key->conf.icv_len = sizeof(struct ieee80211_mmie_16);
60ae0f20 427 if (seq)
4325f6ca 428 for (j = 0; j < IEEE80211_CMAC_PN_LEN; j++)
0f927323 429 key->u.aes_cmac.rx_pn[j] =
4325f6ca 430 seq[IEEE80211_CMAC_PN_LEN - j - 1];
3cfcf6ac
JM
431 /*
432 * Initialize AES key state here as an optimization so that
433 * it does not need to be initialized for every packet.
434 */
435 key->u.aes_cmac.tfm =
56c52da2 436 ieee80211_aes_cmac_key_setup(key_data, key_len);
1ac62ba7
BH
437 if (IS_ERR(key->u.aes_cmac.tfm)) {
438 err = PTR_ERR(key->u.aes_cmac.tfm);
3cfcf6ac 439 kfree(key);
1f951a7f 440 return ERR_PTR(err);
3cfcf6ac 441 }
60ae0f20 442 break;
00b9cfa3
JM
443 case WLAN_CIPHER_SUITE_GCMP:
444 case WLAN_CIPHER_SUITE_GCMP_256:
445 key->conf.iv_len = IEEE80211_GCMP_HDR_LEN;
446 key->conf.icv_len = IEEE80211_GCMP_MIC_LEN;
447 for (i = 0; seq && i < IEEE80211_NUM_TIDS + 1; i++)
448 for (j = 0; j < IEEE80211_GCMP_PN_LEN; j++)
449 key->u.gcmp.rx_pn[i][j] =
450 seq[IEEE80211_GCMP_PN_LEN - j - 1];
451 /* Initialize AES key state here as an optimization so that
452 * it does not need to be initialized for every packet.
453 */
454 key->u.gcmp.tfm = ieee80211_aes_gcm_key_setup_encrypt(key_data,
455 key_len);
456 if (IS_ERR(key->u.gcmp.tfm)) {
457 err = PTR_ERR(key->u.gcmp.tfm);
458 kfree(key);
459 return ERR_PTR(err);
460 }
461 break;
2475b1cc
MS
462 default:
463 if (cs) {
464 size_t len = (seq_len > MAX_PN_LEN) ?
465 MAX_PN_LEN : seq_len;
466
467 key->conf.iv_len = cs->hdr_len;
468 key->conf.icv_len = cs->mic_len;
469 for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++)
470 for (j = 0; j < len; j++)
471 key->u.gen.rx_pn[i][j] =
472 seq[len - j - 1];
473 }
3cfcf6ac 474 }
60ae0f20
JB
475 memcpy(key->conf.key, key_data, key_len);
476 INIT_LIST_HEAD(&key->list);
3cfcf6ac 477
db4d1169
JB
478 return key;
479}
11a843b7 480
79cf2dfa
JB
481static void ieee80211_key_free_common(struct ieee80211_key *key)
482{
00b9cfa3
JM
483 switch (key->conf.cipher) {
484 case WLAN_CIPHER_SUITE_CCMP:
2b2ba0db 485 case WLAN_CIPHER_SUITE_CCMP_256:
79cf2dfa 486 ieee80211_aes_key_free(key->u.ccmp.tfm);
00b9cfa3
JM
487 break;
488 case WLAN_CIPHER_SUITE_AES_CMAC:
56c52da2 489 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
79cf2dfa 490 ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm);
00b9cfa3
JM
491 break;
492 case WLAN_CIPHER_SUITE_GCMP:
493 case WLAN_CIPHER_SUITE_GCMP_256:
494 ieee80211_aes_gcm_key_free(key->u.gcmp.tfm);
495 break;
496 }
29c3f9c3 497 kzfree(key);
79cf2dfa
JB
498}
499
6d10e46b
JB
500static void __ieee80211_key_destroy(struct ieee80211_key *key,
501 bool delay_tailroom)
ad0e2b5a 502{
32162a4d
JM
503 if (key->local)
504 ieee80211_key_disable_hw_accel(key);
ad0e2b5a 505
3bff1865 506 if (key->local) {
8d1f7ecd
JB
507 struct ieee80211_sub_if_data *sdata = key->sdata;
508
32162a4d 509 ieee80211_debugfs_key_remove(key);
8d1f7ecd
JB
510
511 if (delay_tailroom) {
512 /* see ieee80211_delayed_tailroom_dec */
513 sdata->crypto_tx_tailroom_pending_dec++;
514 schedule_delayed_work(&sdata->dec_tailroom_needed_wk,
515 HZ/2);
516 } else {
517 sdata->crypto_tx_tailroom_needed_cnt--;
518 }
3bff1865 519 }
ad0e2b5a 520
79cf2dfa
JB
521 ieee80211_key_free_common(key);
522}
523
6d10e46b
JB
524static void ieee80211_key_destroy(struct ieee80211_key *key,
525 bool delay_tailroom)
526{
527 if (!key)
528 return;
529
530 /*
531 * Synchronize so the TX path can no longer be using
532 * this key before we free/remove it.
533 */
534 synchronize_net();
535
536 __ieee80211_key_destroy(key, delay_tailroom);
537}
538
79cf2dfa
JB
539void ieee80211_key_free_unused(struct ieee80211_key *key)
540{
541 WARN_ON(key->sdata || key->local);
542 ieee80211_key_free_common(key);
ad0e2b5a
JB
543}
544
3ffc2a90
JB
545int ieee80211_key_link(struct ieee80211_key *key,
546 struct ieee80211_sub_if_data *sdata,
547 struct sta_info *sta)
db4d1169 548{
27b3eb9c 549 struct ieee80211_local *local = sdata->local;
db4d1169 550 struct ieee80211_key *old_key;
3ffc2a90 551 int idx, ret;
67aa030c 552 bool pairwise;
db4d1169 553
67aa030c 554 pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE;
db4d1169
JB
555 idx = key->conf.keyidx;
556 key->local = sdata->local;
557 key->sdata = sdata;
558 key->sta = sta;
559
ad0e2b5a 560 mutex_lock(&sdata->local->key_mtx);
3b96766f 561
e31b8213 562 if (sta && pairwise)
2475b1cc 563 old_key = key_mtx_dereference(sdata->local, sta->ptk[idx]);
e31b8213 564 else if (sta)
40b275b6 565 old_key = key_mtx_dereference(sdata->local, sta->gtk[idx]);
d4e46a3d 566 else
40b275b6 567 old_key = key_mtx_dereference(sdata->local, sdata->keys[idx]);
db4d1169 568
3bff1865
YAP
569 increment_tailroom_need_count(sdata);
570
3b8d9c29
JB
571 ieee80211_key_replace(sdata, sta, pairwise, old_key, key);
572 ieee80211_key_destroy(old_key, true);
d4e46a3d 573
ad0e2b5a 574 ieee80211_debugfs_key_add(key);
db4d1169 575
27b3eb9c
JB
576 if (!local->wowlan) {
577 ret = ieee80211_key_enable_hw_accel(key);
578 if (ret)
579 ieee80211_key_free(key, true);
580 } else {
581 ret = 0;
582 }
79cf2dfa 583
ad0e2b5a 584 mutex_unlock(&sdata->local->key_mtx);
3ffc2a90
JB
585
586 return ret;
1f5a7e47
JB
587}
588
3b8d9c29 589void ieee80211_key_free(struct ieee80211_key *key, bool delay_tailroom)
1f5a7e47 590{
5c0c3641
JB
591 if (!key)
592 return;
593
3b96766f
JB
594 /*
595 * Replace key with nothingness if it was ever used.
596 */
3a245766 597 if (key->sdata)
3b8d9c29 598 ieee80211_key_replace(key->sdata, key->sta,
e31b8213
JB
599 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
600 key, NULL);
3b8d9c29 601 ieee80211_key_destroy(key, delay_tailroom);
3b96766f 602}
d4e46a3d 603
ad0e2b5a 604void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata)
3a245766
JB
605{
606 struct ieee80211_key *key;
11a843b7 607
3a245766 608 ASSERT_RTNL();
11a843b7 609
9607e6b6 610 if (WARN_ON(!ieee80211_sdata_running(sdata)))
3a245766 611 return;
11a843b7 612
ad0e2b5a 613 mutex_lock(&sdata->local->key_mtx);
11a843b7 614
3bff1865
YAP
615 sdata->crypto_tx_tailroom_needed_cnt = 0;
616
617 list_for_each_entry(key, &sdata->key_list, list) {
618 increment_tailroom_need_count(sdata);
ad0e2b5a 619 ieee80211_key_enable_hw_accel(key);
3bff1865 620 }
3b96766f 621
ad0e2b5a 622 mutex_unlock(&sdata->local->key_mtx);
11a843b7
JB
623}
624
830af02f
JB
625void ieee80211_iter_keys(struct ieee80211_hw *hw,
626 struct ieee80211_vif *vif,
627 void (*iter)(struct ieee80211_hw *hw,
628 struct ieee80211_vif *vif,
629 struct ieee80211_sta *sta,
630 struct ieee80211_key_conf *key,
631 void *data),
632 void *iter_data)
633{
634 struct ieee80211_local *local = hw_to_local(hw);
27b3eb9c 635 struct ieee80211_key *key, *tmp;
830af02f
JB
636 struct ieee80211_sub_if_data *sdata;
637
638 ASSERT_RTNL();
639
640 mutex_lock(&local->key_mtx);
641 if (vif) {
642 sdata = vif_to_sdata(vif);
27b3eb9c 643 list_for_each_entry_safe(key, tmp, &sdata->key_list, list)
830af02f
JB
644 iter(hw, &sdata->vif,
645 key->sta ? &key->sta->sta : NULL,
646 &key->conf, iter_data);
647 } else {
648 list_for_each_entry(sdata, &local->interfaces, list)
27b3eb9c
JB
649 list_for_each_entry_safe(key, tmp,
650 &sdata->key_list, list)
830af02f
JB
651 iter(hw, &sdata->vif,
652 key->sta ? &key->sta->sta : NULL,
653 &key->conf, iter_data);
654 }
655 mutex_unlock(&local->key_mtx);
656}
657EXPORT_SYMBOL(ieee80211_iter_keys);
658
7907c7d3
JB
659static void ieee80211_free_keys_iface(struct ieee80211_sub_if_data *sdata,
660 struct list_head *keys)
3b96766f
JB
661{
662 struct ieee80211_key *key, *tmp;
3b96766f 663
8d1f7ecd
JB
664 sdata->crypto_tx_tailroom_needed_cnt -=
665 sdata->crypto_tx_tailroom_pending_dec;
666 sdata->crypto_tx_tailroom_pending_dec = 0;
667
3cfcf6ac 668 ieee80211_debugfs_key_remove_mgmt_default(sdata);
3b96766f 669
6d10e46b
JB
670 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) {
671 ieee80211_key_replace(key->sdata, key->sta,
672 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
673 key, NULL);
7907c7d3 674 list_add_tail(&key->list, keys);
6d10e46b 675 }
3b96766f 676
f7e0104c 677 ieee80211_debugfs_key_update_default(sdata);
7907c7d3 678}
f7e0104c 679
7907c7d3
JB
680void ieee80211_free_keys(struct ieee80211_sub_if_data *sdata,
681 bool force_synchronize)
682{
683 struct ieee80211_local *local = sdata->local;
684 struct ieee80211_sub_if_data *vlan;
685 struct ieee80211_key *key, *tmp;
686 LIST_HEAD(keys);
687
688 cancel_delayed_work_sync(&sdata->dec_tailroom_needed_wk);
689
690 mutex_lock(&local->key_mtx);
691
692 ieee80211_free_keys_iface(sdata, &keys);
693
694 if (sdata->vif.type == NL80211_IFTYPE_AP) {
695 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
696 ieee80211_free_keys_iface(vlan, &keys);
6d10e46b
JB
697 }
698
7907c7d3
JB
699 if (!list_empty(&keys) || force_synchronize)
700 synchronize_net();
701 list_for_each_entry_safe(key, tmp, &keys, list)
702 __ieee80211_key_destroy(key, false);
703
8d1f7ecd
JB
704 WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt ||
705 sdata->crypto_tx_tailroom_pending_dec);
7907c7d3
JB
706 if (sdata->vif.type == NL80211_IFTYPE_AP) {
707 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
708 WARN_ON_ONCE(vlan->crypto_tx_tailroom_needed_cnt ||
709 vlan->crypto_tx_tailroom_pending_dec);
710 }
8d1f7ecd 711
7907c7d3 712 mutex_unlock(&local->key_mtx);
11a843b7 713}
c68f4b89 714
6d10e46b
JB
715void ieee80211_free_sta_keys(struct ieee80211_local *local,
716 struct sta_info *sta)
717{
c8782078 718 struct ieee80211_key *key;
6d10e46b
JB
719 int i;
720
721 mutex_lock(&local->key_mtx);
28a9bc68 722 for (i = 0; i < ARRAY_SIZE(sta->gtk); i++) {
6d10e46b
JB
723 key = key_mtx_dereference(local, sta->gtk[i]);
724 if (!key)
725 continue;
726 ieee80211_key_replace(key->sdata, key->sta,
727 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
728 key, NULL);
c8782078 729 __ieee80211_key_destroy(key, true);
6d10e46b
JB
730 }
731
2475b1cc
MS
732 for (i = 0; i < NUM_DEFAULT_KEYS; i++) {
733 key = key_mtx_dereference(local, sta->ptk[i]);
734 if (!key)
735 continue;
6d10e46b
JB
736 ieee80211_key_replace(key->sdata, key->sta,
737 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
738 key, NULL);
6d10e46b 739 __ieee80211_key_destroy(key, true);
c8782078 740 }
6d10e46b
JB
741
742 mutex_unlock(&local->key_mtx);
743}
744
8d1f7ecd
JB
745void ieee80211_delayed_tailroom_dec(struct work_struct *wk)
746{
747 struct ieee80211_sub_if_data *sdata;
748
749 sdata = container_of(wk, struct ieee80211_sub_if_data,
750 dec_tailroom_needed_wk.work);
751
752 /*
753 * The reason for the delayed tailroom needed decrementing is to
754 * make roaming faster: during roaming, all keys are first deleted
755 * and then new keys are installed. The first new key causes the
756 * crypto_tx_tailroom_needed_cnt to go from 0 to 1, which invokes
757 * the cost of synchronize_net() (which can be slow). Avoid this
758 * by deferring the crypto_tx_tailroom_needed_cnt decrementing on
759 * key removal for a while, so if we roam the value is larger than
760 * zero and no 0->1 transition happens.
761 *
762 * The cost is that if the AP switching was from an AP with keys
763 * to one without, we still allocate tailroom while it would no
764 * longer be needed. However, in the typical (fast) roaming case
765 * within an ESS this usually won't happen.
766 */
767
768 mutex_lock(&sdata->local->key_mtx);
769 sdata->crypto_tx_tailroom_needed_cnt -=
770 sdata->crypto_tx_tailroom_pending_dec;
771 sdata->crypto_tx_tailroom_pending_dec = 0;
772 mutex_unlock(&sdata->local->key_mtx);
773}
c68f4b89
JB
774
775void ieee80211_gtk_rekey_notify(struct ieee80211_vif *vif, const u8 *bssid,
776 const u8 *replay_ctr, gfp_t gfp)
777{
778 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
779
780 trace_api_gtk_rekey_notify(sdata, bssid, replay_ctr);
781
782 cfg80211_gtk_rekey_notify(sdata->dev, bssid, replay_ctr, gfp);
783}
784EXPORT_SYMBOL_GPL(ieee80211_gtk_rekey_notify);
3ea542d3
JB
785
786void ieee80211_get_key_tx_seq(struct ieee80211_key_conf *keyconf,
787 struct ieee80211_key_seq *seq)
788{
789 struct ieee80211_key *key;
790 u64 pn64;
791
792 if (WARN_ON(!(keyconf->flags & IEEE80211_KEY_FLAG_GENERATE_IV)))
793 return;
794
795 key = container_of(keyconf, struct ieee80211_key, conf);
796
797 switch (key->conf.cipher) {
798 case WLAN_CIPHER_SUITE_TKIP:
799 seq->tkip.iv32 = key->u.tkip.tx.iv32;
800 seq->tkip.iv16 = key->u.tkip.tx.iv16;
801 break;
802 case WLAN_CIPHER_SUITE_CCMP:
2b2ba0db 803 case WLAN_CIPHER_SUITE_CCMP_256:
3ea542d3
JB
804 pn64 = atomic64_read(&key->u.ccmp.tx_pn);
805 seq->ccmp.pn[5] = pn64;
806 seq->ccmp.pn[4] = pn64 >> 8;
807 seq->ccmp.pn[3] = pn64 >> 16;
808 seq->ccmp.pn[2] = pn64 >> 24;
809 seq->ccmp.pn[1] = pn64 >> 32;
810 seq->ccmp.pn[0] = pn64 >> 40;
811 break;
812 case WLAN_CIPHER_SUITE_AES_CMAC:
56c52da2 813 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
3ea542d3
JB
814 pn64 = atomic64_read(&key->u.aes_cmac.tx_pn);
815 seq->ccmp.pn[5] = pn64;
816 seq->ccmp.pn[4] = pn64 >> 8;
817 seq->ccmp.pn[3] = pn64 >> 16;
818 seq->ccmp.pn[2] = pn64 >> 24;
819 seq->ccmp.pn[1] = pn64 >> 32;
820 seq->ccmp.pn[0] = pn64 >> 40;
821 break;
00b9cfa3
JM
822 case WLAN_CIPHER_SUITE_GCMP:
823 case WLAN_CIPHER_SUITE_GCMP_256:
824 pn64 = atomic64_read(&key->u.gcmp.tx_pn);
825 seq->gcmp.pn[5] = pn64;
826 seq->gcmp.pn[4] = pn64 >> 8;
827 seq->gcmp.pn[3] = pn64 >> 16;
828 seq->gcmp.pn[2] = pn64 >> 24;
829 seq->gcmp.pn[1] = pn64 >> 32;
830 seq->gcmp.pn[0] = pn64 >> 40;
831 break;
3ea542d3
JB
832 default:
833 WARN_ON(1);
834 }
835}
836EXPORT_SYMBOL(ieee80211_get_key_tx_seq);
837
838void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf,
839 int tid, struct ieee80211_key_seq *seq)
840{
841 struct ieee80211_key *key;
842 const u8 *pn;
843
844 key = container_of(keyconf, struct ieee80211_key, conf);
845
846 switch (key->conf.cipher) {
847 case WLAN_CIPHER_SUITE_TKIP:
5a306f58 848 if (WARN_ON(tid < 0 || tid >= IEEE80211_NUM_TIDS))
3ea542d3
JB
849 return;
850 seq->tkip.iv32 = key->u.tkip.rx[tid].iv32;
851 seq->tkip.iv16 = key->u.tkip.rx[tid].iv16;
852 break;
853 case WLAN_CIPHER_SUITE_CCMP:
2b2ba0db 854 case WLAN_CIPHER_SUITE_CCMP_256:
5a306f58 855 if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS))
3ea542d3
JB
856 return;
857 if (tid < 0)
5a306f58 858 pn = key->u.ccmp.rx_pn[IEEE80211_NUM_TIDS];
3ea542d3
JB
859 else
860 pn = key->u.ccmp.rx_pn[tid];
4325f6ca 861 memcpy(seq->ccmp.pn, pn, IEEE80211_CCMP_PN_LEN);
3ea542d3
JB
862 break;
863 case WLAN_CIPHER_SUITE_AES_CMAC:
56c52da2 864 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
3ea542d3
JB
865 if (WARN_ON(tid != 0))
866 return;
867 pn = key->u.aes_cmac.rx_pn;
4325f6ca 868 memcpy(seq->aes_cmac.pn, pn, IEEE80211_CMAC_PN_LEN);
3ea542d3 869 break;
00b9cfa3
JM
870 case WLAN_CIPHER_SUITE_GCMP:
871 case WLAN_CIPHER_SUITE_GCMP_256:
872 if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS))
873 return;
874 if (tid < 0)
875 pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS];
876 else
877 pn = key->u.gcmp.rx_pn[tid];
878 memcpy(seq->gcmp.pn, pn, IEEE80211_GCMP_PN_LEN);
879 break;
3ea542d3
JB
880 }
881}
882EXPORT_SYMBOL(ieee80211_get_key_rx_seq);
27b3eb9c
JB
883
884void ieee80211_set_key_tx_seq(struct ieee80211_key_conf *keyconf,
885 struct ieee80211_key_seq *seq)
886{
887 struct ieee80211_key *key;
888 u64 pn64;
889
890 key = container_of(keyconf, struct ieee80211_key, conf);
891
892 switch (key->conf.cipher) {
893 case WLAN_CIPHER_SUITE_TKIP:
894 key->u.tkip.tx.iv32 = seq->tkip.iv32;
895 key->u.tkip.tx.iv16 = seq->tkip.iv16;
896 break;
897 case WLAN_CIPHER_SUITE_CCMP:
2b2ba0db 898 case WLAN_CIPHER_SUITE_CCMP_256:
27b3eb9c
JB
899 pn64 = (u64)seq->ccmp.pn[5] |
900 ((u64)seq->ccmp.pn[4] << 8) |
901 ((u64)seq->ccmp.pn[3] << 16) |
902 ((u64)seq->ccmp.pn[2] << 24) |
903 ((u64)seq->ccmp.pn[1] << 32) |
904 ((u64)seq->ccmp.pn[0] << 40);
905 atomic64_set(&key->u.ccmp.tx_pn, pn64);
906 break;
907 case WLAN_CIPHER_SUITE_AES_CMAC:
56c52da2 908 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
27b3eb9c
JB
909 pn64 = (u64)seq->aes_cmac.pn[5] |
910 ((u64)seq->aes_cmac.pn[4] << 8) |
911 ((u64)seq->aes_cmac.pn[3] << 16) |
912 ((u64)seq->aes_cmac.pn[2] << 24) |
913 ((u64)seq->aes_cmac.pn[1] << 32) |
914 ((u64)seq->aes_cmac.pn[0] << 40);
915 atomic64_set(&key->u.aes_cmac.tx_pn, pn64);
916 break;
00b9cfa3
JM
917 case WLAN_CIPHER_SUITE_GCMP:
918 case WLAN_CIPHER_SUITE_GCMP_256:
919 pn64 = (u64)seq->gcmp.pn[5] |
920 ((u64)seq->gcmp.pn[4] << 8) |
921 ((u64)seq->gcmp.pn[3] << 16) |
922 ((u64)seq->gcmp.pn[2] << 24) |
923 ((u64)seq->gcmp.pn[1] << 32) |
924 ((u64)seq->gcmp.pn[0] << 40);
925 atomic64_set(&key->u.gcmp.tx_pn, pn64);
926 break;
27b3eb9c
JB
927 default:
928 WARN_ON(1);
929 break;
930 }
931}
932EXPORT_SYMBOL_GPL(ieee80211_set_key_tx_seq);
933
934void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
935 int tid, struct ieee80211_key_seq *seq)
936{
937 struct ieee80211_key *key;
938 u8 *pn;
939
940 key = container_of(keyconf, struct ieee80211_key, conf);
941
942 switch (key->conf.cipher) {
943 case WLAN_CIPHER_SUITE_TKIP:
944 if (WARN_ON(tid < 0 || tid >= IEEE80211_NUM_TIDS))
945 return;
946 key->u.tkip.rx[tid].iv32 = seq->tkip.iv32;
947 key->u.tkip.rx[tid].iv16 = seq->tkip.iv16;
948 break;
949 case WLAN_CIPHER_SUITE_CCMP:
2b2ba0db 950 case WLAN_CIPHER_SUITE_CCMP_256:
27b3eb9c
JB
951 if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS))
952 return;
953 if (tid < 0)
954 pn = key->u.ccmp.rx_pn[IEEE80211_NUM_TIDS];
955 else
956 pn = key->u.ccmp.rx_pn[tid];
957 memcpy(pn, seq->ccmp.pn, IEEE80211_CCMP_PN_LEN);
958 break;
959 case WLAN_CIPHER_SUITE_AES_CMAC:
56c52da2 960 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
27b3eb9c
JB
961 if (WARN_ON(tid != 0))
962 return;
963 pn = key->u.aes_cmac.rx_pn;
964 memcpy(pn, seq->aes_cmac.pn, IEEE80211_CMAC_PN_LEN);
965 break;
00b9cfa3
JM
966 case WLAN_CIPHER_SUITE_GCMP:
967 case WLAN_CIPHER_SUITE_GCMP_256:
968 if (WARN_ON(tid < -1 || tid >= IEEE80211_NUM_TIDS))
969 return;
970 if (tid < 0)
971 pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS];
972 else
973 pn = key->u.gcmp.rx_pn[tid];
974 memcpy(pn, seq->gcmp.pn, IEEE80211_GCMP_PN_LEN);
975 break;
27b3eb9c
JB
976 default:
977 WARN_ON(1);
978 break;
979 }
980}
981EXPORT_SYMBOL_GPL(ieee80211_set_key_rx_seq);
982
983void ieee80211_remove_key(struct ieee80211_key_conf *keyconf)
984{
985 struct ieee80211_key *key;
986
987 key = container_of(keyconf, struct ieee80211_key, conf);
988
989 assert_key_lock(key->local);
990
991 /*
992 * if key was uploaded, we assume the driver will/has remove(d)
993 * it, so adjust bookkeeping accordingly
994 */
995 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
996 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
997
1e359a5d 998 if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
db12847c 999 (key->conf.flags & IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
27b3eb9c
JB
1000 increment_tailroom_need_count(key->sdata);
1001 }
1002
1003 ieee80211_key_free(key, false);
1004}
1005EXPORT_SYMBOL_GPL(ieee80211_remove_key);
1006
1007struct ieee80211_key_conf *
1008ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
1009 struct ieee80211_key_conf *keyconf)
1010{
1011 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
1012 struct ieee80211_local *local = sdata->local;
1013 struct ieee80211_key *key;
1014 int err;
1015
1016 if (WARN_ON(!local->wowlan))
1017 return ERR_PTR(-EINVAL);
1018
1019 if (WARN_ON(vif->type != NL80211_IFTYPE_STATION))
1020 return ERR_PTR(-EINVAL);
1021
1022 key = ieee80211_key_alloc(keyconf->cipher, keyconf->keyidx,
1023 keyconf->keylen, keyconf->key,
2475b1cc 1024 0, NULL, NULL);
27b3eb9c 1025 if (IS_ERR(key))
c5dc164d 1026 return ERR_CAST(key);
27b3eb9c
JB
1027
1028 if (sdata->u.mgd.mfp != IEEE80211_MFP_DISABLED)
1029 key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
1030
1031 err = ieee80211_key_link(key, sdata, NULL);
1032 if (err)
1033 return ERR_PTR(err);
1034
1035 return &key->conf;
1036}
1037EXPORT_SYMBOL_GPL(ieee80211_gtk_rekey_add);
This page took 0.538635 seconds and 5 git commands to generate.