From a98b1eb99d6bf1fe47d49c33fcdcab7c8709ed7c Mon Sep 17 00:00:00 2001 From: bschmidt Date: Sat, 10 Apr 2010 13:54:00 +0000 Subject: Add WPA-None support: * WPA-None requires ap_scan=2: The major difference between ap_scan=1 (default) and 2 is, that no IEEE80211_IOC_SCAN* ioctls/functions are called, though, there is a dependency on those. For example the call to wpa_driver_bsd_scan() sets the interface UP, this never happens, therefore the interface must be marked up in wpa_driver_bsd_associate(). IEEE80211_IOC_SSID also is not called, which means that the SSID has not been set prior to the IEEE80211_MLME_ASSOC call. * WPA-None has no support for sequence number updates, it doesn't make sense to check for replay violations.. * I had some crashes right after the switch to RUN state, issue is that sc->sc_lastrs was not yet defined. Approved by: rpaulo (mentor) MFC after: 3 weeks --- usr.sbin/wpa/wpa_supplicant/driver_freebsd.c | 13 +++++++++++- usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 | 24 +++++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) (limited to 'usr.sbin/wpa') diff --git a/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c b/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c index ec8ae98..65989c2 100644 --- a/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c +++ b/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c @@ -396,7 +396,7 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params) { struct wpa_driver_bsd_data *drv = priv; struct ieee80211req_mlme mlme; - int privacy; + int flags, privacy; wpa_printf(MSG_DEBUG, "%s: ssid '%.*s' wpa ie len %u pairwise %u group %u key mgmt %u" @@ -408,6 +408,17 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params) , params->key_mgmt_suite ); + /* NB: interface must be marked UP to associate */ + if (getifflags(drv, &flags) != 0) { + wpa_printf(MSG_DEBUG, "%s did not mark interface UP", __func__); + return -1; + } + if ((flags & IFF_UP) == 0 && setifflags(drv, flags | IFF_UP) != 0) { + wpa_printf(MSG_DEBUG, "%s unable to mark interface UP", + __func__); + return -1; + } + /* XXX error handling is wrong but unclear what to do... */ if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0) return -1; diff --git a/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 b/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 index a7a1698..7e25391 100644 --- a/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 +++ b/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2007 +.Dd April 10, 2010 .Dt WPA_SUPPLICANT.CONF 5 .Os .Sh NAME @@ -153,7 +153,27 @@ Note that IBSS (adhoc) mode can only be used with .Va key_mgmt set to .Li NONE -(plaintext and static WEP). +(plaintext and static WEP), or +.Va key_mgmt +set to +.Li WPA-NONE +(fixed group key TKIP/CCMP). +In addition, +.Va ap_scan +has to be set to 2 for IBSS. +.Li WPA-NONE +requires +.Va proto +set to WPA, +.Va key_mgmt +set to WPA-NONE, +.Va pairwise +set to NONE, +.Va group +set to either +CCMP or TKIP (but not both), and +.Va psk +must also be set. .It Va proto List of acceptable protocols; one or more of: .Li WPA -- cgit v1.1