Commit graph

662 commits

Author SHA1 Message Date
Jouni Malinen 1057d78eb8 Move generic AP functionality implementation into src/ap
This code can be shared by both hostapd and wpa_supplicant and this
is an initial step in getting the generic code moved to be under the
src directories. Couple of generic files still remain under the
hostapd directory due to direct dependencies to files there. Once the
dependencies have been removed, they will also be moved to the src/ap
directory to allow wpa_supplicant to be built without requiring anything
from the hostapd directory.
2009-12-25 01:12:50 +02:00
Jouni Malinen bf65bc638f hostapd: Use separate driver operations abstraction
It would be bettet to avoid including driver_i.h, i.e., direct driver
operation calls from hostapd components. This is an initial step in
that direction for WPS IE updates.
2009-12-24 16:15:22 +02:00
Felix Fietkau fbbfcbac29 hostapd: Add WDS (4-address frame) mode with per-station interfaces
This mode allows associated stations to use 4-address frames to allow
layer 2 bridging to be used. At least for the time being, this is only
supported with driver=nl80211.
2009-12-24 11:46:22 +02:00
Jouni Malinen 09e47a0768 Convert to use struct dl_list 2009-12-23 23:56:35 +02:00
Jouni Malinen 96603e4fe1 Comment CONFIG_WPA_TRACE_BFD=y out by default 2009-12-23 23:20:11 +02:00
Jouni Malinen a5b9337fc8 Avoid NULL dereference on error path when default driver is used 2009-12-23 23:16:21 +02:00
Jouni Malinen 094393b144 Copy config_methods and device_type configuration for AP mode 2009-12-21 16:10:21 +02:00
Jouni Malinen c0e4dd9eeb WPS: Make Config Methods configurable for wpa_supplicant
This adds config_methods configuration option for wpa_supplicant
following the design used in hostapd. In addition, the string is
now parsed in common code from src/wps/wps_common.c and the list
of configurable methods include all the defined methods from
WPS 1.0h spec.
2009-12-21 15:59:25 +02:00
Jouni Malinen 1078126f64 Add "keypad" to config methods for wpa_supplicant AP mode with WPS 2009-12-21 11:51:31 +02:00
Jouni Malinen b22b41ee87 Describe tracing build options for developers 2009-12-20 23:41:06 +02:00
Jouni Malinen f2f7d965b8 Add option libbfd support for tracing code
CONFIG_WPA_TRACE=y and CONFIG_WPA_TRACE_BFD=y can now be used to get
even more complete symbols (func/file/line and inline functions) for
backtraces.
2009-12-20 23:35:06 +02:00
Jouni Malinen 6d59e14c58 dbus: Fix build with "ctrl_iface_" prefix removed 2009-12-20 21:34:56 +02:00
Jouni Malinen a206a29a54 dbus: Remove the confusing "ctrl_iface_" prefix from file names
The D-Bus interface does not really have anything to do with the
wpa_supplicant ctrl_iface interface and as such, this prefix in
dbus files is both confusing and unnecessarily. Make the file names
shorter by removing this prefix.
2009-12-20 21:11:35 +02:00
Jouni Malinen 36da1358bc dbus: Move some of conditional WPS code into separate files 2009-12-20 21:04:40 +02:00
Jouni Malinen a8c481c10a dbus: Remove unnecessary CONFIG_WPS ifdefs from header files 2009-12-20 20:40:23 +02:00
Jouni Malinen eb3b34ceea dbus: Clean dbus build files on wpa_supplicant 'make clean'
In addition, add preliminary build rules for build libwpadbus.a.
2009-12-20 20:29:09 +02:00
Jouni Malinen 926ab7e6a0 dbus: Rename .service file to use the service name as the file name 2009-12-20 20:15:40 +02:00
Witold Sowa 65bea134ad dbus: Add missing .service file for the new D-Bus API 2009-12-20 20:14:10 +02:00
Jouni Malinen 19b3211d19 Move D-Bus related files into their own subdirectory 2009-12-20 20:11:14 +02:00
Jouni Malinen 94c3e91fc5 Add empty FIPS PRF wrapper for CryptoAPI 2009-12-20 18:14:20 +02:00
Jouni Malinen 1a1bf008cb WPS ER: Delay wpa_supplicant termination to allow unsubscription
Instead of forcefully deinitializing ER immediately, give it some
time to complete unsubscription and call eloop_terminate() only once
ER code has completed its work.
2009-12-19 23:47:54 +02:00
Jouni Malinen a24eb8424b Free readline() output with free(), not os_free() 2009-12-19 22:01:09 +02:00
Jouni Malinen fb4baa688b Add memory allocation analyzer to verify OS wrapper use
WPA_TRACE=y builds will now verify that memory allocation in done
consistently using os_{zalloc,malloc,realloc,strdup,free} (i.e., no
mixing of os_* functions and unwrapper functions). In addition, some
common memory allocation issues (double-free, memory leaks, etc.) are
detected automatically.
2009-12-19 21:47:56 +02:00
Jouni Malinen 0456ea16d8 eloop: Remove global user data pointer
This is not really needed since all signal handlers can use a context
pointer provided during signal handler registration.
2009-12-19 19:22:16 +02:00
Jouni Malinen 9969e5a46a Make hostapd_for_each_interface() take context pointer as argument
This removes need for using eloop_get_user_data().
2009-12-19 19:07:31 +02:00
Jouni Malinen 930f704aac Add backtrace support for debugging
WPA_TRACE=y can now be used to enable internal backtrace support that
will provide more details about implementation errors, e.g., when some
resources are not released correctly. In addition, this will print out
a backtrace automatically if SIGSEGV is received.
2009-12-19 18:40:54 +02:00
Jouni Malinen f5d4a8ead4 eapol_test: Fix build after RADIUS msg API changes 2009-12-19 18:40:11 +02:00
Jouni Malinen 9e7245bdb4 Change radius_msg_free() to free the buffer
Since all callers were freeing the buffer immediately anyway, move
this operation into radius_msg_free() to reduce code size.
2009-12-19 16:34:41 +02:00
Jouni Malinen d2e6100c16 Fix xcode build (eap_register.c needs to be included) 2009-12-18 21:58:23 +02:00
Jouni Malinen 0e15e529eb Show current mode (station/AB/IBSS) in status 2009-12-16 16:02:38 +02:00
Jouni Malinen c302f20740 Initialize new_connection = 1 to fix wpa_supplicant AP mode operstate
When setting up an AP with wpa_supplicant, the initial connection was
not necessarily setting oper state from DORMANT to UP which would be
blocking normal data frames. Fix this by initializing new_connection
to 1 so that even the first change to COMPLETED state will end up
setting oper state.
2009-12-15 13:17:56 +02:00
Jouni Malinen b57e086cc1 Mark management frame processing functions to use const buffer 2009-12-13 23:25:30 +02:00
Jouni Malinen ba091c06c5 Mark ieee802_11_parse_elems() input and parsed elems const
In addition, re-order IE pointers and u8 length so that the shorter
length fields are together to allow compiler to optimize structure size.
2009-12-13 23:11:11 +02:00
Jouni Malinen f8b1f69561 Use generic driver events for TX status and RX reporting
Replace driver wrapper calls to hostapd_tx_status(),
hostapd_rx_from_unknown_sta(), hostapd_mgmt_rx(), and
hostapd_mgmt_tx_cb() with new generic driver events
EVENT_TX_STATUS, EVENT_RX_FROM_UNKNOWN, and EVENT_RX_MGMT.

