Commit graph

662 commits

Author SHA1 Message Date
Jouni Malinen d84c8f1413 dbus: Add example script for fetching all properties with Getall 2010-01-01 11:00:11 +02:00
Jouni Malinen bacfd05fe5 dbus: Rename old D-Bus API files to include "_old"
This makes it easier to figure out which file is used by which
D-Bus interface.
2009-12-31 21:55:32 +02:00
Jouni Malinen 26e054ce6b dbus: Do not deinitialize new D-Bus API if it is not initialized
This fixes a crash on error path when D-Bus initialization fails.
2009-12-31 21:50:12 +02:00
Jouni Malinen 8ddef94bd4 dbus: Share common initialization code for both old and new interface
This was mostly identical code that had been copied for the new D-Bus
API implementation and as such, should really have been shared from
the beginning. In addition, the copied code ended up generating
interesting stack traces since the actual D-Bus connection was being
shared even though the pointer to it was stored in two distinct
data structures. The old D-Bus code ended up dispatching some
D-Bus callbacks which ended up running the new D-Bus code.

Since the private context pointers were mostly identical, everything
seemed to more or less work, but this design was just making things
more complex and potentially very easy to break.
2009-12-31 00:15:56 +02:00
Jouni Malinen 0474686514 Fix couple of memory leaks in wpa_config_get_all() 2009-12-30 22:37:23 +02:00
Jouni Malinen 1179cb834d wpa_gui-qt4: Update BSS entries in Peers dialog dynamically
Use the new BSS added/removed events to add/remove BSS (AP) entries
in the Peers dialog.
2009-12-30 22:18:18 +02:00
Jouni Malinen ba96adb65f dbus: Verify dbus_message_new_method_return() return value before use 2009-12-29 23:46:50 +02:00
Jouni Malinen 8e56d18993 dbus: Fix D-Bus network and BSS object registration/unregistration
Do not try to unregister BSS objects twice (the latter one with invalid
path) and make sure all network objects get added and removed properly
(the ones read from configuration file were not being registered, but
were tried to be unregistered).
2009-12-29 22:17:18 +02:00
Jouni Malinen c2f5126941 WPS: Add Enrollee-seen event message and wpa_gui-qt4 Peers entry
This can be used to show active Enrollees in AP mode to make it
easier to provision a new device.
2009-12-28 16:24:04 +02:00
Jouni Malinen f7e5436502 WPS: Clear SSID selection if more than one BSSID match is found
Need to use wildcard SSID matching for WPS connection if the same
BSSID occurs multiple time in scan results since any of the SSIDs
may be used.
2009-12-28 16:07:15 +02:00
Jouni Malinen d7dcba70bc Define struct wpa_ssid::mode as an enum with more readable values 2009-12-28 16:00:36 +02:00
Jouni Malinen bd1af96ad1 Add [ESS] flag for scan/BSS info from ctrl_iface 2009-12-28 13:35:51 +02:00
Jouni Malinen d009a9dac6 Add scan parameter support for client MLME 2009-12-28 13:34:03 +02:00
Jouni Malinen 4832ecd754 Add an option for driver wrappers to report operational frequency 2009-12-28 13:23:13 +02:00
Jouni Malinen d566f4152f Fix wpa_cli with libreadline and WPA_TRACE to use consistent alloc
Need to use strdup(), not os_strdup() here since the readline/fgets
result needs to use same style for memory allocation to avoid WPA_TRACE
errors.
2009-12-28 12:13:52 +02:00
Jouni Malinen e5fc8c8ce5 Fix crash on BSS deinit getting called before BSS init 2009-12-28 12:11:23 +02:00
Jouni Malinen 34359a3fb1 Include BSS table unconditionally in the wpa_supplicant build
This will allow more cleanup to be done for scan results processing
since all code can now be made to depend on the BSS table instead of
the temporary scan results.

Once remaining code has been converted to use the BSS table, the new
scan results can be freed immediately after the BSS table has been
updated. In addition, filtering of BSS information should be added
to better support systems with limited resources. For now, memory
use can be limited by defining WPA_BSS_MAX_COUNT to be smaller.
Anyway, better filtering of results to only the configured networks
should be added to improve this.
2009-12-28 01:14:56 +02:00
Jouni Malinen ccd286d025 dbus: Use the new BSS table with the new D-Bus API
Replace the scan results -based implementation with the use of information
from the new BSS table maintained by wpa_supplicant to get a more stable
source of BSS data. Change the use of BSSID as the key for the BSS object
to use the BSS table unique identifier so that multi-SSID APs can be
handled properly.
2009-12-28 01:10:07 +02:00
Jouni Malinen 99a6a63f25 Add wpa_bss_get_max_rate() to match with old scan_res helpers 2009-12-28 01:09:32 +02:00
Jouni Malinen 332d630a44 Use wpa_msg_ctrl() for WPS AP available events
No need to include these MSG_INFO level events in stdout/syslog,
so deliver them only to ctrl_iface monitors.
2009-12-28 00:44:10 +02:00
Jouni Malinen f0d126d339 Add ctrl_iface events for BSS added/removed 2009-12-28 00:42:51 +02:00
Jouni Malinen 3a06863296 Change BSS ctrl_iface command to use BSS table instead of scan results
In addition, provide another option for iterating through the BSS
entries. The old iteration: "BSS 0", "BSS 1", .. with index number.
The new iteration: "BSS FIRST", "BSS NEXT-<prev id>", .. with id
fetched from the previous output (id=<id> line).
2009-12-28 00:33:20 +02:00
Jouni Malinen d4bf8f132a Add BSS list sorted by id and add some helper functions
This allows the BSS list to be iterated in order of increasing id
to avoid problems with new scans reordering entries. The order on the
wpa_s->bss list changes with most recently updated entries being moved
to the tail of the list while wpa_s->bss_id list maintains its order
with new entries being added to the tail and old entries being removed
when they expire.
2009-12-28 00:30:38 +02:00
Jouni Malinen c9df730b03 Add handling of BSSAdded and BSSRemoved events 2009-12-27 21:42:02 +02:00
Jouni Malinen 58c26600ca Fix wpa_supplicant build with CONFIG_AP=y 2009-12-27 21:33:18 +02:00
Jouni Malinen f7c4783379 Split hostapd_interface_deinit() into deinit and free parts
This allows the driver interface to be deinitialized before
struct hostapd_data instance gets freed. This needs to be done so
that the driver wrapper does not maintain a context pointer to
freed memory.
2009-12-27 21:31:13 +02:00
Jouni Malinen 83922c2d34 Add BSS table to track scan results without dropping information
Collect information from scan results into a BSS table that will not
expire information as quickly as scan results where every new scan,
no matter for how limited set of channels/SSIDs, clears all old
information.

