Jouni Malinen [Sun, 29 Nov 2009 21:04:43 +0000 (23:04 +0200)]
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.
Jouni Malinen [Sun, 29 Nov 2009 18:18:47 +0000 (20:18 +0200)]
Make HOSTAPD_DUMP_STATE configurable with CONFIG_NO_DUMP_STATE
This removes the hardcoded definition from Makefile and cleans up
source code by moving the mail HOSTAPD_DUMP_STATE blocks into separate
files to avoid conditional compilation within files.
Jouni Malinen [Sun, 29 Nov 2009 16:57:15 +0000 (18:57 +0200)]
Replace eap_type_text() with EAP server methods function
While this may not include knowledge of all EAP methods since this
depends on build configuration, it is better to not have to include
ieee802_1x.h into eapol_sm.c.
Jouni Malinen [Sun, 29 Nov 2009 16:46:42 +0000 (18:46 +0200)]
Conver hostapd specific files to include common.h
Instead of getting this via hostapd.h, include it as the first
non-system header file in all source code files in the same way as
used in all other files.
Jouni Malinen [Sun, 29 Nov 2009 15:51:55 +0000 (17:51 +0200)]
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.
Jouni Malinen [Sun, 29 Nov 2009 15:06:03 +0000 (17:06 +0200)]
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).
Jouni Malinen [Sun, 29 Nov 2009 10:21:26 +0000 (12:21 +0200)]
Fix AP mode HT Capabilities IE to use A-MPDU Parameters from the driver
Instead of using hardcoded maximum A-MPDU length of 64 kB and no
restrictions on minimum MPDU Start Spacing, use the correct values
reported by the driver.
Jouni Malinen [Sat, 28 Nov 2009 21:04:35 +0000 (23:04 +0200)]
Remove unused RADIUS client reconfig function
This is not actually used at all and it looks like the rules for
maintaining the old/new RADIUS configuration are not very clear in the
case the RADIUS client configuration did not change. Consequently, it
is better to just remove this for now and if similar functionality is
ever needed, redesign it to be easier to use without causing hard to
find issues with using freed memory.
Simpler approach to reconfiguring the RADIUS client would involve
just deinitializing the old context unconditionally and initializing
a new one whenever the configuration could have changed.
Jouni Malinen [Thu, 26 Nov 2009 09:39:29 +0000 (11:39 +0200)]
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.
Jouni Malinen [Tue, 24 Nov 2009 22:57:00 +0000 (00:57 +0200)]
Resolve some sparse warnings
Mainly, this is including header files to get definitions for functions
which is good to verify that the parameters match. None of these are
issues that would have shown as incorrect behavior of the program.
Jouni Malinen [Mon, 23 Nov 2009 18:22:38 +0000 (20:22 +0200)]
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.
Jouni Malinen [Mon, 23 Nov 2009 15:08:59 +0000 (17:08 +0200)]
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.
Jouni Malinen [Mon, 23 Nov 2009 14:21:07 +0000 (16:21 +0200)]
Move HOSTAPD_MTU definition into driver_hostap.c
This moves the MTU definition into driver_hostap.c since it was really
meant to be specific to this driver. Since this was the last remaining
definition in hostapd_defs.h, remove that header file as unnecessary.
Jouni Malinen [Mon, 23 Nov 2009 14:17:41 +0000 (16:17 +0200)]
Remove unneeded set-MTU operation from drivers
This code was copied from driver_hostap.c where it is used with the
special wlan#ap interface. It was not supposed to be used to change
the MTU for a normal data interface.
Jouni Malinen [Mon, 23 Nov 2009 13:30:05 +0000 (15:30 +0200)]
nl80211: Remove last remaining WEXT code
Clean up driver_nl80211.c by gettign rid of the last remaining WEXT use.
This requires that a recent mac80211 version is used to get full protection
in station mode via the authorized flag (IEEE 802.1X PAE).
Jouni Malinen [Mon, 23 Nov 2009 13:26:05 +0000 (15:26 +0200)]
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.
Jouni Malinen [Sat, 21 Nov 2009 20:00:33 +0000 (22:00 +0200)]
WPS: Do not try to send byebye advertisements if socket is not valid
If initialization fails, we could potentially try to sendto() on -1
socket which would fail. No point in doing that, so just return early
from the function.
Jouni Malinen [Sat, 21 Nov 2009 18:52:55 +0000 (20:52 +0200)]
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).
The current MinGW/w32api versions seem to provide all the needed CryptoAPI
functions, so the code for loading these dynamically from the DLL can be
removed.
Jouni Malinen [Sat, 21 Nov 2009 18:17:24 +0000 (20:17 +0200)]
Fix strict aliasing issue with the internal SHA-1 implementation
Need to define the workspace buffer properly to allow compiler to handle
strict aliasing between the incoming unsigned char[64] buffer as an u32
array. The previous version built with strict aliasing enabled can
result in SHA-1 producing incorrect results and consequently, with
4-way handshake failing.
This is based on a report and patch from Dan Williams <dcbw@redhat.com>
but with a different type (the union) used as a fix to avoid needing
extra type casting.
Jouni Malinen [Sat, 21 Nov 2009 16:15:37 +0000 (18:15 +0200)]
WPS ER: Use random event identifier in event URL
This avoids some issues in cases where the ER has been started and
stopped multiple times on the same address and an AP may have stored
multiple event notification addresses for the same ER. The random
identifier allows the ER to filter out unexpected messages from further
processing.
Jouni Malinen [Sat, 21 Nov 2009 16:06:02 +0000 (18:06 +0200)]
WPS: Cleanup subscription URL list handling
Do not give the allocated memory to the subscription code since it was
not using it as-is anyway. This makes it easier to understand who owns
the allocation an is responsible of freeing it. This may potentially
fix some memory leaks on error paths.
Jouni Malinen [Sat, 21 Nov 2009 13:01:23 +0000 (15:01 +0200)]
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.
Jouni Malinen [Thu, 19 Nov 2009 19:12:06 +0000 (21:12 +0200)]
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.
Jouni Malinen [Thu, 19 Nov 2009 19:03:25 +0000 (21:03 +0200)]
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).
Jouni Malinen [Wed, 18 Nov 2009 22:31:57 +0000 (00:31 +0200)]
WPS: Fix MAC Address inside Credential be that of Enrollee's
The WPS 1.0h specification is quite unclear on what exactly should be
used as the MAC Address value in the Credential and AP Settings. It
looks like this should after all be the MAC Address of the Enrollee,
so change Registrar implementation to use that address instead of the
AP BSSID.
In addition, add validation code to the Enrollee implementation to
check the MAC Address value inside Credential (and also inside AP Settings)
to make sure it matches with the Enrollee's own address. However, since
there are deployed implementations that do not follow this interpretation
of the spec, only show the mismatch in debug information to avoid breaking
interoperability with existing devices.
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]
Witold Sowa [Mon, 16 Nov 2009 11:25:51 +0000 (13:25 +0200)]
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.
Christian Rüb [Mon, 16 Nov 2009 11:20:53 +0000 (13:20 +0200)]
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).