ath9k_htc: turn on software mgmt crypto for secured mesh
PATCH 1/1 ath9k_htc: turn on software mgmt crypto for secured mesh
Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The patch "ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows the ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of management frames to be done in software. Fix this.
This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11n
and managed to work with peer mesh STA equipped with ath9k.
--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2 -1
@@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (key->cipher ==WLAN_CIPHER_SUITE_TKIP ) key->flags |=IEEE80211_KEY_FLAG_GENERATE_MMIC ; -if (priv->ah->sw_mgmt_crypto && +if ((vif->type ==NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher ==WLAN_CIPHER_SUITE_CCMP ) key->flags |=IEEE80211_KEY_FLAG_SW_MGMT_TX ; ret =0 ;
Signature · 1 line
2.1.1
PATCH 1/1 ath9k_htc: turn on software mgmt crypto for secured mesh
Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
Quoted 25 lines
Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The patch "
ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows theath9k_htcto be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of management frames to be done in software. Fix this.This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11nand managed to work with peer mesh STA equipped with ath9k.
Signed-off-by Chun-Yeow Yeoh <[email protected]>--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath9k/htc_drv_main.c +0
-0
drivers/net/wireless/ath/ath9k/htc_drv_main.c static int ath9k_htc_set_key(struct ieee80211_hw *hw, · line 1454
Quoted 9 lines
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2
-1@@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (key->cipher ==WLAN_CIPHER_SUITE_TKIP ) key->flags |=IEEE80211_KEY_FLAG_GENERATE_MMIC ; -if (priv->ah->sw_mgmt_crypto && +if ((vif->type ==NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher ==WLAN_CIPHER_SUITE_CCMP ) key->flags |=IEEE80211_KEY_FLAG_SW_MGMT_TX ; ret =0 ;
Hmm.. may be we should generally do it here:
if ((vif->type == NL80211_IFTYPE_ADHOC ||
vif->type == NL80211_IFTYPE_MESH_POINT) &&
(key->cipher == WLAN_CIPHER_SUITE_TKIP ||
key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {or probably set "sw_mgmt_crypto = true" in ath9k_hw_init_mfp() for all usb devices?
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20141114/d95b3fee/attachment.pgp
PATCH 1/1 ath9k_htc: turn on software mgmt crypto for secured mesh
Quoted 38 lines · Oleksij Rempel
Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
Quoted 25 lines
Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The patch "
ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows theath9k_htcto be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of management frames to be done in software. Fix this.This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11nand managed to work with peer mesh STA equipped with ath9k.
Signed-off-by Chun-Yeow Yeoh <[email protected]>--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath9k/htc_drv_main.c +0
-0drivers/net/wireless/ath/ath9k/htc_drv_main.c static int ath9k_htc_set_key(struct ieee80211_hw *hw, · line 1454
Quoted 9 lines
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2
-1@@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (key->cipher ==WLAN_CIPHER_SUITE_TKIP ) key->flags |=IEEE80211_KEY_FLAG_GENERATE_MMIC ; -if (priv->ah->sw_mgmt_crypto && +if ((vif->type ==NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher ==WLAN_CIPHER_SUITE_CCMP ) key->flags |=IEEE80211_KEY_FLAG_SW_MGMT_TX ; ret =0 ;Hmm.. may be we should generally do it here:
Quoted 6 lines
if ((vif->type == NL80211_IFTYPE_ADHOC ||
vif->type == NL80211_IFTYPE_MESH_POINT) &&
(key->cipher == WLAN_CIPHER_SUITE_TKIP ||
key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {Not so sure doing here is correctly. It is a pairwise key for unicast management frame, right?
Quoted 2 lines
or probably set "
sw_mgmt_crypto= true" inath9k_hw_init_mfp()for all usb devices?
All ath9k USB devices don't have MFP support?
---
ChunYeow
PATCH 1/1 ath9k_htc: turn on software mgmt crypto for secured mesh
Hi, Oleksij Rpel
If we do it in ath9k_hw_init_mfp, these MAC version are related to USB devices:
AR_SREV_VERSION_9271AR_SREV_VERSION_9280AR_SREV_VERSION_9287
Right?
----
ChunYeow
Quoted 56 lines · Yeoh Chun-Yeow
Quoted 38 lines · Oleksij Rempel
Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
Quoted 25 lines
Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The patch "
ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows theath9k_htcto be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of management frames to be done in software. Fix this.This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11nand managed to work with peer mesh STA equipped with ath9k.
Signed-off-by Chun-Yeow Yeoh <[email protected]>--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath9k/htc_drv_main.c +0
-0drivers/net/wireless/ath/ath9k/htc_drv_main.c static int ath9k_htc_set_key(struct ieee80211_hw *hw, · line 1454
Quoted 9 lines
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2
-1@@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (key->cipher ==WLAN_CIPHER_SUITE_TKIP ) key->flags |=IEEE80211_KEY_FLAG_GENERATE_MMIC ; -if (priv->ah->sw_mgmt_crypto && +if ((vif->type ==NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher ==WLAN_CIPHER_SUITE_CCMP ) key->flags |=IEEE80211_KEY_FLAG_SW_MGMT_TX ; ret =0 ;Hmm.. may be we should generally do it here:
Quoted 6 lines
if ((vif->type == NL80211_IFTYPE_ADHOC || vif->type == NL80211_IFTYPE_MESH_POINT) && (key->cipher == WLAN_CIPHER_SUITE_TKIP || key->cipher == WLAN_CIPHER_SUITE_CCMP) && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {Not so sure doing here is correctly. It is a pairwise key for unicast management frame, right?
Quoted 2 lines
or probably set "
sw_mgmt_crypto= true" inath9k_hw_init_mfp()for all usb devices?All ath9k USB devices don't have MFP support?
---
ChunYeow
PATCH 1/1 ath9k_htc: turn on software mgmt crypto for secured mesh
Am 14.11.2014 um 10:18 schrieb Yeoh Chun-Yeow:
Quoted 9 lines
Hi, Oleksij Rpel
If we do it in
ath9k_hw_init_mfp, these MAC version are related to USB devices:
AR_SREV_VERSION_9271AR_SREV_VERSION_9280AR_SREV_VERSION_9287Right?
yes. ar9271 with usb interface. ar9280 and ar9287 are pcie attached to ar7010 cpu.
Quoted 60 lines
----
ChunYeowQuoted 56 lines · Yeoh Chun-Yeow
Quoted 38 lines · Oleksij Rempel
Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
Quoted 25 lines
Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The patch "
ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows theath9k_htcto be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of management frames to be done in software. Fix this.This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11nand managed to work with peer mesh STA equipped with ath9k.
Signed-off-by Chun-Yeow Yeoh <[email protected]>--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath9k/htc_drv_main.c +0
-0drivers/net/wireless/ath/ath9k/htc_drv_main.c static int ath9k_htc_set_key(struct ieee80211_hw *hw, · line 1454
Quoted 9 lines
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2
-1@@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (key->cipher ==WLAN_CIPHER_SUITE_TKIP ) key->flags |=IEEE80211_KEY_FLAG_GENERATE_MMIC ; -if (priv->ah->sw_mgmt_crypto && +if ((vif->type ==NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher ==WLAN_CIPHER_SUITE_CCMP ) key->flags |=IEEE80211_KEY_FLAG_SW_MGMT_TX ; ret =0 ;Hmm.. may be we should generally do it here:
Quoted 6 lines
if ((vif->type == NL80211_IFTYPE_ADHOC || vif->type == NL80211_IFTYPE_MESH_POINT) && (key->cipher == WLAN_CIPHER_SUITE_TKIP || key->cipher == WLAN_CIPHER_SUITE_CCMP) && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {Not so sure doing here is correctly. It is a pairwise key for unicast management frame, right?
Quoted 2 lines
or probably set "
sw_mgmt_crypto= true" inath9k_hw_init_mfp()for all usb devices?All ath9k USB devices don't have MFP support?
---
ChunYeow
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20141114/2383dc01/attachment.pgp
PATCH 1/1 ath9k_htc: turn on software mgmt crypto for secured mesh
Quoted 5 lines · Oleksij Rempel
Am 14.11.2014 um 10:18 schrieb Yeoh Chun-Yeow:
Quoted 4 lines
Hi, Oleksij Rpel
If we do it in
ath9k_hw_init_mfp, these MAC version are related to USB devices:
Quoted 9 lines
Quoted 5 lines
AR_SREV_VERSION_9271AR_SREV_VERSION_9280AR_SREV_VERSION_9287Right?
yes. ar9271 with usb interface. ar9280 and ar9287 are pcie attached to ar7010 cpu.
Alright, I will work out the patch using ath9k_hw_init_mfp.
---
ChunYeow
Quoted 66 lines
Quoted 60 lines
----
ChunYeowQuoted 56 lines · Yeoh Chun-Yeow
Quoted 38 lines · Oleksij Rempel
Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
Quoted 25 lines
Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The patch "
ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows theath9k_htcto be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of management frames to be done in software. Fix this.This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11nand managed to work with peer mesh STA equipped with ath9k.
Signed-off-by Chun-Yeow Yeoh <[email protected]>--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath9k/htc_drv_main.c +0
-0drivers/net/wireless/ath/ath9k/htc_drv_main.c static int ath9k_htc_set_key(struct ieee80211_hw *hw, · line 1454
Quoted 9 lines
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2
-1@@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (key->cipher ==WLAN_CIPHER_SUITE_TKIP ) key->flags |=IEEE80211_KEY_FLAG_GENERATE_MMIC ; -if (priv->ah->sw_mgmt_crypto && +if ((vif->type ==NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher ==WLAN_CIPHER_SUITE_CCMP ) key->flags |=IEEE80211_KEY_FLAG_SW_MGMT_TX ; ret =0 ;Hmm.. may be we should generally do it here:
Quoted 6 lines
if ((vif->type == NL80211_IFTYPE_ADHOC || vif->type == NL80211_IFTYPE_MESH_POINT) && (key->cipher == WLAN_CIPHER_SUITE_TKIP || key->cipher == WLAN_CIPHER_SUITE_CCMP) && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {Not so sure doing here is correctly. It is a pairwise key for unicast management frame, right?
Quoted 2 lines
or probably set "
sw_mgmt_crypto= true" inath9k_hw_init_mfp()for all usb devices?All ath9k USB devices don't have MFP support?
---
ChunYeow--
Regards,
Oleksij
PATCH 1/1 ath9k_htc: turn on software mgmt crypto for secured mesh
In reply to Yeoh Chun-YeowAm 14.11.2014 um 10:06 schrieb Yeoh Chun-Yeow:
Quoted 46 lines · Oleksij Rempel
Quoted 38 lines
Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
Quoted 25 lines
Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The patch "
ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows theath9k_htcto be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of management frames to be done in software. Fix this.This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11nand managed to work with peer mesh STA equipped with ath9k.
Signed-off-by Chun-Yeow Yeoh <[email protected]>--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath9k/htc_drv_main.c +0
-0drivers/net/wireless/ath/ath9k/htc_drv_main.c static int ath9k_htc_set_key(struct ieee80211_hw *hw, · line 1454
Quoted 9 lines
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2
-1@@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (key->cipher ==WLAN_CIPHER_SUITE_TKIP ) key->flags |=IEEE80211_KEY_FLAG_GENERATE_MMIC ; -if (priv->ah->sw_mgmt_crypto && +if ((vif->type ==NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher ==WLAN_CIPHER_SUITE_CCMP ) key->flags |=IEEE80211_KEY_FLAG_SW_MGMT_TX ; ret =0 ;Hmm.. may be we should generally do it here:
Quoted 6 lines
if ((vif->type == NL80211_IFTYPE_ADHOC || vif->type == NL80211_IFTYPE_MESH_POINT) && (key->cipher == WLAN_CIPHER_SUITE_TKIP || key->cipher == WLAN_CIPHER_SUITE_CCMP) && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
Quoted 2 lines
Not so sure doing here is correctly. It is a pairwise key for unicast management frame, right?
yes.
this code is identical to ath9k, so i will move it to common. This is the reason of my doubts.
Quoted 4 lines
Quoted 2 lines
or probably set "
sw_mgmt_crypto= true" inath9k_hw_init_mfp()for all usb devices?All ath9k USB devices don't have MFP support?
Hmm... do you have docs?
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 213 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20141114/1aad5749/attachment.pgp
PATCH 1/1 ath9k_htc: turn on software mgmt crypto for secured mesh
Unfortunately, I don't have any docs for this. Any others?
---
ChunYeow
Quoted 65 lines · Oleksij Rempel
Am 14.11.2014 um 10:06 schrieb Yeoh Chun-Yeow:
Quoted 46 lines · Oleksij Rempel
Quoted 38 lines
Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
Quoted 25 lines
Secured mesh encrypts the unicast mgmt frame using the same key that used for encrypting the unicast data frame. The patch "
ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame" applied to open-ath9k-htc-firmware allows theath9k_htcto be loaded without "nohwcrypt=1". Unfortunately, this is not working and we still need CCMP encryption of management frames to be done in software. Fix this.This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11nand managed to work with peer mesh STA equipped with ath9k.
Signed-off-by Chun-Yeow Yeoh <[email protected]>--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath9k/htc_drv_main.c +0
-0drivers/net/wireless/ath/ath9k/htc_drv_main.c static int ath9k_htc_set_key(struct ieee80211_hw *hw, · line 1454
Quoted 9 lines
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2
-1@@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw, key->flags |=IEEE80211_KEY_FLAG_GENERATE_IV ;if (key->cipher ==WLAN_CIPHER_SUITE_TKIP ) key->flags |=IEEE80211_KEY_FLAG_GENERATE_MMIC ; -if (priv->ah->sw_mgmt_crypto && +if ((vif->type ==NL80211_IFTYPE_MESH_POINT || + priv->ah->sw_mgmt_crypto) && key->cipher ==WLAN_CIPHER_SUITE_CCMP ) key->flags |=IEEE80211_KEY_FLAG_SW_MGMT_TX ; ret =0 ;Hmm.. may be we should generally do it here:
Quoted 6 lines
if ((vif->type == NL80211_IFTYPE_ADHOC || vif->type == NL80211_IFTYPE_MESH_POINT) && (key->cipher == WLAN_CIPHER_SUITE_TKIP || key->cipher == WLAN_CIPHER_SUITE_CCMP) && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {Quoted 2 lines
Not so sure doing here is correctly. It is a pairwise key for unicast management frame, right?
yes.
this code is identical to ath9k, so i will move it to common. This is the reason of my doubts.Quoted 4 lines
Quoted 2 lines
or probably set "
sw_mgmt_crypto= true" inath9k_hw_init_mfp()for all usb devices?All ath9k USB devices don't have MFP support?
Hmm... do you have docs?
--
Regards,
Oleksij