aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/cfg80211.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-08 08:22:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:09 -0400
commitfffd0934b9390f34bec45762192b7edd3b12b4b5 (patch)
treed9779803763261f5795fe39a402d79c4220a3a22 /include/net/cfg80211.h
parentb9454e83cac42fcdc90bfbfba479132bd6629455 (diff)
cfg80211: rework key operation
This reworks the key operation in cfg80211, and now only allows, from userspace, configuring keys (via nl80211) after the connection has been established (in managed mode), the IBSS been joined (in IBSS mode), at any time (in AP[_VLAN] modes) or never for all the other modes. In order to do shared key authentication correctly, it is now possible to give a WEP key to the AUTH command. To configure static WEP keys, these are given to the CONNECT or IBSS_JOIN command directly, for a userspace SME it is assumed it will configure it properly after the connection has been established. Since mac80211 used to check the default key in IBSS mode to see whether or not the network is protected, it needs an update in that area, as well as an update to make use of the WEP key passed to auth() for shared key authentication. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r--include/net/cfg80211.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 83c2c727d71e..65a5cbcb5d14 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -647,12 +647,17 @@ struct cfg80211_crypto_settings {
647 * @auth_type: Authentication type (algorithm) 647 * @auth_type: Authentication type (algorithm)
648 * @ie: Extra IEs to add to Authentication frame or %NULL 648 * @ie: Extra IEs to add to Authentication frame or %NULL
649 * @ie_len: Length of ie buffer in octets 649 * @ie_len: Length of ie buffer in octets
650 * @key_len: length of WEP key for shared key authentication
651 * @key_idx: index of WEP key for shared key authentication
652 * @key: WEP key for shared key authentication
650 */ 653 */
651struct cfg80211_auth_request { 654struct cfg80211_auth_request {
652 struct cfg80211_bss *bss; 655 struct cfg80211_bss *bss;
653 const u8 *ie; 656 const u8 *ie;
654 size_t ie_len; 657 size_t ie_len;
655 enum nl80211_auth_type auth_type; 658 enum nl80211_auth_type auth_type;
659 const u8 *key;
660 u8 key_len, key_idx;
656}; 661};
657 662
658/** 663/**
@@ -727,6 +732,8 @@ struct cfg80211_disassoc_request {
727 * @ie: information element(s) to include in the beacon 732 * @ie: information element(s) to include in the beacon
728 * @ie_len: length of that 733 * @ie_len: length of that
729 * @beacon_interval: beacon interval to use 734 * @beacon_interval: beacon interval to use
735 * @privacy: this is a protected network, keys will be configured
736 * after joining
730 */ 737 */
731struct cfg80211_ibss_params { 738struct cfg80211_ibss_params {
732 u8 *ssid; 739 u8 *ssid;
@@ -736,6 +743,7 @@ struct cfg80211_ibss_params {
736 u8 ssid_len, ie_len; 743 u8 ssid_len, ie_len;
737 u16 beacon_interval; 744 u16 beacon_interval;
738 bool channel_fixed; 745 bool channel_fixed;
746 bool privacy;
739}; 747};
740 748
741/** 749/**
@@ -755,6 +763,9 @@ struct cfg80211_ibss_params {
755 * @assoc_ie_len: Length of assoc_ie in octets 763 * @assoc_ie_len: Length of assoc_ie in octets
756 * @privacy: indicates whether privacy-enabled APs should be used 764 * @privacy: indicates whether privacy-enabled APs should be used
757 * @crypto: crypto settings 765 * @crypto: crypto settings
766 * @key_len: length of WEP key for shared key authentication
767 * @key_idx: index of WEP key for shared key authentication
768 * @key: WEP key for shared key authentication
758 */ 769 */
759struct cfg80211_connect_params { 770struct cfg80211_connect_params {
760 struct ieee80211_channel *channel; 771 struct ieee80211_channel *channel;
@@ -766,6 +777,8 @@ struct cfg80211_connect_params {
766 size_t ie_len; 777 size_t ie_len;
767 bool privacy; 778 bool privacy;
768 struct cfg80211_crypto_settings crypto; 779 struct cfg80211_crypto_settings crypto;
780 const u8 *key;
781 u8 key_len, key_idx;
769}; 782};
770 783
771/** 784/**
@@ -1223,9 +1236,10 @@ extern void wiphy_unregister(struct wiphy *wiphy);
1223 */ 1236 */
1224extern void wiphy_free(struct wiphy *wiphy); 1237extern void wiphy_free(struct wiphy *wiphy);
1225 1238
1226/* internal struct */ 1239/* internal structs */
1227struct cfg80211_conn; 1240struct cfg80211_conn;
1228struct cfg80211_internal_bss; 1241struct cfg80211_internal_bss;
1242struct cfg80211_cached_keys;
1229 1243
1230#define MAX_AUTH_BSSES 4 1244#define MAX_AUTH_BSSES 4
1231 1245
@@ -1267,6 +1281,7 @@ struct wireless_dev {
1267 CFG80211_SME_CONNECTED, 1281 CFG80211_SME_CONNECTED,
1268 } sme_state; 1282 } sme_state;
1269 struct cfg80211_conn *conn; 1283 struct cfg80211_conn *conn;
1284 struct cfg80211_cached_keys *connect_keys;
1270 1285
1271 struct list_head event_list; 1286 struct list_head event_list;
1272 spinlock_t event_lock; 1287 spinlock_t event_lock;
@@ -1280,6 +1295,7 @@ struct wireless_dev {
1280 struct { 1295 struct {
1281 struct cfg80211_ibss_params ibss; 1296 struct cfg80211_ibss_params ibss;
1282 struct cfg80211_connect_params connect; 1297 struct cfg80211_connect_params connect;
1298 struct cfg80211_cached_keys *keys;
1283 u8 *ie; 1299 u8 *ie;
1284 size_t ie_len; 1300 size_t ie_len;
1285 u8 bssid[ETH_ALEN]; 1301 u8 bssid[ETH_ALEN];