mech_eap.git
8 years agoWPS: Reconnect for a failed data connection when STA_AUTOCONNECT is 0
Sunil Dutt [Mon, 16 Nov 2015 15:02:56 +0000 (20:32 +0530)]
WPS: Reconnect for a failed data connection when STA_AUTOCONNECT is 0

If "STA_AUTOCONNECT 0" has been used to disable automatic connection on
disconnection event and the driver indicates a failure for the data
connection after successful WPS handshake, it is possible to hit a case
where wpa_s->disconnected is set to 1 and further attempts to connect
shall stop.

While "STA_AUTOCONNECT 0" is used to disable automatic reconnection
attempts in general, this specific WPS case can benefit from trying
again even with that configuration for a short period of time. Extend
the wpa_supplicant re-enable-networks-after-WPS 10 second timeout to
apply for ignoring disabled STA_AUTOCONNECT immediately after a WPS
provisioning step.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: D-Bus P2P and InvitationReceived
Jouni Malinen [Tue, 17 Nov 2015 16:03:06 +0000 (18:03 +0200)]
tests: D-Bus P2P and InvitationReceived

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agodbus: Fix memory leak in sending InvitationReceived signal
MAYANK HAARIT [Tue, 17 Nov 2015 06:19:57 +0000 (06:19 +0000)]
dbus: Fix memory leak in sending InvitationReceived signal

Free the message after message send in
wpas_dbus_signal_p2p_invitation_received() to avoid leaking memory.

Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
8 years agohostapd: Process MAC ACLs on a station association event (SME in driver)
Anton Nayshtut [Thu, 22 Oct 2015 16:48:04 +0000 (19:48 +0300)]
hostapd: Process MAC ACLs on a station association event (SME in driver)

Now hostapd will use station MAC-based permissions according to the
macaddr_acl policy also for drivers which use AP SME offload, but do not
support NL80211_CMD_SET_MAC_ACL for offloading MAC ACL processing. It
should be noted that in this type of case the association goes through
and the station gets disconnected immediately after that.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRSN: Remove check for proactive_key_caching while setting PMK offload
Amarnath Hullur Subramanyam [Thu, 12 Nov 2015 20:37:04 +0000 (12:37 -0800)]
RSN: Remove check for proactive_key_caching while setting PMK offload

wpa_sm_key_mgmt_set_pmk() was checking for proactive_key_caching to be
enabled before setting the PMK to the driver. This check is not required
and would mandate configuration setting of okc or proactive_key_caching
for cases which were not necessary.

Signed-off-by: Amarnath Hullur Subramanyam <amarnath@qca.qualcomm.com>
8 years agoExtend QCA roam event with subnet change indication
Ravi Joshi [Mon, 16 Nov 2015 17:00:35 +0000 (19:00 +0200)]
Extend QCA roam event with subnet change indication

The new attribute can be used with
QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH to indicate whether the IP
subnet was detected to have changed when processing offloaded roam/key
management.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agodbus: Do not use pointer arithmetic with a void pointer
Samuel Tan [Thu, 5 Nov 2015 19:08:22 +0000 (11:08 -0800)]
dbus: Do not use pointer arithmetic with a void pointer

This failed to compile on x86 gcc due to pointer arithmetic on a void
pointer.

Signed-off-by: Samuel Tan <samueltan@google.com>
8 years agoAndroid: Use libdbus rather than dbus-1
Samuel Tan [Thu, 5 Nov 2015 18:48:48 +0000 (10:48 -0800)]
Android: Use libdbus rather than dbus-1

The upstream wpa_supplicant uses the dbus-1 library when it is compiled
with D-Bus support. In Android, we imported the D-Bus shared libraries
under the name "libdbus", so use this shared library instead of dbus-1
when compiling wpa_supplicant with D-Bus support.

Signed-off-by: Samuel Tan <samueltan@google.com>
8 years agoDocument passive_scan option for wpa_supplicant.conf
Ben Greear [Thu, 5 Nov 2015 00:49:39 +0000 (19:49 -0500)]
Document passive_scan option for wpa_supplicant.conf

This should save the next person to need this behavior some time.

