* [PATCH 0/2] mwifiex: add support for WPA-PSK-SHA256
@ 2024-07-16 11:33 Sascha Hauer
2024-07-16 11:33 ` [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting Sascha Hauer
2024-07-16 11:33 ` [PATCH 2/2] wifi: mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
0 siblings, 2 replies; 10+ messages in thread
From: Sascha Hauer @ 2024-07-16 11:33 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Kalle Valo
Cc: linux-wireless, linux-kernel, Sascha Hauer
This series adds support for the WPA-PSK AKM suite with SHA256 as hashing
method (WPA-PSK-SHA256)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (2):
wifi: mwifiex: simplify WPA flags setting
wifi: mwifiex: add support for WPA-PSK-SHA256
drivers/net/wireless/marvell/mwifiex/fw.h | 1 +
drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 30 +++++++++-----------------
2 files changed, 11 insertions(+), 20 deletions(-)
---
base-commit: 0c3836482481200ead7b416ca80c68a29cfdaabd
change-id: 20240716-mwifiex-wpa-psk-sha256-2d2a9fc3b06b
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting 2024-07-16 11:33 [PATCH 0/2] mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer @ 2024-07-16 11:33 ` Sascha Hauer 2024-07-16 19:48 ` Francesco Dolcini 2024-07-16 11:33 ` [PATCH 2/2] wifi: mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer 1 sibling, 1 reply; 10+ messages in thread From: Sascha Hauer @ 2024-07-16 11:33 UTC (permalink / raw) To: Brian Norris, Francesco Dolcini, Kalle Valo Cc: linux-wireless, linux-kernel, Sascha Hauer The WPA flags setting only depends on the wpa_versions bitfield and not on the AKM suite, so move it out of the switch/case to simplify the code a bit. No functional change intended. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 27 +++++++------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index 491e366119096..8d0cd84d27698 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -46,31 +46,18 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, bss_config->key_mgmt_operation |= KEY_MGMT_ON_HOST; + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1) + bss_config->protocol = PROTOCOL_WPA; + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2) + bss_config->protocol |= PROTOCOL_WPA2; + for (i = 0; i < params->crypto.n_akm_suites; i++) { switch (params->crypto.akm_suites[i]) { case WLAN_AKM_SUITE_8021X: - if (params->crypto.wpa_versions & - NL80211_WPA_VERSION_1) { - bss_config->protocol = PROTOCOL_WPA; - bss_config->key_mgmt = KEY_MGMT_EAP; - } - if (params->crypto.wpa_versions & - NL80211_WPA_VERSION_2) { - bss_config->protocol |= PROTOCOL_WPA2; - bss_config->key_mgmt = KEY_MGMT_EAP; - } + bss_config->key_mgmt = KEY_MGMT_EAP; break; case WLAN_AKM_SUITE_PSK: - if (params->crypto.wpa_versions & - NL80211_WPA_VERSION_1) { - bss_config->protocol = PROTOCOL_WPA; - bss_config->key_mgmt = KEY_MGMT_PSK; - } - if (params->crypto.wpa_versions & - NL80211_WPA_VERSION_2) { - bss_config->protocol |= PROTOCOL_WPA2; - bss_config->key_mgmt = KEY_MGMT_PSK; - } + bss_config->key_mgmt = KEY_MGMT_PSK; break; default: break; -- 2.39.2 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting 2024-07-16 11:33 ` [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting Sascha Hauer @ 2024-07-16 19:48 ` Francesco Dolcini 2024-07-17 6:26 ` Sascha Hauer 0 siblings, 1 reply; 10+ messages in thread From: Francesco Dolcini @ 2024-07-16 19:48 UTC (permalink / raw) To: Sascha Hauer Cc: Brian Norris, Francesco Dolcini, Kalle Valo, linux-wireless, linux-kernel Hello Sasha, thanks for your patch. On Tue, Jul 16, 2024 at 01:33:27PM +0200, Sascha Hauer wrote: > The WPA flags setting only depends on the wpa_versions bitfield and not > on the AKM suite, so move it out of the switch/case to simplify the code > a bit. No functional change intended. > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> > --- > drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 27 +++++++------------------- > 1 file changed, 7 insertions(+), 20 deletions(-) > > diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > index 491e366119096..8d0cd84d27698 100644 > --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > @@ -46,31 +46,18 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, > > bss_config->key_mgmt_operation |= KEY_MGMT_ON_HOST; > > + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1) > + bss_config->protocol = PROTOCOL_WPA; > + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2) > + bss_config->protocol |= PROTOCOL_WPA2; > + I am wondering what happens if NL80211_WPA_VERSION_1 is not set, no idea what's the content of bss_config->protocol ... in any case this is not something that you introduced, but maybe worth having a look? Francesco ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting 2024-07-16 19:48 ` Francesco Dolcini @ 2024-07-17 6:26 ` Sascha Hauer 2024-07-17 8:07 ` Francesco Dolcini 0 siblings, 1 reply; 10+ messages in thread From: Sascha Hauer @ 2024-07-17 6:26 UTC (permalink / raw) To: Francesco Dolcini; +Cc: Brian Norris, Kalle Valo, linux-wireless, linux-kernel On Tue, Jul 16, 2024 at 09:48:26PM +0200, Francesco Dolcini wrote: > Hello Sasha, > thanks for your patch. > > On Tue, Jul 16, 2024 at 01:33:27PM +0200, Sascha Hauer wrote: > > The WPA flags setting only depends on the wpa_versions bitfield and not > > on the AKM suite, so move it out of the switch/case to simplify the code > > a bit. No functional change intended. > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> > > > --- > > drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 27 +++++++------------------- > > 1 file changed, 7 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > index 491e366119096..8d0cd84d27698 100644 > > --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > @@ -46,31 +46,18 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, > > > > bss_config->key_mgmt_operation |= KEY_MGMT_ON_HOST; > > > > + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1) > > + bss_config->protocol = PROTOCOL_WPA; > > + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2) > > + bss_config->protocol |= PROTOCOL_WPA2; > > + > > I am wondering what happens if NL80211_WPA_VERSION_1 is not set, no idea > what's the content of bss_config->protocol ... > > in any case this is not something that you introduced, but maybe worth > having a look? bss_config is kzalloced in the only caller of mwifiex_set_secure_params(), so bss_config->protocol is zero on entry. It might be worth setting it to zero explicitly here to make the code better understandable without having to look at the callers. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting 2024-07-17 6:26 ` Sascha Hauer @ 2024-07-17 8:07 ` Francesco Dolcini 2024-07-17 8:34 ` Sascha Hauer 0 siblings, 1 reply; 10+ messages in thread From: Francesco Dolcini @ 2024-07-17 8:07 UTC (permalink / raw) To: Sascha Hauer Cc: Francesco Dolcini, Brian Norris, Kalle Valo, linux-wireless, linux-kernel On Wed, Jul 17, 2024 at 08:26:22AM +0200, Sascha Hauer wrote: > On Tue, Jul 16, 2024 at 09:48:26PM +0200, Francesco Dolcini wrote: > > On Tue, Jul 16, 2024 at 01:33:27PM +0200, Sascha Hauer wrote: > > > The WPA flags setting only depends on the wpa_versions bitfield and not > > > on the AKM suite, so move it out of the switch/case to simplify the code > > > a bit. No functional change intended. > > > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > > > Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> > > > > > --- > > > drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 27 +++++++------------------- > > > 1 file changed, 7 insertions(+), 20 deletions(-) > > > > > > diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > index 491e366119096..8d0cd84d27698 100644 > > > --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > @@ -46,31 +46,18 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, > > > > > > bss_config->key_mgmt_operation |= KEY_MGMT_ON_HOST; > > > > > > + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1) > > > + bss_config->protocol = PROTOCOL_WPA; > > > + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2) > > > + bss_config->protocol |= PROTOCOL_WPA2; > > > + > > > > I am wondering what happens if NL80211_WPA_VERSION_1 is not set, no idea > > what's the content of bss_config->protocol ... > > > > in any case this is not something that you introduced, but maybe worth > > having a look? > > bss_config is kzalloced in the only caller of mwifiex_set_secure_params(), > so bss_config->protocol is zero on entry. > > It might be worth setting it to zero explicitly here to make the code > better understandable without having to look at the callers. Thanks for looking into this, to me the change is fine as it is, up to you if you want to improve it this way. Francesco ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting 2024-07-17 8:07 ` Francesco Dolcini @ 2024-07-17 8:34 ` Sascha Hauer 0 siblings, 0 replies; 10+ messages in thread From: Sascha Hauer @ 2024-07-17 8:34 UTC (permalink / raw) To: Francesco Dolcini; +Cc: Brian Norris, Kalle Valo, linux-wireless, linux-kernel On Wed, Jul 17, 2024 at 10:07:23AM +0200, Francesco Dolcini wrote: > On Wed, Jul 17, 2024 at 08:26:22AM +0200, Sascha Hauer wrote: > > On Tue, Jul 16, 2024 at 09:48:26PM +0200, Francesco Dolcini wrote: > > > On Tue, Jul 16, 2024 at 01:33:27PM +0200, Sascha Hauer wrote: > > > > The WPA flags setting only depends on the wpa_versions bitfield and not > > > > on the AKM suite, so move it out of the switch/case to simplify the code > > > > a bit. No functional change intended. > > > > > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > > > > > Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> > > > > > > > --- > > > > drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 27 +++++++------------------- > > > > 1 file changed, 7 insertions(+), 20 deletions(-) > > > > > > > > diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > > index 491e366119096..8d0cd84d27698 100644 > > > > --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > > +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > > @@ -46,31 +46,18 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, > > > > > > > > bss_config->key_mgmt_operation |= KEY_MGMT_ON_HOST; > > > > > > > > + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1) > > > > + bss_config->protocol = PROTOCOL_WPA; > > > > + if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2) > > > > + bss_config->protocol |= PROTOCOL_WPA2; > > > > + > > > > > > I am wondering what happens if NL80211_WPA_VERSION_1 is not set, no idea > > > what's the content of bss_config->protocol ... > > > > > > in any case this is not something that you introduced, but maybe worth > > > having a look? > > > > bss_config is kzalloced in the only caller of mwifiex_set_secure_params(), > > so bss_config->protocol is zero on entry. > > > > It might be worth setting it to zero explicitly here to make the code > > better understandable without having to look at the callers. > > Thanks for looking into this, to me the change is fine as it is, up to > you if you want to improve it this way. I just sent a v2 including this change. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] wifi: mwifiex: add support for WPA-PSK-SHA256 2024-07-16 11:33 [PATCH 0/2] mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer 2024-07-16 11:33 ` [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting Sascha Hauer @ 2024-07-16 11:33 ` Sascha Hauer 2024-07-16 19:57 ` Francesco Dolcini 1 sibling, 1 reply; 10+ messages in thread From: Sascha Hauer @ 2024-07-16 11:33 UTC (permalink / raw) To: Brian Norris, Francesco Dolcini, Kalle Valo Cc: linux-wireless, linux-kernel, Sascha Hauer This adds support for the WPA-PSK AKM suite with SHA256 as hashing method (WPA-PSK-SHA256). Tested with a wpa_supplicant provided AP using key_mgmt=WPA-PSK-SHA256. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- drivers/net/wireless/marvell/mwifiex/fw.h | 1 + drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index 3adc447b715f6..1c76754b616ff 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h @@ -415,6 +415,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { #define KEY_MGMT_NONE 0x04 #define KEY_MGMT_PSK 0x02 #define KEY_MGMT_EAP 0x01 +#define KEY_MGMT_PSK_SHA256 0x100 #define CIPHER_TKIP 0x04 #define CIPHER_AES_CCMP 0x08 #define VALID_CIPHER_BITMAP 0x0c diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index 8d0cd84d27698..c07aec67aa0fe 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -59,6 +59,9 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, case WLAN_AKM_SUITE_PSK: bss_config->key_mgmt = KEY_MGMT_PSK; break; + case WLAN_AKM_SUITE_PSK_SHA256: + bss_config->key_mgmt = KEY_MGMT_PSK_SHA256; + break; default: break; } -- 2.39.2 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] wifi: mwifiex: add support for WPA-PSK-SHA256 2024-07-16 11:33 ` [PATCH 2/2] wifi: mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer @ 2024-07-16 19:57 ` Francesco Dolcini 2024-07-17 6:12 ` Sascha Hauer 0 siblings, 1 reply; 10+ messages in thread From: Francesco Dolcini @ 2024-07-16 19:57 UTC (permalink / raw) To: Sascha Hauer Cc: Brian Norris, Francesco Dolcini, Kalle Valo, linux-wireless, linux-kernel Hello Sascha, On Tue, Jul 16, 2024 at 01:33:28PM +0200, Sascha Hauer wrote: > This adds support for the WPA-PSK AKM suite with SHA256 as hashing > method (WPA-PSK-SHA256). Tested with a wpa_supplicant provided AP > using key_mgmt=WPA-PSK-SHA256. Do you have any more details on which chip/firmware you tested? The change looks good, I am just wondering if there are reasons this might create issue on some specific chip/firmware combination. Francesco ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] wifi: mwifiex: add support for WPA-PSK-SHA256 2024-07-16 19:57 ` Francesco Dolcini @ 2024-07-17 6:12 ` Sascha Hauer 2024-07-17 8:10 ` Francesco Dolcini 0 siblings, 1 reply; 10+ messages in thread From: Sascha Hauer @ 2024-07-17 6:12 UTC (permalink / raw) To: Francesco Dolcini; +Cc: Brian Norris, Kalle Valo, linux-wireless, linux-kernel Hi Francesco, On Tue, Jul 16, 2024 at 09:57:31PM +0200, Francesco Dolcini wrote: > Hello Sascha, > > On Tue, Jul 16, 2024 at 01:33:28PM +0200, Sascha Hauer wrote: > > This adds support for the WPA-PSK AKM suite with SHA256 as hashing > > method (WPA-PSK-SHA256). Tested with a wpa_supplicant provided AP > > using key_mgmt=WPA-PSK-SHA256. > > Do you have any more details on which chip/firmware you tested? > The change looks good, I am just wondering if there are reasons this > might create issue on some specific chip/firmware combination. I have a IW416 with firmware 16.92.21.p119. The change itself is derived from the downstream driver. The downstream driver also sets the KEY_MGMT_PSK_SHA256 bit unconditionally for all chip/firmware combinations so I think this change should be ok. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] wifi: mwifiex: add support for WPA-PSK-SHA256 2024-07-17 6:12 ` Sascha Hauer @ 2024-07-17 8:10 ` Francesco Dolcini 0 siblings, 0 replies; 10+ messages in thread From: Francesco Dolcini @ 2024-07-17 8:10 UTC (permalink / raw) To: Sascha Hauer Cc: Francesco Dolcini, Brian Norris, Kalle Valo, linux-wireless, linux-kernel On Wed, Jul 17, 2024 at 08:12:16AM +0200, Sascha Hauer wrote: > On Tue, Jul 16, 2024 at 09:57:31PM +0200, Francesco Dolcini wrote: > > Hello Sascha, > > > > On Tue, Jul 16, 2024 at 01:33:28PM +0200, Sascha Hauer wrote: > > > This adds support for the WPA-PSK AKM suite with SHA256 as hashing > > > method (WPA-PSK-SHA256). Tested with a wpa_supplicant provided AP > > > using key_mgmt=WPA-PSK-SHA256. > > > > Do you have any more details on which chip/firmware you tested? > > The change looks good, I am just wondering if there are reasons this > > might create issue on some specific chip/firmware combination. > > I have a IW416 with firmware 16.92.21.p119. The change itself is derived > from the downstream driver. The downstream driver also sets the > KEY_MGMT_PSK_SHA256 bit unconditionally for all chip/firmware > combinations so I think this change should be ok. Fine for me Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Francesco ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-07-17 8:34 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-07-16 11:33 [PATCH 0/2] mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer 2024-07-16 11:33 ` [PATCH 1/2] wifi: mwifiex: simplify WPA flags setting Sascha Hauer 2024-07-16 19:48 ` Francesco Dolcini 2024-07-17 6:26 ` Sascha Hauer 2024-07-17 8:07 ` Francesco Dolcini 2024-07-17 8:34 ` Sascha Hauer 2024-07-16 11:33 ` [PATCH 2/2] wifi: mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer 2024-07-16 19:57 ` Francesco Dolcini 2024-07-17 6:12 ` Sascha Hauer 2024-07-17 8:10 ` Francesco Dolcini
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox