Commit graph

560 commits

Author SHA1 Message Date
Jouni Malinen a486c0c72a IBSS RSN: Add more verbose debug info for key setup 2009-12-04 22:55:28 +02:00
Jouni Malinen 9c972abb66 IBSS RSN: Wait for connection event and do not use auth timeout
Wait for connection (IBSS join completed) event before marking state
completed. In addition, do not use the station mode authentication
timeout since that can trigger full disconnection from IBSS when
there is a timeout with just one of the peers.
2009-12-04 22:09:06 +02:00
Jouni Malinen 0e379654b0 SME: Do not process disassoc frame unless SME is used
This avoids an infinite loop with driver_test.c when using IBSS.
2009-12-04 21:44:13 +02:00
Jouni Malinen 3680a5dbbf Fix build with both CONFIG_AP=y and CONFIG_IBSS_RSN=y enabled 2009-12-04 21:34:34 +02:00
Jouni Malinen 5cc4d64bf2 nl80211: Add support for IBSS networks 2009-12-04 00:15:32 +02:00
Witold Sowa 85d3f273df dbus: switch dbus APIs initialization order
Initialize the new DBus API before the old one, so new applications
which can use both, the old and the new API will be notified first
that new API is available.
2009-12-03 21:17:49 +02:00
Witold Sowa a5717c957c dbus: Enable -u option when only the new DBus API is included 2009-12-03 21:12:42 +02:00
Jouni Malinen 3dee308178 Fix wpa_priv compilation after driver_ops changes 2009-12-03 21:03:58 +02:00
Dmitry Shmidt 4e2225a520 Fix wpa_priv memory leak in wpa_priv_get_scan_results2()
I suspect that new scan results format demands more complex free
procedure.
2009-12-03 20:59:27 +02:00
Jouni Malinen a84ed99ee4 SME: Deauthenticate to clear state after disassociation events
cfg80211/mac80211 can get into somewhat confused state if the AP only
disassociates us and leaves us in authenticated state. For now, force
the state to be cleared with deauthentication to avoid confusing errors
if we try to associate with the AP again. This gets rid of 30 second
delay (scan timeout) in cases where only a disassociation frame is
received from the AP.
2009-12-02 17:26:28 +02:00
Jouni Malinen d8222ae38c Fix driver initialization not to crash if driver does not use init2()
8a5ab9f5e5 fixed global driver context
for init2(), but it also broke driver initialization with driver
wrappers that do not use init2().. Fix this by setting wpa_s->global
before it gets dereferenced.
2009-12-02 16:43:09 +02:00
Jouni Malinen 03da66bd59 Remove src/crypto from default include path
In addition, start ordering header file includes to be in more
consistent order: system header files, src/utils, src/*, same
directory as the *.c file.
2009-11-29 23:04:43 +02:00
Jouni Malinen 281c950be4 Move EAPOL authenticator state machine into src/eapol_auth
This is now completely independent from hostapd-specific code, so
it can be moved to be under the src tree.
2009-11-29 20:03:28 +02:00
Jouni Malinen ea038e0da4 Fix IBSS RSN build 2009-11-29 18:31:16 +02:00
Jouni Malinen 3acb50056c Remove src/rsn_supp from default header path 2009-11-29 18:28:08 +02:00
Jouni Malinen 90973fb2fd Remove src/common from default header file path
This makes it clearer which files are including header from src/common.
Some of these cases should probably be cleaned up in the future not to
do that.

In addition, src/common/nl80211_copy.h and wireless_copy.h were moved
into src/drivers since they are only used by driver wrappers and do not
need to live in src/common.
2009-11-29 17:51:55 +02:00
Jouni Malinen 6ae9318536 Split scan processing for RSN preauthentication into parts
This avoids passing the raw scan results into the RSN code and by
doing so, removes the only dependency on src/drivers from the
src/rsn_supp code (or from any src subdirectory for that matter).
2009-11-29 17:06:03 +02:00
Jouni Malinen 41fa8a892f Remove old wpa_supplicant/hostapd doxygen files 2009-11-28 21:24:15 +02:00
Jouni Malinen 8a5ab9f5e5 Fix init2() driver_ops to get the correct global driver context
Need to provide the private driver context, not the wpa_supplicant
global context, in init2() call.
2009-11-28 18:11:16 +02:00
Jouni Malinen ed45947e9b WPS: Update couple of missed Primary Device Type uses 2009-11-26 11:54:37 +02:00
Jouni Malinen 96750ea5e5 WPS: Clean up Primary Device Type handling
Use shared functions for converting Primary Device Type between binary
and string formats. In addition, use array of eight octets instead of a
specific structure with multiple fields to reduce code complexity.
2009-11-26 11:39:29 +02:00
Jouni Malinen 73d0ad78c8 Fix internal crypto build with some configurations
crypto_internal.c requires both aes-internal-enc.o and
aes-internal-dec.o, so make sure they get included in the build when
using internal crypto.
2009-11-24 10:24:54 +02:00
Jouni Malinen ec8d20187d Remove obsoleted get_scan_results() driver_ops
This has now been replaced with get_scan_results2() in every
in-tree driver.
2009-11-23 21:33:37 +02:00
Jouni Malinen c2e8d0a092 Remove deprecated scan and set_probe_req_ie driver_ops
These have been replaced with scan2 driver_ops that provides all
parameters in a single call.
2009-11-23 21:13:46 +02:00
Jouni Malinen 4a867032ae Remove deprecated driver_ops handlers
This gets rid of previously deprecated driver_ops handlers set_wpa,
set_drop_unencrypted, set_auth_alg, set_mode. The same functionality
can be achieved by using the init/deinit/associate handlers.
2009-11-23 20:22:38 +02:00
Jouni Malinen 331c12086f Fix CONFIG_AP=y build after driver_ops set_key merge 2009-11-23 17:15:45 +02:00
Jouni Malinen e90bba4c59 Add cleared deprecation notes on iwl,ndiswrapper,madwifi(sta) wrappers
These driver wrappers should not be used anymore; WEXT should be used
instead. However, there may still be users stuck on older kernel versions
that may require driver specific wrappers, so the source code still
remains in the repository.
2009-11-23 17:08:59 +02:00
Jouni Malinen 642187d6bf Merge set_key and hapd_set_key driver_ops into a single function 2009-11-23 16:58:32 +02:00
Jouni Malinen d994a9b54e Move definitions away from hostapd_defs.h
Clean up definitions to reduce need to include header files from the
hostapd directory into files under the src subdirectories.
2009-11-23 16:14:39 +02:00
Jouni Malinen 5d67487244 Merge set_beacon driver_ops into a single one
Clean up driver interface by merging hostapd and wpa_supplicant
specific set_beacon driver_ops into a single one. In addition,
merge set_beacon_int into to the same operation.
2009-11-23 15:26:05 +02:00
Jouni Malinen 224f7bda79 Preparations for v0.7.0 release 2009-11-21 22:49:02 +02:00
Jouni Malinen 247500cab7 Fix Visual Studio projects to match with source code file changes 2009-11-21 21:56:31 +02:00
Jouni Malinen 56360b16dc Update ChangeLog files for 0.7.0 release 2009-11-21 21:53:51 +02:00
Jouni Malinen 19019a84a2 wpa_gui: Only move to WPS tab if inactive/disconnect and AP ready
This removes many of the cases where moving to the WPS tab can be
undesired. It is really only useful if we are not currently connected
and there is an AP available that would likely be able to provide us
network connectivity with use of WPS (active PBC more or selected
registrar set).
2009-11-21 20:52:55 +02:00
Jouni Malinen d914f78880 wpa_gui: Add peers menu option for learning AP configuration (ER) 2009-11-21 18:26:21 +02:00
Jouni Malinen ec72bd0c77 WPS ER: Move SSDP functionality into a separate file 2009-11-21 17:26:23 +02:00
Jouni Malinen d6211fbb2e wpa_gui: Add peer dialog option for WPS PBC
Use advertised configuration methods to determine whether WPS PBC
and/or PIN methods should be allowed.
2009-11-21 17:06:41 +02:00
Jouni Malinen 175bba7986 wpa_gui: Add WPS config methods and device password ID into peer data 2009-11-21 16:47:48 +02:00
Jouni Malinen 9c6c0cb0aa wpa_gui: Move peer tooltip into Properties dialog
Clean up the peer dialog information to be more user friendly. Only
show the device type in the tooltip and move the verbose details into
a separate area in a new Properties dialog. The new dialog will also
show some of the standard fields with titles to make them easier to
read.
2009-11-21 15:01:23 +02:00
Jouni Malinen e694b34474 WPS ER: Add more AP information into the ctrl_interface message
This allow wpa_gui to show AP BSSID, WPS State (configured/unconfigured),
and primary device type.
2009-11-21 13:34:23 +02:00
Jouni Malinen b3f371cabf WPS ER: Refresh ER data on WPS_ER_START when already started
This sends out the AP and Enrollee notifications for all tracked
devices and generates a new SSDP search to find more APs.
2009-11-20 21:57:30 +02:00
Jouni Malinen a3c6598fcd Add 'none' driver as an option for wpa_supplicant
This can be used, e.g., with WPS ER when no network interface is
actually used for IEEE 802.1X or wireless operations.
2009-11-20 21:12:49 +02:00
Jouni Malinen da87d6f8b5 wpa_gui: Avoid using freed item in enter_pin()
The Enrollee entry may be deleted while the PIN query dialog is open.
To avoid crashing on using freed entry, copy the needed data into
local variables before and use the local data after the PIN dialog
has been closed.
2009-11-19 21:12:06 +02:00
Jouni Malinen 1949f53481 wpa_gui: Add AP and laptop icons for peer dialog
The peer entries are now using different icons based on their type. As
a starting point, a separate AP and laptop icons are used. More icons may
be added in the future to mark different device types (e.g., based on
primary device type information from WPS).
2009-11-19 21:03:25 +02:00
Mike Shepherd 720e23b2ae wpa_gui: Add support for multiple icon files 2009-11-19 20:49:51 +02:00
Jouni Malinen 8f089e7ff8 wpa_gui: Add preliminary WPS ER support into the peers dialog 2009-11-19 20:28:41 +02:00
Jouni Malinen 62fa124ce2 nl80211/SME: Use reassociation when roaming within the ESS 2009-11-17 19:25:05 +02:00
Anders Aspegren Søndergaard 3fd2a226f9 wpa_supplicant: Fix ctrl_interface group permissions to allow read/execute
When using umask 0077, the control interface directory was left without
group read/execute permissions even if the configuration file explicitly
asked for the group to be allowed to access the control interface. Fix
this by adding read/execute permissions for group if a specific group is
defined in the configuration. [Bug 199]
2009-11-16 16:43:25 +02:00
Witold Sowa bd4ce06629 dbus: Allow only root to receive signals
Change the dbus policy file to only allow root applications to receive
signals from wpa_supplicant. This keeps WPS Credentials data secret
from non-root listeners.
2009-11-16 13:25:51 +02:00
Christian Rüb 1545457e04 wpa_gui-qt4: Fix build with Session Manager disabled in Qt4
When trying to build wpa_gui (Qt4 version) from openembedded it fails
because Qt4 is compiled without session manager and thus wpa_gui fails
to compile.

I attached a patch, that enables compiling without Session Manager (via
preprocessor) if it is not compiled into Qt4; otherwise, it behaves as
it does right now.

I checked to build on my host (Debian unstable, Session Manager
enabled) and openembedded (Session Manager disabled).
2009-11-16 13:20:53 +02:00
Jouni Malinen a6b6307853 WPS ER: Deinit ER before WPS registrar/context
ER code may still touch WPS registrar/context during deinit, so better
do that before freeing the other WPS components.
2009-11-15 22:52:17 +02:00
Jouni Malinen e64dcfd54b WPS ER: Add command for fetching current AP settings 2009-11-15 22:27:06 +02:00
Jouni Malinen 564cd7fa2c WPS ER: Add preliminary PBC support
This will need some additional code in wps_er_pbc() to handle PBC mode
enabling for a single AP only. For now, this can only be expected to work
when the ER is connected to a single AP.
2009-11-15 18:46:03 +02:00
Jouni Malinen b78bc3a37e WPS ER: Add ctrl_iface notifications for AP/Enrollee add/remove 2009-11-15 12:07:27 +02:00
Jouni Malinen 9b61515c26 dbus: Use method/property/signal handler arrays for registration
Clean up registration of large number of dbus method/property/signal
handlers by using arrays containing all the information needed to call
the registration functions.
2009-11-14 18:18:07 +02:00
Jouni Malinen 485ec2ae48 dbus: Remove duplicated error printing from registration
wpa_dbus_{method,property,signal}_register() are now taking care of
error printing, so no need to duplicate the same code everywhere.
2009-11-14 17:06:16 +02:00
Jouni Malinen 7ae7b192f9 dbus: Split wpas_dbus_ctrl_iface_init() into helper functions
Clean up the method/property/signal registration code by using short
helper functions with the argument table near the registration call.
2009-11-14 16:57:07 +02:00
Jouni Malinen 3864e6ea83 dbus: Minor coding style cleanup 2009-11-14 16:02:01 +02:00
Jouni Malinen 17efbfac21 dbus: Fix some of the function comment typos 2009-11-14 15:57:02 +02:00
Jouni Malinen 72df2f5fc6 WPS ER: Add PIN configuration and SetSelectedRegistrar call
New PINs can now be added to WPS ER. This results in the ER code
using SetSelectedRegistrar to modify AP state so that Enrollees
will be able to notice the actice registrar more easily.
2009-11-13 22:07:11 +02:00
Jouni Malinen 4bb4ae0ae0 Remove a note about other repositories of wpa_supplicant 2009-11-11 17:56:21 +02:00
David Smith d7199342f0 Reset EAPOL pointer when handling DBus smartcard parameters
Smartcard parameter update via DBus ended up re-initializing the EAPOL
state machine without updating the pointer inside WPA state machine.
This can trigger a segfault when EAP layer attempts to use the old
reference. Fix this by re-initializing the pointer inside WPA state
machine.
2009-11-11 17:46:15 +02:00
Witold Sowa 3d3d305645 Add dbus mechanism for fetching all network configuration parameters 2009-11-11 17:17:00 +02:00
Witold Sowa 71f6e1f697 Add notifications for scan result BSS changes (added/removed)
If scan results introduce new BSSs or discards some previously known,
new wpas_notify_bss_added or wpas_notify_bss_removed notifications are
called.
2009-11-11 17:07:53 +02:00
Jouni Malinen 68e7cb49b4 dbus: Use snprintf() and bounds checking instead of strcat()
Better make sure we do not end up writing over the end of the local
registered_sig buffer regardless of how many arguments are used in
dbus method description.
2009-11-10 18:29:38 +02:00
Jouni Malinen d69780dcbb dbus: Do not dereference wpa_s if explicitly checking it is not NULL
There is no point checking whether wpa_s is not NULL after having
dereferenced it earlier in the function.. Furthermore, there is no
need to use a local variable for wpas_dbus_get_path() result.
2009-11-10 18:20:12 +02:00
Jouni Malinen 0cf7d7450a dbus: Remove unnecessary wpa_s->bssid comparison
This is an array and cannot have NULL value.
2009-11-10 18:11:18 +02:00
Jouni Malinen 4f93ab0ffc dbus: Fix a NULL pointer dereference on error path
The cleanup routine in the end would have dereferenced props pointer
which could be NULL. There is no need to go through that cleanup code
in this case, so just exit from the function with return instead.
2009-11-10 18:08:55 +02:00
Jouni Malinen a1641d2671 Call wpas_notify_network_selected only if a specific network was selected
ssid could be NULL here at least based on the function documentation,
so better check whether that is the case prior to calling the
notification function.
2009-11-10 18:06:02 +02:00
Jouni Malinen 5be45e2e6e Fix per-SSID scan (scan_ssid=1)
Commit d3a9822542 broke per-SSID scan
by using the ssid variable for internal loop and by doing so,
overriding the value that was needed below to figure out whether the
scan is for a specific SSID. Fix this by using a temporary variable
instead when looping over network finding which frequencies to scan for.
2009-11-10 18:00:57 +02:00
Jouni Malinen 5228401cbc dbus: Coding style cleanup 2009-11-10 17:51:59 +02:00
Jouni Malinen ea20a1ad03 dbus: Remove unneeded typecast
This was triggering some gcc versions to warn about strict aliasing.
Since the typecast is not really needed here, the cleanest way to get
rid of the warnings is to just use the correct type for the local
variable.
2009-11-10 16:48:21 +02:00
Jouni Malinen 69856fadf7 Add wpa_msg_ctrl() for ctrl_interface-only messages
This is like wpa_msg(), but the output is directed only to
ctrl_interface listeners. In other words, the output will not be
shown on stdout or in syslog.

Change scan result reporting to use wpa_msg_ctrl() for
CTRL-EVENT-SCAN-RESULTS message at info level and wpa_printf() at
debug level to avoid showing scan result events in syslog in the
common configuration used with NetworkManager.
2009-11-10 15:59:41 +02:00
Jouni Malinen b99b8e1516 Fix non-WPS build 2009-11-10 11:35:25 +02:00
Jouni Malinen d3a42e1240 WPS: Fix WPS build with ER support disabled 2009-11-10 11:09:52 +02:00
Witold Sowa 8fc2fb56e4 wpa_supplicant: new DBus API implementation
This patch implements the new DBus API. Both, the new and the
previous API may work concurrently and may be turned on or off
separately in .config file.
Some features of the new API are:
 - more wpa_supplicant's events are signaled with DBus signals,
 - introspection data (requires libxml2 and may be disabled),
 - CurrentBSS and CurrentNetwork properties,
 - PropertyChanged signal for most of properties,
 - Relatively easy to extend.
.config options for the new API are: CONFIG_CTRL_IFACE_DBUS_NEW=y and
CONFIG_CTRL_IFACE_DBUS_INTRO=y for introspection.

This commit misses couple of parts from the full implementation
(these are still under review):
- fetching all configuration parameters for learning WPS information
- scan result BSS add/remove notification (register_bss() and
  unregister_bss() notification callbacks)
2009-11-09 23:51:59 +02:00
Jouni Malinen b905c4a398 WPS: Add HTTP server module
Clean up code so that UPnP implementation does not need to include all
the HTTP functionality. In addition, make it easier to share HTTP server
functionality with other components in the future.
2009-11-08 17:26:55 +02:00
Jouni Malinen 0b40d03394 WPS: Move generic UPnP XML helper functionality into a separate file 2009-11-08 14:06:01 +02:00
Jouni Malinen 092794f480 WPS: Add HTTP client module to clean up code
Instead of implementing HTTP client functionality inside
wps_upnp_event.c, use a generic HTTP client module to do this. The HTTP
client code can now be shared more easily for other purposes, too.
2009-11-08 12:35:37 +02:00
Jouni Malinen e9bcfebfce WPS: Add initial part of External Registrar functionality
This is the first step in adding support for using wpa_supplicant as a
WPS External Registrar to manage APs over UPnP. Only the device
discovery part is implemented in this commit.
2009-11-07 12:41:01 +02:00
Jouni Malinen d27df100b5 Allow driver and ctrl_interface parameters to be overridden
New wpa_supplicant command line options -o<driver> and -O<ctrl> can
now be used to override the parameters received in add interface
command from dbus or global ctrl_interface. This can be used, e.g.,
to enable control interface when using NetworkManager (add
-O/var/run/wpa_supplicant into the Exec parameter in
/usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service).
Similarly, this can be used to use another driver wrapper with
NetworkManager (e.g., -onl80211 to replace WEXT with nl80211).
2009-11-04 20:16:15 +02:00
Jouni Malinen eb999fefcb Add Xcode project file for building wpa_supplicant 2009-11-02 19:37:46 +02:00
Jouni Malinen e6c0ebff68 Fix int_array_concat() to bail out on realloc failure
The previous version could have ended up dereferencing a NULL pointer
if the reallocation call were to fail.
2009-11-02 19:14:17 +02:00
Oleg Kravtsov 63330c6832 WPS: Add PBC overlap and timeout events from WPS module
This provides information about PBC mode result from the WPS Registrar
module. This could be used, e.g., to provide a user notification on the
AP UI on PBC failures.
2009-11-01 21:26:13 +02:00
Jouni Malinen 76d11d3f42 SME: Improve processing of association rejection
Force deauthentication from the AP to clear mac80211 state (it would get
stuck with future scans if the AP is left in authenticated, but not
associated, state).

Add blacklist entry for the AP to allow other APs with worse signal
strength to be tried (e.g., when APs are trying to do load balancing
with status code 17). Reduce wait for the next scan to speed up
connection in cases where there could be other APs that could accept
association, but which show worse signal strength.
2009-10-31 23:21:43 +02:00
Sam Leffler cca8773165 Allow CONFIG_DEBUG_SYSLOG=y to be used
Instead of having to add the syslog define manually into CFLAGS,
CONFIG_DEBUG_SYSLOG=y can now be used in .config.
2009-10-22 11:17:05 -07:00
Sam Leffler 2d8fe38109 Stub out the dbus function w/o CONFIG_WPS to fix build 2009-10-22 11:08:10 -07:00
Jouni Malinen f1739bac4f Move PKCS# {1,5,8} functionality into separate files
This functionality fits better with src/tls (i.e., internal TLS
implementation), so move it there to make crypto_internal.c more
of a wrapper like other crypto_*.c files.
2009-10-17 12:48:55 +03:00
Jouni Malinen 385f16c611 Remove wpa_priv on 'make clean' 2009-10-16 21:49:45 +03:00
Jouni Malinen 43fb529750 Add AP mode WPA status into ctrl_iface 2009-10-16 18:35:45 +03:00
Jouni Malinen f730b421e9 wpa_gui-qt4: Dynamically update associated STAs in peer dialog 2009-10-16 17:53:02 +03:00
Jouni Malinen e81634cd18 Skip networks without known SSID when selecting the BSS
Previously, APs that were hiding SSID (zero-length SSID IE in
Beacon frames) could have been selected when wildcard SSID matching
was used. This would result in failed association attempt since
the client does not know the correct SSID. This can slow down WPS
which is often using wildcard SSID matching.

Ignore BSSes without known SSID in the scan results when selecting
which BSS to use.
2009-10-15 21:58:58 +03:00
Witold Sowa dc461de43e wpa_supplicant and dbus code separation
This patch completely separates supplicant's code from dbus.
It introduces three new notifications which copes with all
remaining dbus stuff.
wpas_notify_unregister_interface() was renamed to
wpas_notify_iface_removed().
2009-10-15 21:15:10 +03:00
Sam Leffler 4f34d51abe Do not schedule a new scan if no networks are enabled
This avoids an extra timeout to move to INACTIVE state.
2009-10-14 22:05:58 +03:00
Jouni Malinen 3afe7b61e0 Fix AES dependencies for CONFIG_AP=y (and IBSS) builds 2009-10-13 11:16:05 +03:00
Jouni Malinen 35deb646cc Fix CONFIG_AP=y build without CONFIG_CTRL_IFACE 2009-10-13 11:15:39 +03:00
Masashi Honma 279d859b8f Fix IEEE 802.11r/w compilation error
The hostapd/wpa_supplicant compilation failed with CONFIG_IEEE80211R=y
or CONFIG_IEEE80211W=y option if CONFIG_EAP_PSK and CONFIG_EAP_GPSK are
not used.
2009-10-13 10:04:46 +03:00
Jouni Malinen 6d6f4bb87f nl80211: Work around mac80211 limitation on (re)auth when authenticated
mac80211 does not currently allow (re)authentication when we are already
authenticated. In order to work around this, force deauthentication if
nl80211 authentication command fails with EALREADY. Unfortunately, the
workaround code in driver_nl80211.c alone is not enough since the
following disconnection event would clear wpa_supplicant authentication
state. To handle this, add some code to restore authentication state
when using userspace SME.

This workaround will hopefully become unnecessary in some point should
mac80211 start accepting new authentication requests even when in
authenticated state.
2009-10-12 09:39:55 +03:00
Masashi Honma 0e27f655f1 MFP: Clear IGTK
The fourth and fifth keys are used as IGTK for management frame
protection. This patch clears these keys.

I have tested with linux kernel 2.6.31.2.
2009-10-12 07:19:01 +03:00
Jouni Malinen bd4e9d033b Replace CONFIG_NO_AES_EXTRAS with auto-detection during build
There is no need to do this manually since it is possible to figure
out automatically which AES extra files need to be included in the
build.
2009-10-11 22:23:50 +03:00