Signed-off-by: Ben Greear <greearb@candelatech.com>
8 years agonl80211: Add debug message for passive scanning
Ben Greear [Thu, 5 Nov 2015 00:49:38 +0000 (19:49 -0500)]
nl80211: Add debug message for passive scanning

This is more obvious than looking for the lack of 'Scan SSID' messages.

Signed-off-by: Ben Greear <greearb@candelatech.com>
8 years agotests: D-Bus SaveConfig
Jouni Malinen [Sun, 15 Nov 2015 17:08:05 +0000 (19:08 +0200)]
tests: D-Bus SaveConfig

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agodbus: Add SaveConfig to update configuration file
Purushottam Kushwaha [Tue, 3 Nov 2015 07:01:27 +0000 (07:01 +0000)]
dbus: Add SaveConfig to update configuration file

This is similar to SAVE_CONFIG on control interface, which allow users
to update the configuration file.

Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agoP2P: Fix a typo in debug message
Purushottam Kushwaha [Tue, 3 Nov 2015 07:06:55 +0000 (07:06 +0000)]
P2P: Fix a typo in debug message

Signed-off-by: Dilshad Ahmad <dilshad.a@samsung.com>
8 years agodbus: Fix a copy-paste error in debug print
Purushottam Kushwaha [Tue, 3 Nov 2015 07:03:58 +0000 (07:03 +0000)]
dbus: Fix a copy-paste error in debug print

Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agotests: EAP-pwd protocol tests
Jouni Malinen [Sun, 1 Nov 2015 16:25:40 +0000 (18:25 +0200)]
tests: EAP-pwd protocol tests

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-pwd peer: Fix error path for unexpected Confirm message
Jouni Malinen [Sun, 1 Nov 2015 17:35:44 +0000 (19:35 +0200)]
EAP-pwd peer: Fix error path for unexpected Confirm message

If the Confirm message is received from the server before the Identity
exchange has been completed, the group has not yet been determined and
data->grp is NULL. The error path in eap_pwd_perform_confirm_exchange()
did not take this corner case into account and could end up
dereferencing a NULL pointer and terminating the process if invalid
message sequence is received. (CVE-2015-5316)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-pwd server: Fix last fragment length validation
Jouni Malinen [Sun, 1 Nov 2015 16:24:16 +0000 (18:24 +0200)]
EAP-pwd server: Fix last fragment length validation

All but the last fragment had their length checked against the remaining
room in the reassembly buffer. This allowed a suitably constructed last
fragment frame to try to add extra data that would go beyond the buffer.
The length validation code in wpabuf_put_data() prevents an actual
buffer write overflow from occurring, but this results in process
termination. (CVE-2015-5314)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-pwd peer: Fix last fragment length validation
Jouni Malinen [Sun, 1 Nov 2015 16:18:17 +0000 (18:18 +0200)]
EAP-pwd peer: Fix last fragment length validation

All but the last fragment had their length checked against the remaining
room in the reassembly buffer. This allowed a suitably constructed last
fragment frame to try to add extra data that would go beyond the buffer.
The length validation code in wpabuf_put_data() prevents an actual
buffer write overflow from occurring, but this results in process
termination. (CVE-2015-5315)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been used
Jouni Malinen [Sun, 25 Oct 2015 21:02:14 +0000 (23:02 +0200)]
WNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been used

The AP is not expected to send out a WNM-Sleep Mode Response frame
without the STA trying to use WNM-Sleep Mode. Drop such unexpected
responses to reduce unnecessary processing of the frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Start WNM-Sleep Mode in wnm_action_proto*
Jouni Malinen [Sun, 25 Oct 2015 21:01:21 +0000 (23:01 +0200)]
tests: Start WNM-Sleep Mode in wnm_action_proto*

This is needed to avoid test case failures with additional state
validation in wpa_supplicant.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WNM Action protocol testing (PMF disabled)
Jouni Malinen [Sun, 25 Oct 2015 13:47:31 +0000 (15:47 +0200)]
tests: WNM Action protocol testing (PMF disabled)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use
Jouni Malinen [Sun, 25 Oct 2015 13:45:50 +0000 (15:45 +0200)]
WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use

