Commit graph

3117 commits

Author SHA1 Message Date
Johannes Berg 911e97e400 DBus: Refactor array adding, add binary arrays
Some new code we're working on will require the dbus type "aay" (an
array of arrays of bytes). To add this, refactor the array code to
reduce code duplication by given a type string to the array starting
code, and also add code to create and parse such arrays from or into an
array of struct wpabuf respectively.

Since there's no unique DBus type for this, add a "fake"
WPAS_DBUS_TYPE_BINARRAY type that is separate from the regular DBus
types for parsing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-06-12 14:47:49 -07:00
Fabien Marotte 58f80e2aeb DBus: Move wpas_dbus_new_decompose_object_path()
Moved wpas_dbus_new_decompose_object_path from dbus_new_handlers.c
to dbus_new_helpers.c.

Signed-off-by: Fabien Marotte <fabienx.marotte@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-06-12 14:41:41 -07:00
Jean-Michel Bachot 4b6baa2f5e P2P: Add group started notification
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-06-12 14:35:37 -07:00
Johannes Berg dd8a7e0547 P2P: Add wpas_notify_p2p_provision_discovery()
Add a notification for P2P provision discovery status/result.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-06-12 14:31:56 -07:00
Jayant Sane 349b213cc8 P2P: Add callback for provision discovery failure
When provision discovery fails, this new callback will be called
so P2P users can react to the failure.

Signed-off-by: Jayant Sane <jayant.sane@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-06-12 14:26:22 -07:00
Jayant Sane 6b56cc2d97 P2P: Retry provision discovery requests in IDLE state
Since the peer may not be in Listen state when the provision discovery
request is sent, try to send the request again number of times when in
IDLE state. This was already done when p2p_find is in progress, but this
commit adds retries to the case where no other P2P operations are in
progress.

Signed-off-by: Jayant Sane <jayant.sane@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-06-12 14:20:39 -07:00
Jouni Malinen 6b98a33c86 Fix a compiler warning on WPS-AP-without-UPnP builds 2011-05-31 20:11:25 +03:00
Jouni Malinen 38e24575c1 random: Add support for maintaining internal entropy store over restarts
This can be used to avoid rejection of first two 4-way handshakes every
time hostapd (or wpa_supplicant in AP/IBSS mode) is restarted. A new
command line parameter, -e, can now be used to specify an entropy file
that will be used to maintain the needed state.
2011-05-31 20:07:11 +03:00
Jouni Malinen ceb34f250a Remove compiler warning for non-P2P builds 2011-05-27 19:06:05 +03:00
Jouni Malinen f07ead6af9 nl80211: Re-order functions to group AP/hostapd specific code
Get rid of separate ifdef/endif blocks for AP specific and hostapd
specific code, i.e., only have one main block of code for each case.
2011-05-27 19:02:04 +03:00
Jouni Malinen f7b3920c90 nl80211: Enable more AP callbacks for non-hostapd AP mode
Some of these are required for proper functionality (like
get_seqnum); others may not be needed yet, but including them
allows some extra ifdef/endif blocks to be removed.
2011-05-27 18:54:36 +03:00
Eliad Peller 257da77362 nl80211: Implement set_rate_sets for non-hostapd AP case
.set_rate_sets is not defined for non-hostapd, which prevents
configuring basic_rates when working as P2P GO.

