提交 0f927323 编写于 作者: J Johannes Berg

mac80211: use CMAC_PN_LEN

Instead of hardcoding its value (6), use the constant.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 f0dea9c7
......@@ -372,8 +372,9 @@ struct ieee80211_key *ieee80211_key_alloc(u32 cipher, int idx, size_t key_len,
key->conf.iv_len = 0;
key->conf.icv_len = sizeof(struct ieee80211_mmie);
if (seq)
for (j = 0; j < 6; j++)
key->u.aes_cmac.rx_pn[j] = seq[6 - j - 1];
for (j = 0; j < CMAC_PN_LEN; j++)
key->u.aes_cmac.rx_pn[j] =
seq[CMAC_PN_LEN - j - 1];
/*
* Initialize AES key state here as an optimization so that
* it does not need to be initialized for every packet.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册