WNM Sleep Mode Response frame is used to update GTK/IGTK only if PMF is
enabled. Verify that PMF is in use before using this field on station
side to avoid accepting unauthenticated key updates. (CVE-2015-5310)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix wpas_ctrl_network for builds without Suite B support
Jouni Malinen [Sun, 1 Nov 2015 22:30:00 +0000 (00:30 +0200)]
tests: Fix wpas_ctrl_network for builds without Suite B support

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoDescribe preferred mechanism for submitting contributions
Jouni Malinen [Sun, 1 Nov 2015 19:15:08 +0000 (21:15 +0200)]
Describe preferred mechanism for submitting contributions

Add pointers to the mailing list and some brief guidance on preferred
patch format.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUse "STATUS-NO_EVENTS" instead of "STATUS" in get_wpa_status function
Somdas Bandyopadhyay [Sun, 1 Nov 2015 06:53:45 +0000 (12:23 +0530)]
Use "STATUS-NO_EVENTS" instead of "STATUS" in get_wpa_status function

Using "STATUS" command triggers CTRL-EVENT-STATE-CHANGE and
CTRL-EVENT-CONNECTED (if connected to some AP) events. These events
cause problems in Android WifiStateMachine in Marshmallow. Due to these
events WifiStateMachine sometimes disconnects the OSU SSID connection,
while hs20-osu-client waits for IP address.

Signed-off-by: Somdas Bandyopadhyay <somdas.bandyopadhyay@intel.com>
8 years agowpa_supplicant: Add GTK RSC relaxation workaround
Max Stepanov [Wed, 14 Oct 2015 09:26:33 +0000 (12:26 +0300)]
wpa_supplicant: Add GTK RSC relaxation workaround

Some APs may send RSC octets in EAPOL-Key message 3 of 4-Way Handshake
or in EAPOL-Key message 1 of Group Key Handshake in the opposite byte
order (or by some other corrupted way). Thus, after a successful
EAPOL-Key exchange the TSC values of received multicast packets, such as
DHCP, don't match the RSC one and as a result these packets are dropped
on replay attack TSC verification. An example of such AP is Sapido
RB-1732.

Work around this by setting RSC octets to 0 on GTK installation if the
AP RSC value is identified as a potentially having the byte order issue.
This may open a short window during which older (but valid)
group-addressed frames could be replayed. However, the local receive
counter will be updated on the first received group-addressed frame and
the workaround is enabled only if the common invalid cases are detected,
so this workaround is acceptable as not decreasing security
significantly. The wpa_rsc_relaxation global configuration property
allows the GTK RSC workaround to be disabled if it's not needed.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
8 years agoRestore previous wpa_state in scan-only result handler
Jouni Malinen [Sun, 1 Nov 2015 18:26:35 +0000 (20:26 +0200)]
Restore previous wpa_state in scan-only result handler

The SCAN TYPE=ONLY results do not trigger a connection operation
automatically. As such, there was no explicit operation that would
change wpa_state after such a scan-only operation and WPA_SCANNING state
could have been left in effect until the next operation is triggered by
an external command. This is not desirable, so restore the wpa_state
that was in use when the scan was started in case WPA_SCANNING state is
still set when the scan operation completes.

This was triggered by the following mac80211_hwsim test sequence:
dbus_wps_oom scan_trigger_failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWNM: Clear BSS TM data if already associated with preferred candidate
Jouni Malinen [Sun, 1 Nov 2015 18:09:11 +0000 (20:09 +0200)]
WNM: Clear BSS TM data if already associated with preferred candidate

Previously, wnm_deallocate_memory() was called only if we decided to
move to another BSS at the completion of an accepted BSS Transition
Management Request. This resulted in the candidate information being
left in effect for the following scan operation if we were already
associated with the preferred candidate. This could result in unexpected
behavior in the following connection attempt.

Fix this by clearing the candidate information even if we do not need to
roam to another BSS.