Signed-off-by: Eliad Peller <eliad@wizery.com>
2011-05-27 18:41:46 +03:00
Ken Zhu 41fd1d9e9a atheros: Fix auth_alg configuration for static WEP
When IEEE 802.1X is not enabled, driver_atheros.c needs to know how
to set authentication algorithms for static WEP.
2011-05-20 18:27:53 +03:00
Jouni Malinen 6d28fb9627 Fix regression in RSN pre-authentication candidate list generation
Processing of the scan results for RSN pre-authentication candidates
was moved to happen before the network was selected. This resulted in
all candidates being dropped due to no SSID having been configured.
Fix this by moving the processing to happen after the network has
been selected. Since the raw scan results are not available at that
point, use the BSS table instead of scan results to fetch the
information.
2011-05-19 17:52:46 +03:00
Vinay Adella 86795546f7 WPS UPnP: Fix UPnP initialization for non-bridge case with some drivers
If the driver wrapper is setting up the interface up only at commit(),
UPnP initialization fails. Fix that by moving UPnP setup to happen after
the driver commit() call.
2011-05-19 12:55:47 +03:00
Jouni Malinen fa5165586f WPS: Add a workaround for Windows 7 capability discovery for PBC
Windows 7 uses incorrect way of figuring out AP's WPS capabilities by
acting as a Registrar and using M1 from the AP. The config methods
attribute in that message is supposed to indicate only the configuration
method supported by the AP in Enrollee role, i.e., to add an external
Registrar. For that case, PBC shall not be used and as such, the
PushButton config method is removed from M1 by default. If pbc_in_m1=1
is included in the configuration file, the PushButton config method is
left in M1 (if included in config_methods parameter) to allow Windows 7
to use PBC instead of PIN (e.g., from a label in the AP).
2011-05-17 19:53:02 +03:00
Dmitry Shmidt bcb90f750d Add TDLS support to Android.mk 2011-05-16 22:29:43 +03:00
Ben Greear 60eda5e47d Better messages when channel cannot be used in AP mode
Log messages letting user know that the channel cannot
be used because it is flagged unusable.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-05-16 22:01:11 +03:00
Jouni Malinen 5dcfb6830e Include nl80211 driver wrapper in default configuration for hostapd 2011-05-16 21:07:47 +03:00
Jouni Malinen 64f992652d P2P: Include operating class 124 (channels 149,153,157,161)
When using the p2p_oper_reg_class configuration option instead of
p2p_group_add freq parameter, the operating class 124 was not
processed correctly. Include that class in the list of 5 GHz classes
for the p2p_oper_reg_class to resolve this.
2011-05-16 21:07:05 +03:00
Jouni Malinen eec92ec597 WPS: Remove obsolete note about lack for WPS ER support 2011-05-16 21:06:08 +03:00
Jouni Malinen 117e812d06 Update BSS table entry if roaming event indicates frequency change
This is needed to make sure the frequency in the BSS table entry
remains up-to-date if the AP changes its operating frequency.
2011-05-16 19:19:30 +03:00
Jouni Malinen 46957a9b2d nl80211: Filter out duplicated BSS table entries from scan results
cfg80211 maintains separate BSS table entries for APs if the same
BSSID,SSID pair is seen on multiple channels. wpa_supplicant does
not use frequency as a separate key in the BSS table, so filter out
duplicated entries. Prefer associated BSS entry in such a case in
order to get the correct frequency into the BSS table.
2011-05-16 19:18:42 +03:00
Jouni Malinen f5a8d42229 nl80211: Fetch assoc_freq from scan table for connect event
When kernel-based SME is used, use the scan table to find a BSS entry
for the associated AP when processing connected event.
2011-05-16 18:35:42 +03:00
Jouni Malinen 0725cc7b7e Enable CONFIG_DRIVER_NL80211=y in the default configuration
nl80211 should be preferred over WEXT with any recent Linux kernel
version.
2011-04-21 20:41:01 +03:00
Jouni Malinen b8281964af Add workaround for race condition with AssocResp TX status
It may take some time for the TX status to be delivered for a
(Re)Association Response frame and if any Data frames are received
during that time, they may end up getting dropped as Class 3 frames in
not-associated state. This results in a Disassociation frame being sent
to the station and it assuming that the association has been lost.

Work around the issue by remembering that the (Re)Association Request
has already been accepted and skip the Deauth/Disassoc sending because
of the possible Class 3 frames before the TX status callback is
received.
2011-04-15 19:26:28 +03:00
Dmitry Shmidt 60b24b0de4 Add 'signal_poll' command interface
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-04-15 18:52:01 +03:00
Dmitry Shmidt 746bba1a5e Prevent explicit scan command during scan or association
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-04-15 18:40:29 +03:00
Guy Eilam 5b73735ba0 hostapd: Fix interfaces.iface initialization
Set all the interfaces.iface pointers to NULL after the allocation of
that memory block for cases those pointers are accessed during each of
the interfaces initialization process (hostapd_interface_init()). One
example for such case is during WPS initialization when the code tries
to fetch the uuid from each of the interfaces.

