Commit Graph

3729 Commits (ca8e039fec1352e2ece4fdbd6fde92fd461565a3)
 

Author SHA1 Message Date
Jouni Malinen ca8e039fec Fix memory leaks on radius_client_send error paths
In case this function returns an error, the RADIUS message needs to
freed in the caller.

Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 8c6f80e023 Remove extra linefeed from hostapd_logger message
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Alexander Couzens a4e73a0e47 Fix potential double free and use of freed memory in RADIUS client
ieee802_1x_encapsulate_radius() frees the RADIUS message if
radius_client_send() returns error. This could have resulted in use of
freed memory and double freeing of the RADIUS message if send() fails
since the message is also left in the retransmit list. Avoid this by not
returning error to the caller in such a case.

Signed-off-by: Alexander Couzens <lynxis@c-base.org>
12 years ago
Johannes Berg da873dbb06 nl80211: Report signal strength from nl80211
Report signal strength from nl80211 events to the higher layers.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
12 years ago
Nirav Shah 024d018b55 Clean up: Replace standard lib methods with os.h ones
Some of the standard lib functions being used directly are redefined in
src/utils/os.h thus providing an abstraction. Change code to use os_*
functions instead of directly using the lib functions.

Signed-hostap: Nirav Shah <nirav.j2.shah@intel.com>
Signed-hostap: Angie Chinchilla <angie.v.chinchilla@intel.com>
12 years ago
Johannes Berg 4f68895e92 debug: Add option to log to Linux tracing
Add the option (-T) to wpa_supplicant to log all debug messages into the
kernel tracing, allowing to aggregate kernel debugging with
wpa_supplicant debugging and recording all with trace-cmd.

Since tracing has relatively low overhead and can be filtered
afterwards, record all messages regardless of log level. However, it
will honor the -K option and not record key material by default.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
12 years ago
Jouni Malinen 526ec4aee8 P2P: Use P2P Device ID attribute if Device Info not available
The "BSS p2p_dev_addr=address" command uses p2p_parse_dev_addr() to
figure out the P2P Device Address of the GO from scan results. This used
to work only if the P2P IE was received from Probe Response frames since
only those include the P2P Device Info attribute. Make this work with
Beacon frames, too, by using P2P Device ID attribute if the P2P Device
Info attribute is not present.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Bala Shanmugam 1f6c0ab872 Allow background scan period to be configured
A network block specific background scan period can now be configured
for drivers that implement internal background scan mechanism for
roaming and BSS selection.

Signed-hostap: Bala Shanmugam <bkamatch@qca.qualcomm.com>
12 years ago
Jouni Malinen 17218a7bab Interworking: Add realm to the anonymous identity from realm
If the username part in the credential does not include a realm,
generate one automatically based on the configured realm information.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen 08410f08b9 Interworking: Disconnect before trying interworking reconnection
Make the connection change on Interworking network selection cases
clearer by forcing the previous association to be dropped before trying
to start a new one.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen 83df814946 Clear previous BSSID on explicit disconnection request
There is no need to use reassociation instead of association in a case
the previous connection was explicitly disconnected.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Subrat Dash 0e28de0d2b TDLS: Add support for TDLS frame RX with bridge interfaces
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Anirban Sirkhell 4c374cde2f Add wps_cancel for hostapd_cli
Implement wps_cancel for hostapd similarly to how it was already
supported in wpa_supplicant AP mode.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen 21d996f775 P2P: Add support for preferred channel list
p2p_pref_chan configuration parameter can now be used to set the
list of preferred channel for P2P GO Negotiation. This will be used
in the priority order if the peer does not support the channel we
are trying to use as the GO (configured operating channel or the
best 2.4 GHz/5 GHz channel) for the case where a forced channel is
not used.

p2p_pref_chan=<op class:channel>,...

For example:
p2p_pref_chan=81:1,81:2,81:3,81:4,81:5,81:6

This would configure 2.4 GHz channels 1-6 as the preferred ones with
channel 1 the most preferred option.

These configuration parameters can be set in wpa_supplicant.conf and
dynamically updated with "wpa_cli set <param> <value>".

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen 564865e1d4 Stop sched_scan if requested to run full scan
This allows the ctrl_iface SCAN command to be used to run through a scan
to collect full scan results when sched_scan is in progress. sched_scan
will be re-started automatically after the full scan.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen 84949a411c Fix eapol_test build without CONFIG_PCSC=y
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Vasanthakumar Thiagarajan a0133ee1c9 nl80211: Make use of driver's capability to detect inactive stations
When drivers advertise their capability to free up inactive
stations based on ap_max_inactivity, send the inactivity period
timeout to driver in NL80211_ATTR_INACTIVITY_TIMEOUT. This
introduces a WPA_DRIVER_FLAGS (WPA_DRIVER_FLAGS_INACTIVITY_TIMER)
so that the inactivity period will be sent only when this capability
bit is set.