This was triggered with mac80211_hwsim test cases in this sequence:
wnm_bss_tm ap_track_sta_force_2ghz

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: EAP-pwd with Brainpool EC
Jouni Malinen [Sun, 1 Nov 2015 09:30:23 +0000 (11:30 +0200)]
tests: EAP-pwd with Brainpool EC

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-pwd: Add support for Brainpool Elliptic Curves
Jouni Malinen [Sun, 1 Nov 2015 09:29:06 +0000 (11:29 +0200)]
EAP-pwd: Add support for Brainpool Elliptic Curves

This allows the IKE groups 27-30 (RFC 6932) to be used with OpenSSL
1.0.2 and newer.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More SET_CRED coverage
Jouni Malinen [Sat, 31 Oct 2015 23:03:45 +0000 (01:03 +0200)]
tests: More SET_CRED coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: mesh_basic_rates
Jouni Malinen [Sat, 31 Oct 2015 22:50:17 +0000 (00:50 +0200)]
tests: mesh_basic_rates

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional SET_NETWORK coverage
Jouni Malinen [Sat, 31 Oct 2015 22:46:09 +0000 (00:46 +0200)]
tests: Additional SET_NETWORK coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional wpa_supplicant SET ctrl_iface command coverage
Jouni Malinen [Sat, 31 Oct 2015 22:28:35 +0000 (00:28 +0200)]
tests: Additional wpa_supplicant SET ctrl_iface command coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agodbus: Remove unused dict helper functions
Jouni Malinen [Sat, 31 Oct 2015 22:16:57 +0000 (00:16 +0200)]
dbus: Remove unused dict helper functions

There are no callers for these helper functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_cli: Add support for vendor_elem_* commands
Purushottam Kushwaha [Thu, 29 Oct 2015 07:05:48 +0000 (07:05 +0000)]
wpa_cli: Add support for vendor_elem_* commands

Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agotests: Clear config_methods at the end of wpas_ctrl_set_wps_params
Jouni Malinen [Sat, 31 Oct 2015 17:45:59 +0000 (19:45 +0200)]
tests: Clear config_methods at the end of wpas_ctrl_set_wps_params

It was possible for dev[2] to be left with non-default config_methods
parameter at the end of the test case and that could result issues in
following test cases. This hit a failure in the following sequence:
wpas_ctrl_set_wps_params p2ps_channel_active_go_and_station_same

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP peer: Clear ignore flag in INITIALIZE state
Jouni Malinen [Sat, 31 Oct 2015 17:39:23 +0000 (19:39 +0200)]
EAP peer: Clear ignore flag in INITIALIZE state

While this is not part of RFC 4137, the way m.check(eapReqData) is
implemented in wpa_supplicant allows an EAP method to not update the
ignore value even though each such call is really supposed to get a new
response. It seems to be possible to hit a sequence where a previous EAP
authentication attempt terminates with sm->ignore set from the last
m.check() call and the following EAP authentication attempt could fail
to go through the expected code path if it does not clear the ignore
flag. This is likely only hit in some error cases, though. The hwsim
test cases could trigger this with the following sequence:
eap_proto_ikev2 ap_wps_m1_oom

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd test programs for checking libwpa_client linking
Jouni Malinen [Sat, 31 Oct 2015 17:11:09 +0000 (19:11 +0200)]
Add test programs for checking libwpa_client linking

libwpa_test1 and libwpa_test2 targets can now be used to check
libwpa_client linking for static and shared library cases respectively.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_supplicant/Makefile: Fix libwpa_client build
Jörg Krause [Thu, 29 Oct 2015 10:52:52 +0000 (11:52 +0100)]
wpa_supplicant/Makefile: Fix libwpa_client build

Building libwpa_client requires src/utils/common.c for bin_clear_free()
else loading the library fails with:

Error relocating /usr/lib/libwpa_client.so: bin_clear_free: symbol not found

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
8 years agoTLS: Fix memory leak with multiple TLS server instances
Jouni Malinen [Sat, 31 Oct 2015 16:15:22 +0000 (18:15 +0200)]
TLS: Fix memory leak with multiple TLS server instances