For now, this is only used for D-Bus BSS added/removed notifications,
but this will likely be extended to be used internally instead of the
scan results to better support partial scans.
2009-12-27 21:07:47 +02:00
Jouni Malinen 5a464ff86e dbus: Split message_handler() into readable helper functions 2009-12-26 21:27:24 +02:00
Jouni Malinen 55fc1ce024 dbus: Add an example python script for using the new dbus interface
This has example code for fetching and interface object and optionally
creating a new interface is one is not found. After that, a scan is
requested and the script continues to listed for signals from
wpa_supplicant and print information about scan results and state
changes.
2009-12-26 18:41:01 +02:00
Jouni Malinen fae3a72f93 dbus: Remove unnecessary indentation by cleaning up if/else structure 2009-12-26 17:28:19 +02:00
Jouni Malinen d401b48f3c dbus: split wpas_dbus_handler_scan() into number of helper functions
Make this code readable by splitting it into pieces and fix couple of
emmory leaks on error paths.
2009-12-26 17:06:28 +02:00
Jouni Malinen d114fcabbf dbus: Fix build without os_free available as a pointer
Need to add a wrapper function to be able to handle the need for
having a function pointer for freeing function for dbus use.
2009-12-26 16:20:37 +02:00
Jouni Malinen ac68f031a7 dbus: Fix Scan invalid args reporting (uninitialize variable)
Must initialize key to be NULL since it can be used in an error
message. If the Scan method did not actually include any dict entries,
the uninitialized pointer was used and this could result in
wpa_supplicant crashing.
2009-12-26 14:37:04 +02:00
Jouni Malinen 833fe95eb1 dbus: show messages in debug log 2009-12-26 14:14:31 +02:00
Jouni Malinen 376900708a dbus: Check that wpa_s->scan_res != NULL before dereferencing it 2009-12-26 13:55:22 +02:00
Jouni Malinen 2ee055b3c0 Indicate interface removal only if the interface was added successfully 2009-12-26 13:45:07 +02:00
Jouni Malinen 2f00ad446e dbus: Fix wpa_supplicant_add_iface() calls
Removed the hack that used typecast to get rid of const by using local
variables that are allocated and freed. Fix couple of memory leaks
and check that the required Ifname parameter is included.
2009-12-26 13:36:05 +02:00
Jouni Malinen a646086d51 dbus: Use os_*() wrappers for memory allocations consistently
This is needed to avoid bogus WPA_TRACE error reports.
2009-12-26 12:29:24 +02:00
Jouni Malinen 719347511a Get rid of unnecessary typedefs for enums. 2009-12-26 10:35:08 +02:00
Jouni Malinen 6226e38d00 Rename some src/ap files to avoid duplicate file names
Doxygen and some build tools may get a bit confused about same file
name being used in different directories. Clean this up a bit by
renaming some of the duplicated file names in src/ap.
2009-12-26 00:05:40 +02:00
Jouni Malinen 1b56c26c40 Get rid of direct hostapd_for_each_interface() calls
src/ap/*.c must not call functions in hostapd or wpa_supplicant
directories directly, so avoid this by using a callback function
pointer.
2009-12-25 20:12:26 +02:00
Jouni Malinen 70db2ab308 Move rest of the generic AP mode functionality into src/ap 2009-12-25 20:06:07 +02:00
Jouni Malinen a911a6e61f Do not use virtual driver_ops for wpa_supplicant AP mode
Initialize struct hostapd_data driver context with the same driver
information that was initialized earlier during wpa_supplicant start.
This allows the AP mode operations to be completed directly with the
same calls in AP code without having to maintain a separate translation
layer between the AP and station mode driver context.
2009-12-25 19:47:08 +02:00
Jouni Malinen 8c5fe31fe8 Move driver deinitialization away from hostapd.c
This matches with the earlier change of moving driver initialization
and allows more control on how the driver context is managed.
2009-12-25 18:32:44 +02:00
Jouni Malinen c442055ecf Move WPA authenticator glue code into a separate file 2009-12-25 14:02:17 +02:00
Jouni Malinen 2586bc64d0 Move authentication server setup into separate file 2009-12-25 13:43:43 +02:00
Jouni Malinen 0e2d35c614 Move ctrl_iface_ap.c into src/ap 2009-12-25 12:25:55 +02:00
Jouni Malinen e5f2b59c7e Move hostapd driver initialization away from hostapd.c
This makes it easier to customize AP mode initialization for
wpa_supplicant.
2009-12-25 12:21:11 +02:00
Jouni Malinen 363b9e6052 Fix wpa_supplicant CONFIG_AP build 2009-12-25 12:06:53 +02:00
Jouni Malinen 32da61d9c9 Move wps_hostapd.c into src/ap 2009-12-25 01:26:37 +02:00
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