wifi: mac80211: refactor CMAC implementation
Subsystems (2)
cover wifi: mac80211: refactor CMAC implementation
This series refactors the CMAC implementation in mac80211 to:
1. Remove unnecessary operation
2. Add proper error handling
3. Remove duplication
Chien Wong (6):
wifi: mac80211: remove an unnecessary copy
wifi: mac80211: fix CMAC functions not handling errors
wifi: mac80211: add generic MMIE struct defines
wifi: mac80211: utilize the newly defined CMAC constants
wifi: mac80211: refactor CMAC crypt functions
wifi: mac80211: refactor CMAC packet handlers
include/linux/ieee80211.h | 14 +++- net/mac80211/aes_cmac.c | 60 +++++++--------- net/mac80211/aes_cmac.h | 6 +- net/mac80211/aes_gmac.h | 2 +- net/mac80211/rx.c | 6 +- net/mac80211/tx.c | 6 +- net/mac80211/wpa.c | 144 +++++++------------------------------- net/mac80211/wpa.h | 10 ++- 8 files changed, 80 insertions(+), 168 deletions(-)
Signature · 1 line
2.51.2
PATCH 1/6 wifi: mac80211: remove an unnecessary copy
Using a temporary buffer for saving the CMAC result is useless. With the patch, ieee80211_aes_cmac() just resembles ieee80211_aes_cmac_256().
Compile test only.
--- net/mac80211/aes_cmac.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/mac80211/aes_cmac.c +1 -4
@@ -26,7 +26,6 @@ void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, const u8 *data, size_t data_len, u8 *mic) {SHASH_DESC_ON_STACK (desc ,tfm ); -u8 out[AES_BLOCK_SIZE ];const __le16 *fc; desc->tfm = tfm;
@@ -41,9 +40,7 @@ void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, }else {crypto_shash_update (desc, data, data_len -CMAC_TLEN ); } -crypto_shash_finup (desc, zero,CMAC_TLEN , out); - -memcpy (mic, out,CMAC_TLEN ); +crypto_shash_finup (desc, zero,CMAC_TLEN , mic); } void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad,
Signature · 1 line
2.51.2
PATCH 2/6 wifi: mac80211: fix CMAC functions not handling errors
In reply to Chien WongThe called hash functions could fail thus we should check return values. All references to the changed functions in the tree are adapted.
Compile test only.
--- net/mac80211/aes_cmac.c | 60 +++++++++++++++++++++++++++++------------ net/mac80211/aes_cmac.h | 8 +++--- net/mac80211/wpa.c | 20 ++++++++------ 3 files changed, 59 insertions(+), 29 deletions(-)
net/mac80211/aes_cmac.c +43 -17
@@ -22,47 +22,73 @@static const u8 zero[CMAC_TLEN_256 ]; -void ieee80211_aes_cmac (struct crypto_shash *tfm,const u8 *aad, -const u8 *data,size_t data_len,u8 *mic) +int ieee80211_aes_cmac (struct crypto_shash *tfm,const u8 *aad, +const u8 *data,size_t data_len,u8 *mic) { +int err;SHASH_DESC_ON_STACK (desc, tfm);const __le16 *fc; desc->tfm = tfm; -crypto_shash_init (desc); -crypto_shash_update (desc, aad,AAD_LEN ); + err =crypto_shash_init (desc); +if (err) + goto out; + err =crypto_shash_update (desc, aad,AAD_LEN ); +if (err) + goto out; fc = (const __le16 *)aad;if (ieee80211_is_beacon (*fc)) {/* mask Timestamp field to zero */ -crypto_shash_update (desc, zero,8 ); -crypto_shash_update (desc, data +8 , data_len -8 -CMAC_TLEN ); + err =crypto_shash_update (desc, zero,8 ); +if (err) + goto out; + err =crypto_shash_update (desc, data +8 , data_len -8 -CMAC_TLEN ); +if (err) + goto out; }else { -crypto_shash_update (desc, data, data_len -CMAC_TLEN ); + err =crypto_shash_update (desc, data, data_len -CMAC_TLEN ); +if (err) + goto out; } -crypto_shash_finup (desc, zero,CMAC_TLEN , mic); + err =crypto_shash_finup (desc, zero,CMAC_TLEN , mic); +out: +return err; } -void ieee80211_aes_cmac_256 (struct crypto_shash *tfm,const u8 *aad, -const u8 *data,size_t data_len,u8 *mic) +int ieee80211_aes_cmac_256 (struct crypto_shash *tfm,const u8 *aad, +const u8 *data,size_t data_len,u8 *mic) { +int err;SHASH_DESC_ON_STACK (desc, tfm);const __le16 *fc; desc->tfm = tfm; -crypto_shash_init (desc); -crypto_shash_update (desc, aad,AAD_LEN ); + err =crypto_shash_init (desc); +if (err) + goto out; + err =crypto_shash_update (desc, aad,AAD_LEN ); +if (err) + goto out; fc = (const __le16 *)aad;if (ieee80211_is_beacon (*fc)) {/* mask Timestamp field to zero */ -crypto_shash_update (desc, zero,8 ); -crypto_shash_update (desc, data +8 , - data_len -8 -CMAC_TLEN_256 ); + err =crypto_shash_update (desc, zero,8 ); +if (err) + goto out; + err =crypto_shash_update (desc, data +8 , + data_len -8 -CMAC_TLEN_256 ); +if (err) + goto out; }else { -crypto_shash_update (desc, data, data_len -CMAC_TLEN_256 ); + err =crypto_shash_update (desc, data, data_len -CMAC_TLEN_256 ); +if (err) + goto out; } -crypto_shash_finup (desc, zero,CMAC_TLEN_256 , mic); + err =crypto_shash_finup (desc, zero,CMAC_TLEN_256 , mic); +out: +return err; } struct crypto_shash *ieee80211_aes_cmac_key_setup(const u8 key[],
net/mac80211/aes_cmac.h +4 -4
@@ -11,10 +11,10 @@struct crypto_shash *ieee80211_aes_cmac_key_setup (const u8 key[],size_t key_len); -void ieee80211_aes_cmac (struct crypto_shash *tfm,const u8 *aad, -const u8 *data,size_t data_len,u8 *mic); -void ieee80211_aes_cmac_256 (struct crypto_shash *tfm,const u8 *aad, -const u8 *data,size_t data_len,u8 *mic); +int ieee80211_aes_cmac (struct crypto_shash *tfm,const u8 *aad, +const u8 *data,size_t data_len,u8 *mic); +int ieee80211_aes_cmac_256 (struct crypto_shash *tfm,const u8 *aad, +const u8 *data,size_t data_len,u8 *mic);void ieee80211_aes_cmac_key_free (struct crypto_shash *tfm);#endif /* AES_CMAC_H */
net/mac80211/wpa.c +12 -8
@@ -869,8 +869,9 @@ ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx)/* * MIC = AES-128-CMAC(IGTK, AAD || Management Frame Body || MMIE, 64) */ -ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, - skb->data +24 , skb->len -24 , mmie->mic); +if (ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, + skb->data +24 , skb->len -24 , mmie->mic)) +return TX_DROP ;return TX_CONTINUE ; }
@@ -916,8 +917,9 @@ ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx)/* MIC = AES-256-CMAC(IGTK, AAD || Management Frame Body || MMIE, 128) */ -ieee80211_aes_cmac_256 (key->u.aes_cmac.tfm, aad, - skb->data +24 , skb->len -24 , mmie->mic); +if (ieee80211_aes_cmac_256 (key->u.aes_cmac.tfm, aad, + skb->data +24 , skb->len -24 , mmie->mic)) +return TX_DROP ;return TX_CONTINUE ; }
@@ -956,8 +958,9 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx)if (!(status->flag &RX_FLAG_DECRYPTED )) {/* hardware didn't decrypt/verify MIC */ bip_aad (skb, aad); -ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, - skb->data +24 , skb->len -24 , mic); +if (ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, + skb->data +24 , skb->len -24 , mic)) +return RX_DROP_U_DECRYPT_FAIL ;if (crypto_memneq (mic, mmie->mic,sizeof (mmie->mic))) { key->u.aes_cmac.icverrors++;return RX_DROP_U_MIC_FAIL ;
@@ -1006,8 +1009,9 @@ ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx)if (!(status->flag &RX_FLAG_DECRYPTED )) {/* hardware didn't decrypt/verify MIC */ bip_aad (skb, aad); -ieee80211_aes_cmac_256 (key->u.aes_cmac.tfm, aad, - skb->data +24 , skb->len -24 , mic); +if (ieee80211_aes_cmac_256 (key->u.aes_cmac.tfm, aad, + skb->data +24 , skb->len -24 , mic)) +return RX_DROP_U_DECRYPT_FAIL ;if (crypto_memneq (mic, mmie->mic,sizeof (mmie->mic))) { key->u.aes_cmac.icverrors++;return RX_DROP_U_MIC_FAIL ;
Signature · 1 line
2.51.2
PATCH 3/6 wifi: mac80211: add generic MMIE struct defines
In reply to Chien WongThe added struct is needed when writing generic handler for both CMAC-128 and CMAC-256.
Compile test only.
--- include/linux/ieee80211.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
include/linux/ieee80211.h +13 -1
@@ -1633,7 +1633,7 @@ struct ieee80211_mgmt {#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u) -/* Management MIC information element (IEEE 802.11w) */ +/* Management MIC information element (IEEE 802.11w) for CMAC */ struct ieee80211_mmie {u8 element_id;u8 length;
@@ -1651,6 +1651,15 @@ struct ieee80211_mmie_16 {u8 mic[16 ]; } __packed; +/* Management MIC information element (IEEE 802.11w) for all variants */ +struct ieee80211_mmie_var { +u8 element_id; +u8 length; +__le16 key_id; +u8 sequence_number[6 ]; +u8 mic[];/* 8 or 16 bytes */ +} __packed; +struct ieee80211_vendor_ie {u8 element_id;u8 len;
@@ -4064,6 +4073,9 @@ enum ieee80211_radio_measurement_actioncode {#define IEEE80211_GCMP_HDR_LEN 8#define IEEE80211_GCMP_MIC_LEN 16#define IEEE80211_GCMP_PN_LEN 6 +#define IEEE80211_CMAC_128_MIC_LEN 8 +#define IEEE80211_CMAC_256_MIC_LEN 16 +#define IEEE80211_GMAC_MIC_LEN 16#define FILS_NONCE_LEN 16#define FILS_MAX_KEK_LEN 64
Signature · 1 line
2.51.2
PATCH 4/6 wifi: mac80211: utilize the newly defined CMAC constants
In reply to Chien WongMake use of the added constants to reduce duplication.
Compile test only.
--- net/mac80211/aes_cmac.c | 4 ++-- net/mac80211/aes_gmac.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
net/mac80211/aes_cmac.c +2 -2
@@ -16,8 +16,8 @@#include "key.h" #include "aes_cmac.h" -#define CMAC_TLEN 8/* CMAC TLen = 64 bits (8 octets) */ -#define CMAC_TLEN_256 16/* CMAC TLen = 128 bits (16 octets) */ +#define CMAC_TLEN IEEE80211_CMAC_128_MIC_LEN +#define CMAC_TLEN_256 IEEE80211_CMAC_256_MIC_LEN#define AAD_LEN 20static const u8 zero[CMAC_TLEN_256 ];
net/mac80211/aes_gmac.h +1 -1
@@ -9,7 +9,7 @@#include <linux/crypto.h> #define GMAC_AAD_LEN 20 -#define GMAC_MIC_LEN 16 +#define GMAC_MIC_LEN IEEE80211_GMAC_MIC_LEN#define GMAC_NONCE_LEN 12 struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[],
Signature · 1 line
2.51.2
PATCH 5/6 wifi: mac80211: refactor CMAC crypt functions
In reply to Chien Wongieee80211_aes_cmac() and ieee80211_aes_cmac_256() are almost the same. Merge them. This removes duplication.
All references to the refactored functions in the tree are adapted.
Complie test only.
--- net/mac80211/aes_cmac.c | 49 +++++++---------------------------------- net/mac80211/aes_cmac.h | 4 +--- net/mac80211/wpa.c | 16 +++++++++----- 3 files changed, 19 insertions(+), 50 deletions(-)
net/mac80211/aes_cmac.c +8 -41
@@ -16,52 +16,20 @@#include "key.h" #include "aes_cmac.h" -#define CMAC_TLEN IEEE80211_CMAC_128_MIC_LEN -#define CMAC_TLEN_256 IEEE80211_CMAC_256_MIC_LEN#define AAD_LEN 20 -static const u8 zero[CMAC_TLEN_256 ]; +static const u8 zero[IEEE80211_CMAC_256_MIC_LEN ];int ieee80211_aes_cmac (struct crypto_shash *tfm,const u8 *aad, -const u8 *data,size_t data_len,u8 *mic) +const u8 *data,size_t data_len,u8 *mic,unsigned int mic_len) {int err;SHASH_DESC_ON_STACK (desc, tfm);const __le16 *fc; - desc->tfm = tfm; - - err =crypto_shash_init (desc); -if (err) - goto out; - err =crypto_shash_update (desc, aad,AAD_LEN ); -if (err) - goto out; - fc = (const __le16 *)aad; -if (ieee80211_is_beacon (*fc)) { -/* mask Timestamp field to zero */ - err =crypto_shash_update (desc, zero,8 ); -if (err) - goto out; - err =crypto_shash_update (desc, data +8 , data_len -8 -CMAC_TLEN ); -if (err) - goto out; - }else { - err =crypto_shash_update (desc, data, data_len -CMAC_TLEN ); -if (err) - goto out; - } - err =crypto_shash_finup (desc, zero,CMAC_TLEN , mic); -out: -return err; -} - -int ieee80211_aes_cmac_256 (struct crypto_shash *tfm,const u8 *aad, -const u8 *data,size_t data_len,u8 *mic) -{ -int err; -SHASH_DESC_ON_STACK (desc, tfm); -const __le16 *fc; +if (mic_len !=IEEE80211_CMAC_128_MIC_LEN && + mic_len !=IEEE80211_CMAC_256_MIC_LEN ) +return -EINVAL ; desc->tfm = tfm;
@@ -77,16 +45,15 @@ int ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, err =crypto_shash_update (desc, zero,8 );if (err) goto out; - err =crypto_shash_update (desc, data +8 , - data_len -8 -CMAC_TLEN_256 ); + err =crypto_shash_update (desc, data +8 , data_len -8 - mic_len);if (err) goto out; }else { - err =crypto_shash_update (desc, data, data_len -CMAC_TLEN_256 ); + err =crypto_shash_update (desc, data, data_len - mic_len);if (err) goto out; } - err =crypto_shash_finup (desc, zero,CMAC_TLEN_256 , mic); + err =crypto_shash_finup (desc, zero, mic_len, mic); out:return err; }
net/mac80211/aes_cmac.h +1 -3
@@ -12,9 +12,7 @@struct crypto_shash *ieee80211_aes_cmac_key_setup (const u8 key[],size_t key_len);int ieee80211_aes_cmac (struct crypto_shash *tfm,const u8 *aad, -const u8 *data,size_t data_len,u8 *mic); -int ieee80211_aes_cmac_256 (struct crypto_shash *tfm,const u8 *aad, -const u8 *data,size_t data_len,u8 *mic); +const u8 *data,size_t data_len,u8 *mic,unsigned int mic_len);void ieee80211_aes_cmac_key_free (struct crypto_shash *tfm);#endif /* AES_CMAC_H */
net/mac80211/wpa.c +10 -6
@@ -870,7 +870,8 @@ ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx)* MIC = AES-128-CMAC(IGTK, AAD || Management Frame Body || MMIE, 64) */ if (ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, - skb->data +24 , skb->len -24 , mmie->mic)) + skb->data +24 , skb->len -24 , mmie->mic, +IEEE80211_CMAC_128_MIC_LEN ))return TX_DROP ;return TX_CONTINUE ;
@@ -917,8 +918,9 @@ ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx)/* MIC = AES-256-CMAC(IGTK, AAD || Management Frame Body || MMIE, 128) */ -if (ieee80211_aes_cmac_256 (key->u.aes_cmac.tfm, aad, - skb->data +24 , skb->len -24 , mmie->mic)) +if (ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, + skb->data +24 , skb->len -24 , mmie->mic, +IEEE80211_CMAC_256_MIC_LEN ))return TX_DROP ;return TX_CONTINUE ;
@@ -959,7 +961,8 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx)/* hardware didn't decrypt/verify MIC */ bip_aad (skb, aad);if (ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, - skb->data +24 , skb->len -24 , mic)) + skb->data +24 , skb->len -24 , mic, +IEEE80211_CMAC_128_MIC_LEN ))return RX_DROP_U_DECRYPT_FAIL ;if (crypto_memneq (mic, mmie->mic,sizeof (mmie->mic))) { key->u.aes_cmac.icverrors++;
@@ -1009,8 +1012,9 @@ ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx)if (!(status->flag &RX_FLAG_DECRYPTED )) {/* hardware didn't decrypt/verify MIC */ bip_aad (skb, aad); -if (ieee80211_aes_cmac_256 (key->u.aes_cmac.tfm, aad, - skb->data +24 , skb->len -24 , mic)) +if (ieee80211_aes_cmac (key->u.aes_cmac.tfm, aad, + skb->data +24 , skb->len -24 , mic, +IEEE80211_CMAC_256_MIC_LEN ))return RX_DROP_U_DECRYPT_FAIL ;if (crypto_memneq (mic, mmie->mic,sizeof (mmie->mic))) { key->u.aes_cmac.icverrors++;
Signature · 1 line
2.51.2
PATCH 6/6 wifi: mac80211: refactor CMAC packet handlers
In reply to Chien WongMerge CMAC-128 and CMAC-256 handlers since they are almost the same. This removes duplication.
All references to the refactored functions in the tree are adapted.
The comment 'MIC = AES-128-CMAC(IGTK, AAD ...' is out-dated since CMAC is also used with BIGTK, as is the comment for CMAC-256. Simply remove the comments.
Tested-on: mac80211_hwsim
--- net/mac80211/rx.c | 6 +- net/mac80211/tx.c | 6 +- net/mac80211/wpa.c | 144 ++++++++------------------------------------- net/mac80211/wpa.h | 10 ++-- 4 files changed, 35 insertions(+), 131 deletions(-)
net/mac80211/rx.c +4 -2
@@ -2215,10 +2215,12 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx) rx, IEEE80211_CCMP_256_MIC_LEN);break ;case WLAN_CIPHER_SUITE_AES_CMAC : - result =ieee80211_crypto_aes_cmac_decrypt (rx); + result =ieee80211_crypto_aes_cmac_decrypt ( + rx,IEEE80211_CMAC_128_MIC_LEN );break ;case WLAN_CIPHER_SUITE_BIP_CMAC_256 : - result =ieee80211_crypto_aes_cmac_256_decrypt (rx); + result =ieee80211_crypto_aes_cmac_decrypt ( + rx,IEEE80211_CMAC_256_MIC_LEN );break ;case WLAN_CIPHER_SUITE_BIP_GMAC_128 :case WLAN_CIPHER_SUITE_BIP_GMAC_256 :
net/mac80211/tx.c +4 -2
@@ -1062,9 +1062,11 @@ ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx)return ieee80211_crypto_ccmp_encrypt ( tx,IEEE80211_CCMP_256_MIC_LEN );case WLAN_CIPHER_SUITE_AES_CMAC : -return ieee80211_crypto_aes_cmac_encrypt (tx); +return ieee80211_crypto_aes_cmac_encrypt ( + tx,IEEE80211_CMAC_128_MIC_LEN );case WLAN_CIPHER_SUITE_BIP_CMAC_256 : -return ieee80211_crypto_aes_cmac_256_encrypt (tx); +return ieee80211_crypto_aes_cmac_encrypt ( + tx,IEEE80211_CMAC_256_MIC_LEN );case WLAN_CIPHER_SUITE_BIP_GMAC_128 :case WLAN_CIPHER_SUITE_BIP_GMAC_256 :return ieee80211_crypto_aes_gmac_encrypt (tx);
net/mac80211/wpa.c +23 -121
204 lines not on this page · raw message
net/mac80211/wpa.h +4 -6
@@ -29,13 +29,11 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, unsigned int mic_len);ieee80211_tx_result -ieee80211_crypto_aes_cmac_encrypt (struct ieee80211_tx_data *tx); -ieee80211_tx_result -ieee80211_crypto_aes_cmac_256_encrypt (struct ieee80211_tx_data *tx); -ieee80211_rx_result -ieee80211_crypto_aes_cmac_decrypt (struct ieee80211_rx_data *rx); +ieee80211_crypto_aes_cmac_encrypt (struct ieee80211_tx_data *tx, +unsigned int mic_len);ieee80211_rx_result -ieee80211_crypto_aes_cmac_256_decrypt (struct ieee80211_rx_data *rx); +ieee80211_crypto_aes_cmac_decrypt (struct ieee80211_rx_data *rx, +unsigned int mic_len);ieee80211_tx_result ieee80211_crypto_aes_gmac_encrypt (struct ieee80211_tx_data *tx); ieee80211_rx_result
Signature · 1 line
2.51.2
Johannes Berg
maintainerRe: [PATCH 1/6] wifi: mac80211: remove an unnecessary copy
In reply to Chien WongQuoted 2 lines · Chien Wong
Compile test only.
You can trivially do better than that, say with hwsim + wlantest.
Quoted 1 line
Fixes 26717828b75d ("mac80211: aes-cmac: switch to shash CMAC driver")
That seems unwarranted, it's not even broken in the old code.
johannes
Johannes Berg
maintainerRe: [PATCH 6/6] wifi: mac80211: refactor CMAC packet handlers
In reply to Chien WongQuoted 9 lines · Chien Wong
Merge CMAC-128 and CMAC-256 handlers since they are almost the same. This removes duplication.
All references to the refactored functions in the tree are adapted.The comment 'MIC = AES-128-CMAC(IGTK, AAD ...' is out-dated since CMAC is also used with BIGTK, as is the comment for CMAC-256. Simply remove the comments.
Tested-on:
mac80211_hwsim
Oh, I see this now - but your changes affect both RX and TX so you should cross-check against another implementation (such as wlantest) I'd think. Also, that's a non-standard Qualcomm/ath driver thing :)
johannes
Re: [PATCH 1/6] wifi: mac80211: remove an unnecessary copy
In reply to Johannes BergQuoted 5 lines · Johannes Berg
Quoted 2 lines · Chien Wong
Compile test only.
You can trivially do better than that, say with hwsim + wlantest.
OK. I will test with hwsim and update commit message in v2.
Quoted 3 lines
Quoted 1 line
Fixes 26717828b75d ("mac80211: aes-cmac: switch to shash CMAC driver")That seems unwarranted, it's not even broken in the old code.
Yep. It's a small optimization rather than a fix. It will be removed in v2.
Johannes Berg
maintainerRe: [PATCH 1/6] wifi: mac80211: remove an unnecessary copy
Quoted 8 lines · Chien Wong
Quoted 5 lines · Johannes Berg
Quoted 2 lines · Chien Wong
Compile test only.
You can trivially do better than that, say with hwsim + wlantest.
OK. I will test with hwsim and update commit message in v2.
Or just remove that and add it in the cover letter, but anyway it seems you _did_ even test it (to some extent) since you can't test just patch 6/6 by itself? :)
johannes
Re: [PATCH 1/6] wifi: mac80211: remove an unnecessary copy
Quoted 6 lines · Johannes Berg
Quoted 5 lines · Chien Wong
Quoted 4 lines · Johannes Berg
Quoted 2 lines · Chien Wong
Compile test only.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
You can trivially do better than that, say with hwsim + wlantest.
OK. I will test with hwsim and update commit message in v2.
Or just remove that and add it in the cover letter, but anyway it seems you _did_ even test it (to some extent) since you can't test just patch 6/6 by itself? :)
OK. I will remove them.
Re: [PATCH 6/6] wifi: mac80211: refactor CMAC packet handlers
In reply to Johannes BergQuoted 9 lines · Johannes Berg
Quoted 8 lines · Chien Wong
Merge CMAC-128 and CMAC-256 handlers since they are almost the same. This removes duplication.
All references to the refactored functions in the tree are adapted.The comment 'MIC = AES-128-CMAC(IGTK, AAD ...' is out-dated since CMAC is also used with BIGTK, as is the comment for CMAC-256. Simply remove the comments.
Quoted 7 lines
Quoted 1 line
Tested-on:
mac80211_hwsimOh, I see this now - but your changes affect both RX and TX so you should cross-check against another implementation (such as wlantest) I'd think. Also, that's a non-standard Qualcomm/ath driver thing :)
So far so good.
When testing Beacon Protection with hwsim, the STA's BIGTK rx_spec count increases as expected, while icverrors remain at 0. I have a patched Wireshark capable of verifying MMIE MIC. The captured
Beacon and protected broadcast Deauth frame all verifies good.