When using CONFIG_TLS=internal and starting hostapd with multiple
configuration files that each initialize TLS server, the server
certificate and related data was not freed for all the interfaces on
exit path. Fix this by freeing the credential data that is stored
separately for each call to tls_init().

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix wifi_display_parsing
Jouni Malinen [Sat, 31 Oct 2015 14:31:03 +0000 (16:31 +0200)]
tests: Fix wifi_display_parsing

Due to a typo in a function name, this test case ended up running
without the final cleanup. That could result in the following test cases
failing, e.g., when running this sequence:
wifi_display_parsing dbus_p2p_go_neg_auth

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: EAP-SIM DB error cases
Jouni Malinen [Sat, 31 Oct 2015 14:28:33 +0000 (16:28 +0200)]
tests: EAP-SIM DB error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoeap_sim_db: Implement eap_sim_db_expire_pending()
Frederic Leroy [Wed, 10 Jun 2015 11:15:24 +0000 (13:15 +0200)]
eap_sim_db: Implement eap_sim_db_expire_pending()

Expire pending DB request for EAP-SIM/AKA/AKA'. Timeout defaults to 1
second and is user configurable in hostapd.conf (eap_sim_db_timeout).

Signed-off-by: Frederic Leroy <frederic.leroy@b-com.com>
8 years agotests: VHT with 160 MHz channel width and no DFS
Jouni Malinen [Thu, 29 Oct 2015 20:51:49 +0000 (22:51 +0200)]
tests: VHT with 160 MHz channel width and no DFS

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd frequency to operating class determination for 5 GHz 100..140
Jouni Malinen [Fri, 30 Oct 2015 09:42:23 +0000 (11:42 +0200)]
Add frequency to operating class determination for 5 GHz 100..140

This extends ieee80211_freq_to_channel_ext() with knowledge of the
operating classes for the 5 GHz channels 100..140.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Add testcases for interface global properties
Dan Williams [Wed, 21 Oct 2015 16:00:55 +0000 (11:00 -0500)]
tests: Add testcases for interface global properties

Signed-off-by: Dan Williams <dcbw@redhat.com>
8 years agodbus: Expose interface globals via D-Bus properties
Dan Williams [Tue, 13 Oct 2015 16:47:46 +0000 (11:47 -0500)]
dbus: Expose interface globals via D-Bus properties

All interface globals are now exposed as D-Bus properties of type
string, and parsed via the normal interface global parsing functions.

Signed-off-by: Dan Williams <dcbw@redhat.com>
8 years agodbus: Pass property description to getters/setters
Dan Williams [Tue, 13 Oct 2015 16:45:33 +0000 (11:45 -0500)]
dbus: Pass property description to getters/setters

We'll use it later for global interface properties.

Signed-off-by: Dan Williams <dcbw@redhat.com>
8 years agoRSN: Check result of EAPOL-Key frame send request
Avichal Agarwal [Tue, 27 Oct 2015 06:47:15 +0000 (06:47 +0000)]
RSN: Check result of EAPOL-Key frame send request

Provide information on whether EAPOL-Key frame was sent successfully to
kernel for transmittion. wpa_eapol_key_send() will return
>= 0 on success and < 0 on failure. After receiving EAPOL-Key msg 3/4,
wpa_supplicant sends EAPOL-Key msg 4/4 and shows CTRL-EVENT-CONNECTED
only after verifying that the msg 4/4 was sent to kernel for
transmission successfully.

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Kyeong-Chae Lim <kcya.lim@samsung.com>
8 years agoAllow -1 as value to disable frag_threshold
Matthias May [Mon, 26 Oct 2015 10:45:21 +0000 (11:45 +0100)]
Allow -1 as value to disable frag_threshold

To be consistent with the internal representation of how to disable
framentation, allow -1 as a value to disable it in configuration.

Signed-off-by: Matthias May <matthias.may@neratec.com>
8 years agoExtend the range of values for the RTS threshold
Matthias May [Mon, 26 Oct 2015 08:38:01 +0000 (09:38 +0100)]
Extend the range of values for the RTS threshold

Since we have HT rates the maximum framesize is no longer 2346. The
usual maximum size of an A-MPDU is 65535. To disable RTS, the value -1
is already internally used. Allow it in the configuration parameter.