This cleans up lot of the driver wrapper code to be less dependent
on whether it is being used within wpa_supplicant AP mode or hostapd.
2009-12-13 23:05:39 +02:00
Jouni Malinen ac7043f265 Fix VS project files to match with source code file changes 2009-12-13 21:01:52 +02:00
Jouni Malinen 50b5bf4eda Remove obsolete Prism54.org driver support (driver_prism54.c)
The Prism54.org project seems have been dead for a while and it does not
look like this driver would ever be maintained again. Furthermore, it is
difficult to find a version that would work with the driver_prism54.c
wrapper and there is another driver for these card in the Linux kernel
tree.

The hostapd integration in driver_prism54.c is quite different from the
other driver wrappers and would require major effort to get it cleaned
up. Since there does not seem to be any real users for the cleaned up
version, there does not seem to be justification to spend this effort on
the wrapper. This old code is making it much more difficult to clean up
the driver interface and at this point, the best option seems to be to
remove the driver wrappers. Should someone really still need this, the
old code will continue to be available in hostapd 0.6.x.
2009-12-12 20:52:12 +02:00
Jouni Malinen 7e683ceeb4 WPS: Handle Selected Registrar as a union of info from all Registrars
Instead of using the latest selected registrar change, collect selected
registrar information separately from all registrars and use the union
of this information when building the WPS IE for Beacon and Probe
Response frames.

