mac80211: fix CMAC races

Just like TKIP and CCMP, CMAC has the PN race.
It might not actually be possible to hit it now
since there aren't multiple ACs for management
frames, but fix it anyway.

Also move scratch buffers onto the stack.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg
2011-07-06 22:00:35 +02:00
committed by John W. Linville
parent aba83a0b30
commit 75396ae6d4
6 changed files with 33 additions and 32 deletions

View File

@@ -97,14 +97,11 @@ struct ieee80211_key {
#endif
} ccmp;
struct {
u8 tx_pn[6];
atomic64_t tx_pn;
u8 rx_pn[6];
struct crypto_cipher *tfm;
u32 replays; /* dot11RSNAStatsCMACReplays */
u32 icverrors; /* dot11RSNAStatsCMACICVErrors */
/* scratch buffers for virt_to_page() (crypto API) */
u8 tx_crypto_buf[2 * AES_BLOCK_LEN];
u8 rx_crypto_buf[2 * AES_BLOCK_LEN];
} aes_cmac;
} u;