Signed-hostap: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
12 years ago
Vasanthakumar Thiagarajan 07f53b8cc7 wpa_supplicant: Add provision to configure inactivity period in AP mode
This patch adds a configuration in network block, ap_max_inactivity, for
station's inactivity period when in AP mode. The time period is
configured in seconds, by default 300 seconds.

Signed-hostap: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
12 years ago
Jouni Malinen 17e729d49c Sync with include/linux/nl80211.h from wireless-testing.git
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 8c472816fd P2P: Do not use group idle timeout during provisioning
Use the normal group formation timeout during the provisioning phase to
avoid terminating this process too early due to group idle timeout.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen f4329aa2d0 P2P: Validate p2p_oper_channel in p2p_group_add
If the p2p_group_add command does not specify the operating channel,
make sure the operating channel set in the configuration file meets
the P2P requirements in the same way as is done with the frequency
specified as the command parameter.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen c81defea87 wlantest: Update STA info based on WPA/RSN IE in EAPOL-Key 2/4
The WPA/RSN IE in EAPOL-Key 2/4 is more reliable than the one in
(Re)Association Request frame. Update the STA info base don the
EAPOL-Key frame so that the correct cipher information is used
even if the (Re)Association Request frame is missing or corrupted
in the capture.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Aarthi Thiruvengadam e1bd4e1934 nl80211: Fix deauth/disassoc for AP mode SME-in-driver case
When the driver (or firmware) implements AP mode SME, the use of raw
management frame TX functions is not working properly at the moment. As
an initial step, convert these AP mode operations to use
NL80211_CMD_DEL_STATION and do not claim that driver provides TX status
for deauth/disassoc frames. While this does not address all use cases
(e.g., reason code is not specified in the command), this fixes number
of issues where the station does not get disconnected properly.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Todd Previte 7d39d9c9cc dbus: Make P2P group properties accessible individually
Group properties are now accessible individually. The function to retrieve
the dictionary containing the group properties is removed in favor of the
individual functions. The group member properties are removed as well as
they erroneously retrieved the group properties via the old function.

Signed-hostap: Todd Previte <toddx.a.previte@intel.com>
Signed-hostap: Angie Chinchilla <angie.v.chinchilla@intel.com>
intended-for: hostap-1
12 years ago
Masashi Honma e4e3131d68 WPS: Select the BSD license terms as the only license alternative
I changed license terms which I can change.
(email of Mon, 5 Mar 2012 22:59:02 +0900 to hostap@lists.shmoo.com)
12 years ago
Eliad Peller eb37e085a4 BSS: Fix use-after-realloc
After reallocation of the bss struct, current_bss wasn't updated and
could hold an invalid pointer (which might get dereferenced later).

Update current_bss if the pointer was changed.

Signed-hostap: Eliad Peller <eliad@wizery.com>
intended-for: hostap-1
12 years ago
Jouni Malinen e19467e161 TTLS: Fix peer challenge generation for TTLS/MSCHAPv2
Commit 30680e9332 changed the length
of the implicit challenge result to match with the exact length used
in TTLS. However, it failed to update the peer_challenge generation
to use a separate random value. Previously, this was generated as
part of the implicit challenge, but more correct way would have been
to generate a random value for it separately. Do this now to fix the
read after the allocated buffer (16 bytes after the implicit
challenge).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1
12 years ago
Johannes Berg c8c340a9f6 AP: remove ssi_signal from ap_info
It is never used.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
12 years ago
Grzegorz Bajorski 28ef705d2d P2P: Filter input parameters in p2p_serv_disc_external
p2p_ctrl_serv_disc_external() can take only one parameters "0" or "1".