Signed-off-by: Matthias May <matthias.may@neratec.com>
8 years agotests: Update hapd_ctrl_set_error_cases RTS/fragmentation threshold
Jouni Malinen [Wed, 28 Oct 2015 18:52:03 +0000 (20:52 +0200)]
tests: Update hapd_ctrl_set_error_cases RTS/fragmentation threshold

The previously used invalid values will become allowed with the
following commits, so change the test case to use values that both were
and will continue to be invalid to avoid unnecessary failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Add feature to start all interfaces at the same time in sync
Srinivasa Duvvuri [Tue, 22 Sep 2015 17:43:12 +0000 (10:43 -0700)]
hostapd: Add feature to start all interfaces at the same time in sync

When multiple interfaces across mutiple radios are started using a
single instance of hostapd, they all come up at different times
depending upon how long the ACS and HT scan take on each radio. This
will result in stations (that already have the AP profile) associating
with the first interfaces that comes up. For example in a dual band
radio case (2G and 5G) with ACS enabled, 2G always comes up first
because the ACS scan takes less time on 2G and this results in all
stations associating with the 2G interface first.

This feature brings up all the interfaces at the same time. The list of
interfaces specified via hostapd.conf files on the command line are all
marked as sync interfaces. All the interfaces are synchronized in
hostapd_setup_interface_complete().

This feature is turned on with '-S' commmand line option.

Signed-off-by: Srinivasa Duvvuri <sduvvuri@chromium.org>
8 years agoReserve QCA vendor specific nl80211 commands 110..114
Jouni Malinen [Mon, 26 Oct 2015 22:02:50 +0000 (00:02 +0200)]
Reserve QCA vendor specific nl80211 commands 110..114

These are reserved for QCA use.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAssign QCA commands and attributes for Tx power scaling and OTA testing
Peng Xu [Mon, 19 Oct 2015 17:38:14 +0000 (10:38 -0700)]
Assign QCA commands and attributes for Tx power scaling and OTA testing

Assign nl80211vendor commands QCA_NL80211_VENDOR_SUBCMD_OTA_TEST and
QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE as well as corresponding
attributes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: P2P device discovery and control character in Device Name
Jouni Malinen [Mon, 26 Oct 2015 21:30:48 +0000 (23:30 +0200)]
tests: P2P device discovery and control character in Device Name

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Filter control chars in group client device name similarly to peer
Hu Wang [Mon, 26 Oct 2015 21:40:59 +0000 (23:40 +0200)]
P2P: Filter control chars in group client device name similarly to peer

P2P device discovery can add peer entries based on a message directly
from a peer and from a Probe Response frame from a GO for all the P2P
Clients in the group. The former case for filtering out control
characters from the device name while the latter was not. Make this
consistent and filter both cases in the same way to avoid confusing
external programs using the device name of a P2P peer.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoTDLS: Do not send error case of TPK M3 if TX fails
Sunil Dutt [Tue, 20 Oct 2015 04:20:51 +0000 (09:50 +0530)]
TDLS: Do not send error case of TPK M3 if TX fails

There is no point in sending TPK M3 (TDLS Setup Confirm) with a failure
status if the first transmission attempt fails. Instead, just return a
failure by disabling the link rather than retransmitting the TPK M3
frame with an error status.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Fix scan flush in p2ps_channel_both_connected_same
Jouni Malinen [Sun, 25 Oct 2015 22:59:07 +0000 (00:59 +0200)]
tests: Fix scan flush in p2ps_channel_both_connected_same

Need to do this before associating with the AP and with the correct
devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Skip radius_acct_ipaddr if kernel does not support ProxyARP
Jouni Malinen [Sun, 25 Oct 2015 22:47:47 +0000 (00:47 +0200)]
tests: Skip radius_acct_ipaddr if kernel does not support ProxyARP

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix build without CONFIG_ERP=y
Jouni Malinen [Sun, 25 Oct 2015 22:42:14 +0000 (00:42 +0200)]
tests: Fix build without CONFIG_ERP=y