Signed-off-by: Guy Eilam <guy@wizery.com>
2011-04-15 18:13:04 +03:00
Jouni Malinen 849b5dc78b Update driver country info on 'SET country <value>' 2011-04-15 17:00:01 +03:00
Yi Zhu ca79385ab5 bsd: Add support for setting HT values in IFM_MMASK 2011-04-14 22:22:24 +03:00
Jouni Malinen fe655a8402 Add sanity checks for fseek and ftell return values
In theory, these calls could fail, but it is not really likely to
happen in practice in the use case here. Anyway, check that they do
not return an error before accepting the length of the file.
2011-04-14 20:22:21 +03:00
Jouni Malinen 4a26df7107 IBSS RSN: peer->addr is an array so it cannot be NULL 2011-04-14 20:18:12 +03:00
Jouni Malinen c8d88a145b WPS: Fix off-by-one check in vendor extension parsing 2011-04-14 20:02:31 +03:00
Jouni Malinen 35530d1472 driver_test: Check set_ssid len before trying to hexdump the SSID 2011-04-14 19:52:26 +03:00
Jouni Malinen 95cb2d88e9 TDLS: Verify that scan results for BSS are available before using them 2011-04-14 19:50:26 +03:00
Jouni Malinen 6e432d3f10 WPS: Use strict validation of (Re)AssocReq only if IEs are known 2011-04-14 02:58:35 +03:00
Jouni Malinen 5dac11e027 WPS: Use strict validation of (Re)AssocResp only if IEs are known 2011-04-14 02:57:24 +03:00
Jouni Malinen 0bdaa741cd OpenSSL: Use consistent SSL_get_app_data validation in tls_verify_cb
The returned value cannot really be NULL, but better keep this
function consistent on whether the returned value is checked or not.
2011-04-14 02:50:52 +03:00
Jouni Malinen 066608f3ff Avoid theoretical NULL pointer dereference during TLS reassemble
This function does not get called with in_data == NULL in practice, but
it seems to be at least partly prepared for that case, so better make it
consistent by handling the NULL value throughout the function.
2011-04-14 02:45:14 +03:00
Jouni Malinen b211f3eb71 Add sanity checks to EVENT_RX_PROBE_REQ event data
Both the SA and IEs from the received Probe Request frames must be
included and the Probe Request RX callback functions may assume that
these are not NULL.
2011-04-14 02:39:25 +03:00
Jouni Malinen 2a522e7192 Avoid theoretical NULL pointer dereference from debug code
The change to use wpa_dbg() in wpa_sm_parse_own_wpa_ie() could result
in a NULL pointer dereference if the function were called when WPA
state machine has not been initialized. While this cannot really
happen in practice, it is better to be prepared for that since that
was the case before the wpa_dbg() change.
2011-04-14 02:32:07 +03:00
Jouni Malinen f4fbba8cf9 Distinguish empty concatenated vendor-specific IE from missing one
When comparing BSS table entries, handle empty concatenated
vendor-specific IE differently from completely missing IE. This
does not change anything for the only currently compared IE that
can be fragmented (WPS IE), but it is better to have the generic
code here ready for any possible new IE that could be used in
with zero-length data.
2011-04-14 02:25:43 +03:00
Jouni Malinen 714b8b5378 P2P: Fix memory leak in UPnP service discovery request processing 2011-04-14 01:33:26 +03:00
Jouni Malinen 74727a7b32 Use type cast to get rid of implicit sign extension
The size_t value here can be 64-bit and result in implicit sign
extension. In this particular case, that gets masked out by
host_to_be32(), so there is no practical difference, but it is better
to get rid of the 64-bit variable explicitly.
2011-04-14 01:27:38 +03:00
Jouni Malinen f8b5f7dc6b TNC: Fix TNC_{TNCC,TNCS}_ReportMessageTypes copy type
The supportedTypes parameter is a list of TNC_MessageType values
and the buffer to be copied should use size of TNC_MessageType, not
TNC_MessageTypeList. In practice, these are of same length on most
platforms, so this is not a critical issue, but anyway, the correct
type should be used.
2011-04-13 23:10:21 +03:00
Jouni Malinen a04bf77209 TDLS: Validate FTIE length before processing it
This avoids reading past the end of the IE buffer should the FTIE
be too short. In addition, one debug hexdump was using uninitialized
pointer to the FTIE buffer, so fixed it to use the pointer from the
parse data.
2011-04-13 22:14:22 +03:00
Jouni Malinen 62c0d27ed3 P2P: Clear go_dev_addr for group started events if it is not known
Better make sure the address value included in the event message gets
cleared in case the GO Device Address is not known for some reason.
Previously, this could potentially have been some random data from
stack should we ever hit the case where wpa_s->current_ssid is not
set (which should not really happen in normal use cases).
2011-04-13 22:03:52 +03:00
Jouni Malinen be5b1e86a3 Make the example action script less likely to result in failures
Use "=" instead of "==" and add an example statement between "then"
and "fi".
2011-04-13 19:55:34 +03:00
Yi Zhu d4a747f006 bsd: Fix buffer size for routing socket with IPv6 disabled
AF_INET6 is not always enabled by default, so use AF_INET instead. In
addition, use the old fixed length, 2048, as a failover value if the
sysctl fails for any reason.
2011-04-12 23:09:14 +03:00