Note: SetSelectedRegistrar UPnP action does not include a unique
identifier, so the ER matching routine is based only on the IP address
of the ER. In theory, there could be multiple ERs using the same IP
address (but different port or URL), so there may be some corner cases
that would not always match the correct ER entry at the AP. Anyway, this
is not really expected to occur in normal use cases and even if it did
happen, the selected registrar information is not any worse than it was
before when only the last change from any registrar for being
advertized.
2009-12-12 16:54:59 +02:00
Jouni Malinen c1a853438f WPS: Add display and keypad config methods for WPS ER 2009-12-12 16:49:33 +02:00
Jouni Malinen 50ceddcfd6 Fix dh_groups.o build for some configurations
Need to include dh_groups.o in the build even if not all DH groups
are included. Only internal crypto build case was doing this properly.
2009-12-11 17:24:42 +02:00
Jouni Malinen fb7842aa51 Remove struct hostapd_rate_data from driver API
In addition to the bitrate, the only other variable in this structure
is used internally in hostapd. Move this structure into hostapd.h and
make the driver API use simpler data structure (array of bitrates).
2009-12-09 21:57:50 +02:00
Jouni Malinen 803a811b73 Add support for building IEEE 802.11n support into wpa_supplicant AP 2009-12-06 19:50:40 +02:00
Jouni Malinen bed4d57488 Fix some issues with test program builds 2009-12-06 18:30:12 +02:00
Jouni Malinen 655702f38d Move test_x509v3 into the new tests subdirectory 2009-12-06 18:10:52 +02:00
Jouni Malinen 6b282c3951 Remove forgotten asn1_test build target
This is now in tests/Makefile.
2009-12-06 17:57:23 +02:00
Jouni Malinen 74784010af Remove conditional no-RADIUS build from src/radius
Make it responsibility of the src/radius user to handle conditional
build rules.
2009-12-06 17:53:59 +02:00
Jouni Malinen 1a70777868 Remove unneeded CONFIG_INTERNAL_X509 and NEED_SHA256 defines 2009-12-06 16:19:13 +02:00
Jouni Malinen be473f3f09 Split crypto_internal.c into parts to clean up build
This makes it easier to make src/libcrypto.a and only link in
code that is really used.
2009-12-06 14:37:46 +02:00
Jouni Malinen 127608152e Move EAP method registration away from src/eap_{peer,server}
This makes it easier to make a library out of EAP methods without
losing possiblity of binary size optimization by linker dropping
unreferenced code.
2009-12-06 11:28:41 +02:00
Jouni Malinen 2d106f21aa Remove unnecessary defines
The following defines are not really needed in most places, so
remove them to clean up source code and build scripts:
EAP_TLS_FUNCS
EAP_TLS_OPENSSL
EAP_TLS_GNUTLS
CONFIG_TLS_INTERNAL
2009-12-05 22:51:08 +02:00
Jouni Malinen f8cf3ce6a6 Move more tests from wpa_supplicant/tests into tests 2009-12-05 22:25:32 +02:00
Jouni Malinen 668562d5fb Move MD4 test from wpa_supplicant/tests into tests 2009-12-05 22:11:50 +02:00
Jouni Malinen 43df4cc2ca Move milenage.[ch] into src/crypto 2009-12-05 21:00:52 +02:00
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