Jouni Malinen [Sat, 19 Dec 2009 20:14:06 +0000 (22:14 +0200)]
WPS ER: Convert lists to use struct dl_list
Jouni Malinen [Sat, 19 Dec 2009 20:01:09 +0000 (22:01 +0200)]
Free readline() output with free(), not os_free()
Jouni Malinen [Sat, 19 Dec 2009 19:58:00 +0000 (21:58 +0200)]
WPS: Remove unused net_if copy
Jouni Malinen [Sat, 19 Dec 2009 19:49:51 +0000 (21:49 +0200)]
driver_test: Use OS wrappers consistently for memory allocation
Jouni Malinen [Sat, 19 Dec 2009 19:47:56 +0000 (21:47 +0200)]
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.
Jouni Malinen [Sat, 19 Dec 2009 18:55:17 +0000 (20:55 +0200)]
hostapd: Call os_program_{init,deinit}()
Jouni Malinen [Sat, 19 Dec 2009 18:27:55 +0000 (20:27 +0200)]
eloop: Do not use printf() or fprintf() directly
Jouni Malinen [Sat, 19 Dec 2009 18:26:22 +0000 (20:26 +0200)]
eloop: Use struct dl_list for timeouts
Jouni Malinen [Sat, 19 Dec 2009 17:22:16 +0000 (19:22 +0200)]
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.
Jouni Malinen [Sat, 19 Dec 2009 17:07:31 +0000 (19:07 +0200)]
Make hostapd_for_each_interface() take context pointer as argument
This removes need for using eloop_get_user_data().
Jouni Malinen [Sat, 19 Dec 2009 16:52:42 +0000 (18:52 +0200)]
Fix RADIUS client to cancel IPv6 socket read notifications
Jouni Malinen [Sat, 19 Dec 2009 16:51:10 +0000 (18:51 +0200)]
Fix RADIUS server deinit to cancel timeout for session removal
Jouni Malinen [Sat, 19 Dec 2009 16:40:54 +0000 (18:40 +0200)]
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.
Jouni Malinen [Sat, 19 Dec 2009 16:40:11 +0000 (18:40 +0200)]
eapol_test: Fix build after RADIUS msg API changes
Jouni Malinen [Sat, 19 Dec 2009 15:26:57 +0000 (17:26 +0200)]
Make struct radius_msg private to radius.c
This is internal data structure for RADIUS message handling and
external code should not touch it directly.
Jouni Malinen [Sat, 19 Dec 2009 15:12:07 +0000 (17:12 +0200)]
Convert RADIUS message code to use wpabuf internally
Jouni Malinen [Sat, 19 Dec 2009 14:34:41 +0000 (16:34 +0200)]
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.
Jouni Malinen [Sat, 19 Dec 2009 14:20:53 +0000 (16:20 +0200)]
RADIUS message initialization cleanup
Jouni Malinen [Sat, 19 Dec 2009 14:13:06 +0000 (16:13 +0200)]
Add documentation for RADIUS code and some minor cleanup
Jouni Malinen [Sat, 19 Dec 2009 12:51:36 +0000 (14:51 +0200)]
WPS: Remove parent pointer from advertisement state machine
Jouni Malinen [Sat, 19 Dec 2009 12:46:52 +0000 (14:46 +0200)]
WPS: Convert struct advertisement_state_machine to use struct dl_list
Jouni Malinen [Sat, 19 Dec 2009 12:30:49 +0000 (14:30 +0200)]
WPS: Remove unused struct subscr_addr parent pointer
Jouni Malinen [Sat, 19 Dec 2009 12:29:01 +0000 (14:29 +0200)]
WPS: Convert struct wps_event_ to use struct dl_list
Jouni Malinen [Sat, 19 Dec 2009 12:15:43 +0000 (14:15 +0200)]
WPS: Convert struct subscription to use struct dl_list
Jouni Malinen [Sat, 19 Dec 2009 11:47:00 +0000 (13:47 +0200)]
WPS: Convert struct subscr_addr to use dl_list
Jouni Malinen [Sat, 19 Dec 2009 11:43:25 +0000 (13:43 +0200)]
Add generic doubly-linked list implementation
Jouni Malinen [Fri, 18 Dec 2009 19:58:23 +0000 (21:58 +0200)]
Fix xcode build (eap_register.c needs to be included)
Masashi Honma [Fri, 18 Dec 2009 19:25:21 +0000 (21:25 +0200)]
Mac OS X: Fix driver_osx.c build
Snowpin Lee [Fri, 18 Dec 2009 19:04:11 +0000 (21:04 +0200)]
ralink: Add WPS support
Jouni Malinen [Fri, 18 Dec 2009 16:24:13 +0000 (18:24 +0200)]
Change Linux driver wrappers to use shared netlink receive code
Jouni Malinen [Fri, 18 Dec 2009 15:49:07 +0000 (17:49 +0200)]
netlink: Move more of the newlink/dellink parsing into shared code
Jouni Malinen [Fri, 18 Dec 2009 15:22:35 +0000 (17:22 +0200)]
netlink: Use NLMSG_OK and NLMSG_NEXT macros
Jouni Malinen [Fri, 18 Dec 2009 15:11:54 +0000 (17:11 +0200)]
nl80211/wext: Share netlink new/del link event receive code
Jouni Malinen [Fri, 18 Dec 2009 14:35:33 +0000 (16:35 +0200)]
driver_nl80211/wext: Share netlink operstate send function
As an initial step in sharing netlink helper functions among driver
wrappers, create a new file for netlink code and move operstate send
function there.
Jouni Malinen [Fri, 18 Dec 2009 14:14:54 +0000 (16:14 +0200)]
Fix netlink payload length calculation
nlmsghdr length needs to be removed from payload length. [Bug 341]
Jouni Malinen [Wed, 16 Dec 2009 14:02:38 +0000 (16:02 +0200)]
Show current mode (station/AB/IBSS) in status
Jouni Malinen [Wed, 16 Dec 2009 14:01:54 +0000 (16:01 +0200)]
driver_test: Fix AP mode to initialize bss_ctx for first interface
Jouni Malinen [Tue, 15 Dec 2009 11:17:56 +0000 (13:17 +0200)]
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.
Jouni Malinen [Mon, 14 Dec 2009 19:13:58 +0000 (21:13 +0200)]
Fix driver_nl80211.c build without CONFIG_CLIENT_MLME
Jouni Malinen [Mon, 14 Dec 2009 14:09:20 +0000 (16:09 +0200)]
OpenSSL: Silence "Failed to read possible Application Data"
This message from tls_connection_handshake() is not really an error in
most cases, so do not show it if there was indeed no Application Data
available (which is a normal scenario and not an indication of any
error).
Jouni Malinen [Sun, 13 Dec 2009 21:25:30 +0000 (23:25 +0200)]
Mark management frame processing functions to use const buffer
Jouni Malinen [Sun, 13 Dec 2009 21:11:11 +0000 (23:11 +0200)]
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.
Jouni Malinen [Sun, 13 Dec 2009 21:05:39 +0000 (23:05 +0200)]
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.
Jouni Malinen [Sun, 13 Dec 2009 19:49:53 +0000 (21:49 +0200)]
nl80211: Remove some of the unnecessary conditional compilation
These functions can be built for both hostapd and wpa_supplicant.
Jouni Malinen [Sun, 13 Dec 2009 19:21:10 +0000 (21:21 +0200)]
Replace hostapd_button_pushed() with generic driver event
Jouni Malinen [Sun, 13 Dec 2009 19:19:02 +0000 (21:19 +0200)]
Fix EVENT_FT_RRB_RX processing
Jouni Malinen [Sun, 13 Dec 2009 19:17:11 +0000 (21:17 +0200)]
Replace hostapd_michael_mic_failure() with generic driver event
Jouni Malinen [Sun, 13 Dec 2009 19:01:52 +0000 (21:01 +0200)]
Fix VS project files to match with source code file changes
Jouni Malinen [Sun, 13 Dec 2009 16:57:57 +0000 (18:57 +0200)]
driver_test: Merge drv->hapd into drv->ctx
A separate struct hostapd_data pointer is not really needed anymore
and the generic context pointer can be used instead.
Jouni Malinen [Sun, 13 Dec 2009 16:54:11 +0000 (18:54 +0200)]
Add BSS ctx to if_add() driver op
This remove the need from driver_test.c to go through internal hostapd
structures to find the appropriate BSS when reporting events on secondary
BSSes.
Jouni Malinen [Sun, 13 Dec 2009 09:41:46 +0000 (11:41 +0200)]
Merge hostapd/sta_flags.h into sta_info.h
The separate header file is not needed since none of the driver wrappers
include it anymore. Move the WLAN_STA_* definitions back to be together
with struct sta_info definition.
Jouni Malinen [Sun, 13 Dec 2009 09:35:39 +0000 (11:35 +0200)]
Map STA flags into values defined in driver.h
This removes need for including hostapd/sta_flags.h into driver
wrappers and removes any remaining dependencies between driver flags
and internal hostapd flags.
Jouni Malinen [Sun, 13 Dec 2009 09:14:21 +0000 (11:14 +0200)]
Remove unneeded hostapd_wmm_sta_config()
The WMM STA flag is already taken care of by handle_assoc_cb() and there
is no point trying to do this unless hostapd is taking care MLME
processing, so no need to call this from drv_callbacks.c.
Jouni Malinen [Sun, 13 Dec 2009 09:05:22 +0000 (11:05 +0200)]
Remove usused flags parameter from sta_add() driver op
Jouni Malinen [Sat, 12 Dec 2009 21:55:09 +0000 (23:55 +0200)]
driver_bsd: Fix build after previous commit
Jouni Malinen [Sat, 12 Dec 2009 21:50:29 +0000 (23:50 +0200)]
Add more WPA/IEEE 802.1X parameters into set_ieee8021x() driver op
This gets rid of the need to touch internal hostapd data structures
directly from the driver wrappers.
Jouni Malinen [Sat, 12 Dec 2009 21:33:43 +0000 (23:33 +0200)]
driver_bsd: Fix build (eapol_sm.h is not needed anymore)
Jouni Malinen [Sat, 12 Dec 2009 21:32:44 +0000 (23:32 +0200)]
Change set_ieee8021x driver op to use parameters structure
This makes it easier to extent the set of parameters passed to
this driver wrapper function.
Jouni Malinen [Sat, 12 Dec 2009 20:43:26 +0000 (22:43 +0200)]
Replace direct driver call to wpa_ft_rrb_rx() with driver event
This avoids need to include hostapd/wpa.h into the driver wrappers.
Jouni Malinen [Sat, 12 Dec 2009 20:18:37 +0000 (22:18 +0200)]
driver_wired: Share multicast membership add/drop function
Jouni Malinen [Sat, 12 Dec 2009 20:07:29 +0000 (22:07 +0200)]
driver_wired: Remove unneeded conditional building blocks
Jouni Malinen [Sat, 12 Dec 2009 18:52:12 +0000 (20:52 +0200)]
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.
Jouni Malinen [Sat, 12 Dec 2009 18:39:25 +0000 (20:39 +0200)]
driver_wired: Move STA entry processing away from driver wrapper
Get rid of hostapd/sta_info.h dependency by introducing a new driver
callback function for hostapd.
Jouni Malinen [Sat, 12 Dec 2009 14:54:59 +0000 (16:54 +0200)]
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.
Jouni Malinen [Sat, 12 Dec 2009 14:49:33 +0000 (16:49 +0200)]
WPS: Add display and keypad config methods for WPS ER
Jouni Malinen [Sat, 12 Dec 2009 14:48:50 +0000 (16:48 +0200)]
WPS: Move POST URL validation into web_connection_parse_post()
This is more logical location for checking the URL and potentially
handling a call to another URL handler. In addition, return 404 error,
not invalid UPnP action, if the URL does not match.
Jouni Malinen [Sat, 12 Dec 2009 14:48:18 +0000 (16:48 +0200)]
WPS: Remove an obsolete comment about UPnP actions and callbacks
Jouni Malinen [Sat, 12 Dec 2009 14:47:39 +0000 (16:47 +0200)]
WPS: Remove unnecessary GetDevice and PutMessage callbacks
These callbacks can be handled internally within core WPS code, so there
is no need to go through wps_hostapd.c with a callback function that is
just calling back into the core WPS code.
Jouni Malinen [Sat, 12 Dec 2009 14:46:33 +0000 (16:46 +0200)]
WPS: Remove unnecessary SetSelectedRegistrar callback
This can be handled internally within core WPS code, so there is no
need to go through wps_hostapd.c with a callback function that is just
calling back into the core WPS code.
Jouni Malinen [Sat, 12 Dec 2009 14:45:23 +0000 (16:45 +0200)]
Update git instructions to use more modern command line structure
Jouni Malinen [Fri, 11 Dec 2009 15:24:42 +0000 (17:24 +0200)]
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.
Jouni Malinen [Fri, 11 Dec 2009 14:29:28 +0000 (16:29 +0200)]
Fix hostapd build without RADIUS server
Jouni Malinen [Thu, 10 Dec 2009 22:15:54 +0000 (00:15 +0200)]
Merge get_seqnum_igtk() driver op with get_seqnum()
IEEE 802.11w uses distinct key indexes (4 and 5) so the same
get_seqnum() handler can be used to fetch packet number for both
TKIP/CCMP and BIP(using IGTK).
Since the new get_seqnum_igtk() handler was not actually implemented by
any driver wrapper, this may also fix BIP/IGTK sequence number reporting
with driver_nl80211.c.
Jouni Malinen [Thu, 10 Dec 2009 19:11:33 +0000 (21:11 +0200)]
Add Doxygen comments for rest of struct wpa_driver_ops members
All members have now at least minimal documentation.
Jouni Malinen [Thu, 10 Dec 2009 10:27:46 +0000 (12:27 +0200)]
Move vendor-specific IE type defines away from driver.h
These are generic IEEE 802.11 defines and do not really need to be in
the driver interface specific header file.
Jouni Malinen [Wed, 9 Dec 2009 23:21:01 +0000 (01:21 +0200)]
Add more documentation for driver ops
Masashi Honma [Wed, 9 Dec 2009 21:42:54 +0000 (23:42 +0200)]
EAP-TTLS/PAP: User-Password obfuscation for zero length password
The password in User-Password AVP is padded to a multiple of 16 bytes
on EAP-TTLS/PAP. But when the password length is zero, no padding is
added. It doesn't cause connectivity issue. In fact, I could connect
with hostapd RADIUS server with zero length password.
I think it's better for obfuscation to pad the 16 bytes data when the
password length is zero with this patch.
Jouni Malinen [Wed, 9 Dec 2009 20:06:43 +0000 (22:06 +0200)]
hostapd: Remove unused bridge_packets configuration option
There was code for configuring this, but no driver wrapper actually
implements the actual setting. Remove this for now to reduce potential
confusion and to simply the driver interface.
Jouni Malinen [Wed, 9 Dec 2009 19:57:50 +0000 (21:57 +0200)]
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).
Jouni Malinen [Wed, 9 Dec 2009 19:38:14 +0000 (21:38 +0200)]
Remove unused rate flags from driver use
These are not really used and can be removed to clean up the driver
interface definition. The only remaining flag (HOSTAPD_RATE_BASIC) can
be removed once the basic rate set indication can be handled
differently.
Jouni Malinen [Wed, 9 Dec 2009 14:49:28 +0000 (16:49 +0200)]
Merge bss_add/bss_remove drivers ops into if_add/if_remove
if_add/if_remove can now be used as the generic driver ops for adding
and removing virtual interfaces of various types. In addition,
driver_nl80211.c is now including this code unconditionally, so that
the functions are not limited only for hostapd.
Jouni Malinen [Wed, 9 Dec 2009 13:47:20 +0000 (15:47 +0200)]
Remove unused if_update() driver op
Masashi Honma [Mon, 7 Dec 2009 19:35:35 +0000 (21:35 +0200)]
Fix driver_bsd.c build
On NetBSD 5.0.1, driver_bsd.c build fails with message below.
../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_associate':
../src/drivers/driver_bsd.c:1170: warning: implicit declaration of function 'wpa_driver_bsd_set_auth_alg'
../src/drivers/driver_bsd.c: At top level:
../src/drivers/driver_bsd.c:1204: error: static declaration of 'wpa_driver_bsd_set_auth_alg' follows non-static declaration
../src/drivers/driver_bsd.c:1170: error: previous implicit declaration of 'wpa_driver_bsd_set_auth_alg' was here
gmake: *** [../src/drivers/driver_bsd.o] Error 1
This patch solves this issue.
Jouni Malinen [Sun, 6 Dec 2009 17:50:40 +0000 (19:50 +0200)]
Add support for building IEEE 802.11n support into wpa_supplicant AP
Jouni Malinen [Sun, 6 Dec 2009 17:48:25 +0000 (19:48 +0200)]
Fix conditional EAP-SIM/AKA DB code selection
Jouni Malinen [Sun, 6 Dec 2009 17:41:47 +0000 (19:41 +0200)]
Move IEEE 802.11n HT management code into a separate file
Jouni Malinen [Sun, 6 Dec 2009 17:17:54 +0000 (19:17 +0200)]
Remove unnecessary CONFIG_IEEE80211N use
Jouni Malinen [Sun, 6 Dec 2009 16:54:58 +0000 (18:54 +0200)]
Remove unused phytype RX info variable
Jouni Malinen [Sun, 6 Dec 2009 16:48:30 +0000 (18:48 +0200)]
Remove unused hostapd reconfig code
Jouni Malinen [Sun, 6 Dec 2009 16:30:12 +0000 (18:30 +0200)]
Fix some issues with test program builds
Jouni Malinen [Sun, 6 Dec 2009 16:23:53 +0000 (18:23 +0200)]
Move EAP-SIM DB conditional build into hostapd
Jouni Malinen [Sun, 6 Dec 2009 16:10:52 +0000 (18:10 +0200)]
Move test_x509v3 into the new tests subdirectory
Jouni Malinen [Sun, 6 Dec 2009 15:57:23 +0000 (17:57 +0200)]
Remove forgotten asn1_test build target
This is now in tests/Makefile.
Jouni Malinen [Sun, 6 Dec 2009 15:53:59 +0000 (17:53 +0200)]
Remove conditional no-RADIUS build from src/radius
Make it responsibility of the src/radius user to handle conditional
build rules.
Jouni Malinen [Sun, 6 Dec 2009 15:18:28 +0000 (17:18 +0200)]
Resolve circular library references with --start-group
src/crypto/libcrypto.a and src/tls/libtls.a have circular references
and will need special handling with the linker at least for the time
being. This could be cleaned up eventually, but for now, provide a
mechanism to get the programs linked.
Jouni Malinen [Sun, 6 Dec 2009 14:45:36 +0000 (16:45 +0200)]
Move asn1_test.c into tests subdirectory and split it in two
The new test-asn1 and test-x509 tools are built using libraries
from src/{utils,crypto,tls}. Currently, cross dependencies between
crypto and tls are still preventing the test-x509 from being linked
properly.
Jouni Malinen [Sun, 6 Dec 2009 14:33:19 +0000 (16:33 +0200)]
Move hlr_auc_gw into hostapd directory
This is a separate program and is used mainly with hostapd, so it is
better to move this into the hostapd subdirectory now that Milenage
code has already been moved into src/crypto. Milenage was the only
generic component in hlr_auc_gw.
Jouni Malinen [Sun, 6 Dec 2009 14:27:54 +0000 (16:27 +0200)]
Add rules for building src/tls/libtls.a and use it with eap_example
eap_example is now using src/crypto/libcrypto.a and src/tls/libtls.a
instead of providing own rules for building the files for these
components. TLS library selection is temporarily disabled for
eap_example (it will be built using internal crypto/TLS), but the
configuration option for this will eventually be restored with a new
libcrypto.a configuration option.
Jouni Malinen [Sun, 6 Dec 2009 14:20:32 +0000 (16:20 +0200)]
Include functionality to support EAP-FAST unconditionally
Clean up the internal TLS implementation by removing conditional
build blocks for (mostly) EAP-FAST specific functionality. This
will increase the size a big for non-EAP-FAST builds, but is quite
helpful in making src/tls/libtls.a with single build options. If
the potential size reduction is considered significant in the future,
this can be reconsider with a more library compatible way (e.g.,
external file with registration function, etc.).
Jouni Malinen [Sun, 6 Dec 2009 14:19:13 +0000 (16:19 +0200)]
Remove unneeded CONFIG_INTERNAL_X509 and NEED_SHA256 defines