Signed-hostap: Grzegorz Bajorski <grzegorz.bajorski@tieto.com>
12 years ago
Jouni Malinen 25f839c6d9 Filter station mode EAPOL RX on bridge interface based on destination
If multiple station mode radios are bridged together on the same device,
it is possible for wpa_supplicant to receive EAPOL frames from the
bridge interface and then process them separately for each interface.
This can results in problems since multiple instances of supplicant side
could end up trying to process a single 4-way handshake. Avoid this
problem by filtering bridge interface EAPOL RX based on the desctination
MAC address. It should be noted that this works only when unicast
addresses are used (e.g., with WLAN) and not with the IEEE 802.1X EAPOL
group address (e.g., most wired networks).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen bb8b1bb0fc Fix memory leak on parsing multiple network block eap entries
Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1
12 years ago
Jouni Malinen 7f41c92bd6 Interworking: Use EAP-AKA if USIM is used
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen d7b01abd5e Interworking: Support real SIM/USIM card for network selection
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen c21246f529 Interworking: Make plmn_id_match() for generic
Use separate mnc_len parameter instead of expecting the imsi parameter
to be in special MCC|MNC|-|<MSIN> format to make this function more
generic.

Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 817bb3e1c1 Interworking: Fix credential block example
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 5464bcbcff SCARD: Increase application template DO buffer size
This DO has a maximum length of 127 bytes (TS 102 221), so better use
large enough buffer when reading the record.

Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 9779e122cd SCARD: Move SIM file definitions into the C file
These are used only within pcsc_funcs.c so no need to define the
file identifiers in the header file.

Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 67303a5479 SCARD: Add function for fetching PIN retry counter
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen a8f3bfc421 SCARD: Add debug dumps of FCP template TLVs in SELECT response
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen f41ed0f845 SCARD: Reindent scard_parse_fsp_templ()
This was left at incorrect indentation level when moved to a separate
function.

Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 400020cbe8 Interworking: Update configuration file documentation for credentials
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 11e4f46a10 Interworking: Add support for certificate credentials (EAP-TLS)
This allows Interworking network selection to be used with EAP-TLS
(client certificate/private key based credential).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen 10531d2166 P2P: Fix provisioning info clearing after successful WPS step
Previously, this provisioning info was cleared using the P2P Interface
Address of the GO as the key. That did not always work in the case the
where we joined an already running group. This could result in the next
connection to that same GO skipping provision discovery. Fix this by
finding the peer entry based on its P2P Device Address instead of the
P2P Interface Address which may not always be set.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1
12 years ago
Jouni Malinen 9f85a37e03 Fix P2P-SERV-DISC-{REQ,RESP} documentation
The Service Update Indicator parameter was missing from documentation.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
12 years ago
Jouni Malinen 6979582ca6 Fix processing of channel list update events
Commit 6bf731e8ce broke handling of
EVENT_CHANNEL_LIST_CHANGED by introducing a cached copy of the driver
channel list that does not get updated even if driver changes its list.
Fix this by synchronizing the cacched wpa_s->hw.modes information
whenever EVENT_CHANNEL_LIST_CHANGED is processed. This fixes P2P channel
list updates based on regulatory domain hints that may trigger driver to
change its supported channel list.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1
13 years ago
Jouni Malinen ef48ff940b Fix CTRL-EVENT-DISCONNECTED event for locally generated disconnection
When wpa_supplicant disconnects, e.g., due to authentication timeout,
we need to go through the EVENT_DISASSOC/DEAUTH processing similarly
to the driver triggered cases to get correct events delivered to the
ctrl_iface. Fix this by calling wpa_supplicant_event() in these cases
and by filtering out the confusing CTRL-EVENT-DISCONNECTED event with
all zeros BSSID.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
13 years ago
Jouni Malinen 75c208b9db P2P: Fix p2p_cancel to return success if GO Negotiation is stopped
If a GO Negotiation peer is found, wpas_p2p_stop_find() stops the
negotiation and p2p_cancel can return success.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
13 years ago
Jouni Malinen 1affa36cb5 WPS: Invalidate wildcard PIN on other radios after successful use
If a wildcard PIN is used on any of the radios that hostapd is
controlling, invalidate the matching PIN on all the other radios
to avoid multiple uses of the same PIN.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
13 years ago
Jouni Malinen 85ea132a13 P2P: Use scan optimization for post-provisioning connection
Since P2P GO cannot change the SSID after WPS provisioning step, we
can use the specific SSID for the scan for data connection. In addition,
mark this as p2p_probe to avoid unnecessary use of 802.11b rates.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
13 years ago
Jouni Malinen 8e64f258c6 P2P: Optimize provisioning step scan for join-a-group sequence
Copy the SSID and frequency of the selected group into go_params in
join-a-running-group case so that the scan optimization can be used for
the provisioning step similarly to the case of group formation. This
uses a specific SSID and a single channel scan to avoid unnecessary
frames during the step.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
13 years ago