hmac_sha256_kdf() got pulled in only if CONFIG_ERP=y is set. Fix
test_sha256() by making the test case conditional on the function being
present.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_supplicant: Reopen debug log file upon receipt of SIGHUP signal
Lubomir Rintel [Fri, 23 Oct 2015 16:02:42 +0000 (18:02 +0200)]
wpa_supplicant: Reopen debug log file upon receipt of SIGHUP signal

This is useful for logrotate to be able to rotate the file even if the
control interface is not enabled (e.g., when using DBus).

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
8 years agoDo not write ERROR level log entries if debug file is not used
Jouni Malinen [Sun, 25 Oct 2015 18:43:15 +0000 (20:43 +0200)]
Do not write ERROR level log entries if debug file is not used

wpa_debug_reopen_file() used to write an error message at MSG_ERROR
level if it was called with last_path == NULL (the last debug log file
path not known). This is not a fatal error, but a normal case if
wpa_debug_open_file() has not been used. Remove the error message and
return success in such case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agol2_packet: Add build option to disable Linux packet socket workaround
Mohammed Shafi Shajakhan [Mon, 19 Oct 2015 07:10:42 +0000 (12:40 +0530)]
l2_packet: Add build option to disable Linux packet socket workaround

Linux packet socket workaround(*) has an impact in performance when the
workaround socket needs to be kept open to receive EAPOL frames. While
this is normally avoided with a kernel that has the issue addressed by
closing the workaround packet socket when detecting a frame through the
main socket, it is possible for that mechanism to not be sufficient,
e.g., when an open network connection (no EAPOL frames) is used.

Add a build option (CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y) to disable the
workaround. This build option is disabled by default and can be enabled
explicitly on distributions which have an older kernel or a fix for the
kernel regression.

Also remove the unused variable num_rx.

(*) Linux kernel commit 576eb62598f10c8c7fd75703fe89010cdcfff596
('bridge: respect RFC2863 operational state') from 2012 introduced a
regression for using wpa_supplicant with EAPOL frames and a station
interface in a bridge.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
8 years agotests: WPA2-PSK AP with PMF required and PMF disabled on STA
Jouni Malinen [Sun, 25 Oct 2015 13:13:53 +0000 (15:13 +0200)]
tests: WPA2-PSK AP with PMF required and PMF disabled on STA

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRSN: Do not try to connect if PMF disabled and AP requires it
Jouni Malinen [Sun, 25 Oct 2015 13:12:58 +0000 (15:12 +0200)]
RSN: Do not try to connect if PMF disabled and AP requires it

Instead of trying to associate in configuration that is known to result
in the AP rejecting the association, reject the BSS candidate based on
the MFPR=1 RSN capability when STA configuration has PMF disabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWNM: Verify WNM Sleep Mode element length
Jouni Malinen [Sun, 25 Oct 2015 12:45:09 +0000 (14:45 +0200)]
WNM: Verify WNM Sleep Mode element length

This element is required to have at least four octets of actual payload.
This was not previously verified before use and the extra buffer data
after the IE might have been used instead if a received WNM-Sleep Mode
Response frame was invalid.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWNM: Mark set TFS buffer const
Jouni Malinen [Sun, 25 Oct 2015 12:40:35 +0000 (14:40 +0200)]
WNM: Mark set TFS buffer const

This moves the type cast needed for the current driver interface to
ieee802_11_set_tfs_ie() to allow the WNM-Sleep parsing routines to use
const pointers.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WNM Action protocol testing
Jouni Malinen [Sun, 25 Oct 2015 12:38:29 +0000 (14:38 +0200)]
tests: WNM Action protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: P2P autonomous GO and no P2P IE in Probe Response scan results
Jouni Malinen [Sun, 25 Oct 2015 09:13:32 +0000 (11:13 +0200)]
tests: P2P autonomous GO and no P2P IE in Probe Response scan results

autogo_scan verifies the special case where a Probe Response frame
without P2P IE has been received from a GO (e.g., due to a non-P2P
interface requesting a scan) and P2P information from a Beacon frame
needs to be used instead to determine that the group is persistent.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Move P2P helper functions to a separate file
Jouni Malinen [Sun, 25 Oct 2015 09:12:21 +0000 (11:12 +0200)]
tests: Move P2P helper functions to a separate file

