* [PATCH 1/3] ath6kl: Add support for configuring SMS4 keys
2011-11-03 9:39 [PATCH 0/3] ath6kl: Add support for WAPI configuration Jouni Malinen
@ 2011-11-03 9:39 ` Jouni Malinen
2011-11-03 9:39 ` [PATCH 2/3] ath6kl: Allow SMS4 to be configured in AP mode Jouni Malinen
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jouni Malinen @ 2011-11-03 9:39 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Dai Shuibing, Jouni Malinen
From: Dai Shuibing <shuibing@qca.qualcomm.com>
Indicate support for WPI-SMS4 cipher and allow SMS4 keys to be
configured.
Signed-off-by: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 18 ++++++++++++++++--
drivers/net/wireless/ath/ath6kl/common.h | 1 +
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 04d24d4..42eeed1 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -203,6 +203,10 @@ static int ath6kl_set_cipher(struct ath6kl_vif *vif, u32 cipher, bool ucast)
*ar_cipher = AES_CRYPT;
*ar_cipher_len = 0;
break;
+ case WLAN_CIPHER_SUITE_SMS4:
+ *ar_cipher = WAPI_CRYPT;
+ *ar_cipher_len = 0;
+ break;
default:
ath6kl_err("cipher 0x%x not supported\n", cipher);
return -ENOTSUPP;
@@ -935,13 +939,19 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
key_usage = GROUP_USAGE;
if (params) {
+ int seq_len = params->seq_len;
+ if (params->cipher == WLAN_CIPHER_SUITE_SMS4 &&
+ seq_len > ATH6KL_KEY_SEQ_LEN) {
+ /* Only first half of the WPI PN is configured */
+ seq_len = ATH6KL_KEY_SEQ_LEN;
+ }
if (params->key_len > WLAN_MAX_KEY_LEN ||
- params->seq_len > sizeof(key->seq))
+ seq_len > sizeof(key->seq))
return -EINVAL;
key->key_len = params->key_len;
memcpy(key->key, params->key, key->key_len);
- key->seq_len = params->seq_len;
+ key->seq_len = seq_len;
memcpy(key->seq, params->seq, key->seq_len);
key->cipher = params->cipher;
}
@@ -959,6 +969,9 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
case WLAN_CIPHER_SUITE_CCMP:
key_type = AES_CRYPT;
break;
+ case WLAN_CIPHER_SUITE_SMS4:
+ key_type = WAPI_CRYPT;
+ break;
default:
return -ENOTSUPP;
@@ -1451,6 +1464,7 @@ static const u32 cipher_suites[] = {
WLAN_CIPHER_SUITE_TKIP,
WLAN_CIPHER_SUITE_CCMP,
CCKM_KRK_CIPHER_SUITE,
+ WLAN_CIPHER_SUITE_SMS4,
};
static bool is_rate_legacy(s32 rate)
diff --git a/drivers/net/wireless/ath/ath6kl/common.h b/drivers/net/wireless/ath/ath6kl/common.h
index 41e465f..bfd6597 100644
--- a/drivers/net/wireless/ath/ath6kl/common.h
+++ b/drivers/net/wireless/ath/ath6kl/common.h
@@ -71,6 +71,7 @@ enum crypto_type {
WEP_CRYPT = 0x02,
TKIP_CRYPT = 0x04,
AES_CRYPT = 0x08,
+ WAPI_CRYPT = 0x10,
};
struct htc_endpoint_credit_dist;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/3] ath6kl: Allow SMS4 to be configured in AP mode
2011-11-03 9:39 [PATCH 0/3] ath6kl: Add support for WAPI configuration Jouni Malinen
2011-11-03 9:39 ` [PATCH 1/3] ath6kl: Add support for configuring SMS4 keys Jouni Malinen
@ 2011-11-03 9:39 ` Jouni Malinen
2011-11-03 9:39 ` [PATCH 3/3] ath6kl: Indicate WAPI IE from (Re)Association Request frame Jouni Malinen
2011-11-13 9:04 ` [PATCH 0/3] ath6kl: Add support for WAPI configuration Kalle Valo
3 siblings, 0 replies; 5+ messages in thread
From: Jouni Malinen @ 2011-11-03 9:39 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Dai Shuibing, Jouni Malinen
From: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 42eeed1..095a378 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1923,6 +1923,9 @@ static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev,
case WLAN_CIPHER_SUITE_CCMP:
p.prwise_crypto_type |= AES_CRYPT;
break;
+ case WLAN_CIPHER_SUITE_SMS4:
+ p.prwise_crypto_type |= WAPI_CRYPT;
+ break;
}
}
if (p.prwise_crypto_type == 0) {
@@ -1942,6 +1945,9 @@ static int ath6kl_ap_beacon(struct wiphy *wiphy, struct net_device *dev,
case WLAN_CIPHER_SUITE_CCMP:
p.grp_crypto_type = AES_CRYPT;
break;
+ case WLAN_CIPHER_SUITE_SMS4:
+ p.grp_crypto_type = WAPI_CRYPT;
+ break;
default:
p.grp_crypto_type = NONE_CRYPT;
break;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/3] ath6kl: Indicate WAPI IE from (Re)Association Request frame
2011-11-03 9:39 [PATCH 0/3] ath6kl: Add support for WAPI configuration Jouni Malinen
2011-11-03 9:39 ` [PATCH 1/3] ath6kl: Add support for configuring SMS4 keys Jouni Malinen
2011-11-03 9:39 ` [PATCH 2/3] ath6kl: Allow SMS4 to be configured in AP mode Jouni Malinen
@ 2011-11-03 9:39 ` Jouni Malinen
2011-11-13 9:04 ` [PATCH 0/3] ath6kl: Add support for WAPI configuration Kalle Valo
3 siblings, 0 replies; 5+ messages in thread
From: Jouni Malinen @ 2011-11-03 9:39 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Dai Shuibing, Jouni Malinen
From: Dai Shuibing <shuibing@qca.qualcomm.com>
This is needed to know whether the STA requests WAPI to be used and if
so, with what AKM and cipher.
Signed-off-by: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/main.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index a800837..559539b 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -534,6 +534,18 @@ void ath6kl_connect_ap_mode_sta(struct ath6kl_vif *vif, u16 aid, u8 *mac_addr,
wpa_ie = pos; /* WPS IE */
break; /* overrides WPA/RSN IE */
}
+ } else if (pos[0] == 0x44 && wpa_ie == NULL) {
+ /*
+ * Note: WAPI Parameter Set IE re-uses Element ID that
+ * was officially allocated for BSS AC Access Delay. As
+ * such, we need to be a bit more careful on when
+ * parsing the frame. However, BSS AC Access Delay
+ * element is not supposed to be included in
+ * (Re)Association Request frames, so this should not
+ * cause problems.
+ */
+ wpa_ie = pos; /* WAPI IE */
+ break;
}
pos += 2 + pos[1];
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 0/3] ath6kl: Add support for WAPI configuration
2011-11-03 9:39 [PATCH 0/3] ath6kl: Add support for WAPI configuration Jouni Malinen
` (2 preceding siblings ...)
2011-11-03 9:39 ` [PATCH 3/3] ath6kl: Indicate WAPI IE from (Re)Association Request frame Jouni Malinen
@ 2011-11-13 9:04 ` Kalle Valo
3 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2011-11-13 9:04 UTC (permalink / raw)
To: Jouni Malinen; +Cc: linux-wireless
On 11/03/2011 11:39 AM, Jouni Malinen wrote:
> This set of patches extends ath6kl to allow station and AP mode WAPI
> support to be enabled. Please note that these depend on earlier patches
> that are not yet in wireless-testing.git:
>
> ieee80211: Define cipher suite selector for WPI-SMS4
> nl80211: Increase maximum NL80211_ATTR_KEY_SEQ length to 16
>
> In addition, the three patches I sent yesterday for ath6kl should be
> applied first:
>
> ath6kl: Remove unused WMI crypto defines
> ath6kl: Fix key configuration to copy at most seq_len from seq
> ath6kl: Do not hide ath6kl_wmi_addkey_cmd() error values
Thanks, all three applied.
Kalle
^ permalink raw reply [flat|nested] 5+ messages in thread