aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.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 /net/wireless/core.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 'net/wireless/core.h')
-rw-r--r--net/wireless/core.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h
index e46cd6eb61d7..2ec8ddbe57de 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -238,6 +238,12 @@ struct cfg80211_event {
238 }; 238 };
239}; 239};
240 240
241struct cfg80211_cached_keys {
242 struct key_params params[6];
243 u8 data[6][WLAN_MAX_KEY_LEN];
244 int def, defmgmt;
245};
246
241 247
242/* free object */ 248/* free object */
243extern void cfg80211_dev_free(struct cfg80211_registered_device *rdev); 249extern void cfg80211_dev_free(struct cfg80211_registered_device *rdev);
@@ -256,14 +262,18 @@ void cfg80211_bss_age(struct cfg80211_registered_device *dev,
256/* IBSS */ 262/* IBSS */
257int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev, 263int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
258 struct net_device *dev, 264 struct net_device *dev,
259 struct cfg80211_ibss_params *params); 265 struct cfg80211_ibss_params *params,
266 struct cfg80211_cached_keys *connkeys);
260int cfg80211_join_ibss(struct cfg80211_registered_device *rdev, 267int cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
261 struct net_device *dev, 268 struct net_device *dev,
262 struct cfg80211_ibss_params *params); 269 struct cfg80211_ibss_params *params,
270 struct cfg80211_cached_keys *connkeys);
263void cfg80211_clear_ibss(struct net_device *dev, bool nowext); 271void cfg80211_clear_ibss(struct net_device *dev, bool nowext);
264int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev, 272int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
265 struct net_device *dev, bool nowext); 273 struct net_device *dev, bool nowext);
266void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid); 274void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid);
275int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
276 struct wireless_dev *wdev);
267 277
268/* MLME */ 278/* MLME */
269int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, 279int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
@@ -272,12 +282,14 @@ int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
272 enum nl80211_auth_type auth_type, 282 enum nl80211_auth_type auth_type,
273 const u8 *bssid, 283 const u8 *bssid,
274 const u8 *ssid, int ssid_len, 284 const u8 *ssid, int ssid_len,
275 const u8 *ie, int ie_len); 285 const u8 *ie, int ie_len,
286 const u8 *key, int key_len, int key_idx);
276int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, 287int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
277 struct net_device *dev, struct ieee80211_channel *chan, 288 struct net_device *dev, struct ieee80211_channel *chan,
278 enum nl80211_auth_type auth_type, const u8 *bssid, 289 enum nl80211_auth_type auth_type, const u8 *bssid,
279 const u8 *ssid, int ssid_len, 290 const u8 *ssid, int ssid_len,
280 const u8 *ie, int ie_len); 291 const u8 *ie, int ie_len,
292 const u8 *key, int key_len, int key_idx);
281int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev, 293int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
282 struct net_device *dev, 294 struct net_device *dev,
283 struct ieee80211_channel *chan, 295 struct ieee80211_channel *chan,
@@ -310,10 +322,12 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
310/* SME */ 322/* SME */
311int __cfg80211_connect(struct cfg80211_registered_device *rdev, 323int __cfg80211_connect(struct cfg80211_registered_device *rdev,
312 struct net_device *dev, 324 struct net_device *dev,
313 struct cfg80211_connect_params *connect); 325 struct cfg80211_connect_params *connect,
326 struct cfg80211_cached_keys *connkeys);
314int cfg80211_connect(struct cfg80211_registered_device *rdev, 327int cfg80211_connect(struct cfg80211_registered_device *rdev,
315 struct net_device *dev, 328 struct net_device *dev,
316 struct cfg80211_connect_params *connect); 329 struct cfg80211_connect_params *connect,
330 struct cfg80211_cached_keys *connkeys);
317int __cfg80211_disconnect(struct cfg80211_registered_device *rdev, 331int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
318 struct net_device *dev, u16 reason, 332 struct net_device *dev, u16 reason,
319 bool wextev); 333 bool wextev);
@@ -323,11 +337,14 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
323void __cfg80211_roamed(struct wireless_dev *wdev, const u8 *bssid, 337void __cfg80211_roamed(struct wireless_dev *wdev, const u8 *bssid,
324 const u8 *req_ie, size_t req_ie_len, 338 const u8 *req_ie, size_t req_ie_len,
325 const u8 *resp_ie, size_t resp_ie_len); 339 const u8 *resp_ie, size_t resp_ie_len);
340int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
341 struct wireless_dev *wdev);
326 342
327void cfg80211_conn_work(struct work_struct *work); 343void cfg80211_conn_work(struct work_struct *work);
328 344
329/* internal helpers */ 345/* internal helpers */
330int cfg80211_validate_key_settings(struct key_params *params, int key_idx, 346int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
347 struct key_params *params, int key_idx,
331 const u8 *mac_addr); 348 const u8 *mac_addr);
332void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, 349void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
333 size_t ie_len, u16 reason, bool from_ap); 350 size_t ie_len, u16 reason, bool from_ap);
@@ -335,5 +352,6 @@ void cfg80211_sme_scan_done(struct net_device *dev);
335void cfg80211_sme_rx_auth(struct net_device *dev, const u8 *buf, size_t len); 352void cfg80211_sme_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
336void cfg80211_sme_disassoc(struct net_device *dev, int idx); 353void cfg80211_sme_disassoc(struct net_device *dev, int idx);
337void __cfg80211_scan_done(struct work_struct *wk); 354void __cfg80211_scan_done(struct work_struct *wk);
355void cfg80211_upload_connect_keys(struct wireless_dev *wdev);
338 356
339#endif /* __NET_WIRELESS_CORE_H */ 357#endif /* __NET_WIRELESS_CORE_H */