This makes it easier to import these into the P2P test scripts.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Interworking network selection and ANQP format errors
Jouni Malinen [Sat, 24 Oct 2015 21:04:32 +0000 (00:04 +0300)]
tests: Interworking network selection and ANQP format errors

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: P2P protocol tests for service discovery messages
Jouni Malinen [Sat, 24 Oct 2015 18:43:32 +0000 (21:43 +0300)]
tests: P2P protocol tests for service discovery messages

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: P2P protocol tests for Group Info parsing
Jouni Malinen [Sun, 18 Oct 2015 13:44:24 +0000 (16:44 +0300)]
tests: P2P protocol tests for Group Info parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Wi-Fi Display extensions to P2P and special parsing cases
Jouni Malinen [Sun, 18 Oct 2015 13:17:49 +0000 (16:17 +0300)]
tests: Wi-Fi Display extensions to P2P and special parsing cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoprivsep: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 16:08:25 +0000 (19:08 +0300)]
privsep: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowext: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 16:08:17 +0000 (19:08 +0300)]
wext: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 16:08:09 +0000 (19:08 +0300)]
nl80211: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agondis: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 16:07:52 +0000 (19:07 +0300)]
ndis: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostap: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 16:07:43 +0000 (19:07 +0300)]
hostap: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoatheros: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 16:07:13 +0000 (19:07 +0300)]
atheros: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoPCSC: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 15:51:59 +0000 (18:51 +0300)]
PCSC: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoSAE: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 15:49:56 +0000 (18:49 +0300)]
SAE: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoGAS server: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 15:47:55 +0000 (18:47 +0300)]
GAS server: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRSN auth: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 15:43:44 +0000 (18:43 +0300)]
RSN auth: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAP: Avoid undefined behavior in pointer arithmetic in IE parsing
Jouni Malinen [Sun, 18 Oct 2015 15:40:41 +0000 (18:40 +0300)]
AP: Avoid undefined behavior in pointer arithmetic in IE parsing

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRADIUS: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 14:46:32 +0000 (17:46 +0300)]
RADIUS: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 14:28:35 +0000 (17:28 +0300)]
TLS: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRSN: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 14:16:39 +0000 (17:16 +0300)]
RSN: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoP2P SD: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 09:11:45 +0000 (12:11 +0300)]
P2P SD: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoHS 2.0: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 09:04:16 +0000 (12:04 +0300)]
HS 2.0: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAvoid undefined behavior in pointer arithmetic in scan result IE parsing
Jouni Malinen [Sun, 18 Oct 2015 08:52:32 +0000 (11:52 +0300)]
Avoid undefined behavior in pointer arithmetic in scan result IE parsing

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWNM: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 08:50:07 +0000 (11:50 +0300)]
WNM: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAvoid undefined behavior in pointer arithmetic in BSS IE parsing
Jouni Malinen [Sun, 18 Oct 2015 08:43:24 +0000 (11:43 +0300)]
Avoid undefined behavior in pointer arithmetic in BSS IE parsing

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoInterworking: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sat, 17 Oct 2015 22:37:38 +0000 (01:37 +0300)]
Interworking: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-IKEv2 peer: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 08:25:25 +0000 (11:25 +0300)]
EAP-IKEv2 peer: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-IKEv2 server: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 08:23:44 +0000 (11:23 +0300)]
EAP-IKEv2 server: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-FAST peer: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 08:18:12 +0000 (11:18 +0300)]
EAP-FAST peer: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-FAST server: Avoid undefined behavior in pointer arithmetic
Jouni Malinen [Sun, 18 Oct 2015 08:12:34 +0000 (11:12 +0300)]
EAP-FAST server: Avoid undefined behavior in pointer arithmetic

Reorder terms in a way that no invalid pointers are generated with
pos+len operations. end-pos is always defined (with a valid pos pointer)
while pos+len could end up pointing beyond the end pointer which would
be undefined behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>