]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
10 years agoD-Bus: Fix typos in debug print
Purushottam Kushwaha [Wed, 24 Jun 2015 05:45:22 +0000 (05:45 +0000)] 
D-Bus: Fix typos in debug print

Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
10 years agoAndroid: Fix nl80211 build if BOARD_*_PRIVATE_LIB is unspecified
Kevin Cernekee [Sat, 20 Jun 2015 00:22:30 +0000 (17:22 -0700)] 
Android: Fix nl80211 build if BOARD_*_PRIVATE_LIB is unspecified

wpa_supplicant has stub functions if the external p2p symbols are
unavailable, but the build still fails if the
wpa_driver_nl80211_driver_cmd symbol is missing.  Fix this by leaving the
function pointer NULL.  This is safe because wpa_drv_driver_cmd() performs
a NULL check.

Signed-off-by: Kevin Cernekee <cernekee@google.com>
10 years agoAndroid: Rename ANDROID_P2P_STUB to ANDROID_LIB_STUB
Kevin Cernekee [Sat, 20 Jun 2015 00:22:29 +0000 (17:22 -0700)] 
Android: Rename ANDROID_P2P_STUB to ANDROID_LIB_STUB

If BOARD_HOSTAPD_PRIVATE_LIB is not used on an Android build, we will
need to replace both the p2p functions *and* wpa_driver_nl80211_driver_cmd
in order to successfully link.  Let's make the name more generic so it is
more obvious what it is used for.

Suggested-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Kevin Cernekee <cernekee@google.com>
10 years agoD-Bus: Add documentation for wpas_dbus_signal_peer_groups_changed()
Maneesh Jain [Mon, 22 Jun 2015 04:25:02 +0000 (09:55 +0530)] 
D-Bus: Add documentation for wpas_dbus_signal_peer_groups_changed()

This is needed to add this function into Doxygen documentation.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoD-Bus: Fix typo in dbus signal function documentation
Maneesh Jain [Mon, 22 Jun 2015 04:13:50 +0000 (09:43 +0530)] 
D-Bus: Fix typo in dbus signal function documentation

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoD-Bus: Add function documentation for wpas_dbus_unregister_interface()
Maneesh Jain [Mon, 22 Jun 2015 04:08:39 +0000 (09:38 +0530)] 
D-Bus: Add function documentation for wpas_dbus_unregister_interface()

This is needed to add this function into Doxygen documentation.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoD-Bus: Add function documentation for wpas_dbus_register_interface()
Maneesh Jain [Mon, 22 Jun 2015 04:05:08 +0000 (09:35 +0530)] 
D-Bus: Add function documentation for wpas_dbus_register_interface()

This is needed to add this function into Doxygen documentation.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoD-Bus: Fix wpas_dbus_signal_p2p_invitation_result() documentation
Maneesh Jain [Mon, 22 Jun 2015 03:48:34 +0000 (09:18 +0530)] 
D-Bus: Fix wpas_dbus_signal_p2p_invitation_result() documentation

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoradius: Fix NULL dereference issue on allocation failure
Maneesh Jain [Mon, 22 Jun 2015 03:32:15 +0000 (09:02 +0530)] 
radius: Fix NULL dereference issue on allocation failure

In case memory allocation fails, data->pac_opaque_encr_key may be NULL
and lead to possible crash.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoOpenSSL: Handle EC_POINT_is_on_curve() error case
Jouni Malinen [Fri, 26 Jun 2015 12:29:29 +0000 (15:29 +0300)] 
OpenSSL: Handle EC_POINT_is_on_curve() error case

Even though this OpenSSL function is documented as returning "1 if point
if on the curve and 0 otherwise", it can apparently return -1 on some
error cases. Be prepared for that and check explicitly against 1 instead
of non-zero.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSAE: Use random "password" in extra hunting-and-pecking loops
Jouni Malinen [Fri, 26 Jun 2015 08:44:22 +0000 (11:44 +0300)] 
SAE: Use random "password" in extra hunting-and-pecking loops

If PWE is discovered before the minimum number of loops (k) is reached,
the extra iterations use a random "password" to further obfuscate the
cost of discovering PWE.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSAE: Add side-channel protection to PWE derivation with ECC
Jouni Malinen [Thu, 25 Jun 2015 08:35:39 +0000 (11:35 +0300)] 
SAE: Add side-channel protection to PWE derivation with ECC

This replaces the earlier IEEE Std 802.11-2012 algorithm with the design
from P802.11-REVmc/D4.0. Things brings in a blinding technique for
determining whether the pwd-seed results in a suitable PWE value.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agocrypto: Add functions for computing the Legendre symbol and EC y^2
Jouni Malinen [Thu, 25 Jun 2015 08:33:34 +0000 (11:33 +0300)] 
crypto: Add functions for computing the Legendre symbol and EC y^2

These are needed to implement side-channel protection for SAE PWE
derivation for ECC.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: sae_groups to include Brainpool EC groups
Jouni Malinen [Thu, 25 Jun 2015 19:19:00 +0000 (22:19 +0300)] 
tests: sae_groups to include Brainpool EC groups

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoOpenSSL: Add support for Brainpool Elliptic Curves
Jouni Malinen [Thu, 25 Jun 2015 19:17:28 +0000 (22:17 +0300)] 
OpenSSL: 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. For now, these get enabled for SAE as configurable
groups (sae_groups parameter), but the new groups are not enabled by
default.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSAE: Increase security parameter k to 40 based on Dragonfly recommendation
Jouni Malinen [Wed, 24 Jun 2015 17:47:08 +0000 (20:47 +0300)] 
SAE: Increase security parameter k to 40 based on Dragonfly recommendation

draft-irtf-cfrg-dragonfly recommends implementation to set the security
parameter, k, to a value of at least 40. This will make PWE generation
take significantly more resources, but makes it more likely to hide
timing differences due to different number of loops needed to find a
suitable PWE.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSAE: Fix PWE generation to use minimum loop count (k) properly
Jouni Malinen [Wed, 24 Jun 2015 17:42:48 +0000 (20:42 +0300)] 
SAE: Fix PWE generation to use minimum loop count (k) properly

The implementation did not match the comment, i.e., only k-1 rounds were
required instead of k.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Try heavier SAE groups in sae_groups
Jouni Malinen [Thu, 25 Jun 2015 08:56:51 +0000 (11:56 +0300)] 
tests: Try heavier SAE groups in sae_groups

This changes the sae_groups test case design to try with every group and
skip triggering test failure for the heavier ones that are likely to
fail in some VM setups under load. This provides more testing coverage
by not limiting the test based on lowest common setup.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SAE with number of different passwords
Jouni Malinen [Wed, 24 Jun 2015 17:39:07 +0000 (20:39 +0300)] 
tests: SAE with number of different passwords

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SAE anti clogging protocol testing
Jouni Malinen [Tue, 23 Jun 2015 20:05:27 +0000 (23:05 +0300)] 
tests: SAE anti clogging protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSAE: Merge sae_derive_commit() error case return statements
Jouni Malinen [Tue, 23 Jun 2015 19:38:38 +0000 (22:38 +0300)] 
SAE: Merge sae_derive_commit() error case return statements

These error cases have the exact same outcome, so a single return
statement can be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSAE: Merge sae_get_rand() error case return statements
Jouni Malinen [Tue, 23 Jun 2015 19:35:09 +0000 (22:35 +0300)] 
SAE: Merge sae_get_rand() error case return statements

These error cases have the exact same outcome, so a single return
statement can be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SAE reflection attack
Jouni Malinen [Tue, 23 Jun 2015 19:31:39 +0000 (22:31 +0300)] 
tests: SAE reflection attack

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSAE: Verify that own/peer commit-scalar and COMMIT-ELEMENT are different
Jouni Malinen [Tue, 23 Jun 2015 19:30:15 +0000 (22:30 +0300)] 
SAE: Verify that own/peer commit-scalar and COMMIT-ELEMENT are different

This check explicitly for reflection attack and stops authentication
immediately if that is detected instead of continuing to the following
4-way handshake that would fail due to the attacker not knowing the key
from the SAE exchange.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoAdd crypto_ec_point_cmp()
Jouni Malinen [Tue, 23 Jun 2015 19:29:23 +0000 (22:29 +0300)] 
Add crypto_ec_point_cmp()

This is needed to allow SAE to check whether ECC elements are identical.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agodbus: Do not initialize variable twice
Jouni Malinen [Tue, 23 Jun 2015 18:14:30 +0000 (21:14 +0300)] 
dbus: Do not initialize variable twice

There is no point in initializing 'success' to FALSE when the actual
value is set just below this.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoDo not check unsigned size is less than zero
Jouni Malinen [Tue, 23 Jun 2015 18:12:29 +0000 (21:12 +0300)] 
Do not check unsigned size is less than zero

The variables here are unsigned and as such, cannot have a negative
value. Use == 0 instead of <= 0 to make this cleaner.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoOpenSSL: Remove SSL_CTX_{get,set}_app_data() compatibility wrapper
Jouni Malinen [Tue, 23 Jun 2015 18:05:02 +0000 (21:05 +0300)] 
OpenSSL: Remove SSL_CTX_{get,set}_app_data() compatibility wrapper

OpenSSL 0.9.8 (and newer) includes SSL_CTX_get_app_data() and
SSL_CTX_set_app_data(), so there is no need to maintain this old
OPENSSL_SUPPORTS_CTX_APP_DATA backwards compatibility design.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agolibtommath: Fix mp_init_multi() stdarg use on error path
Jouni Malinen [Tue, 23 Jun 2015 17:39:08 +0000 (20:39 +0300)] 
libtommath: Fix mp_init_multi() stdarg use on error path

Previously, it would have been possible for va_end(args) to be called
twice in case mp_init() fails. While that may not cause issues on number
of platforms, that is not how va_start()/va_end() are supposed to be
used. Fix this by returning from the function without using va_end()
twice on the same va_list args.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agowpa_gui: Initialize WpaGuiApp::w in the constructor
Jouni Malinen [Tue, 23 Jun 2015 17:23:31 +0000 (20:23 +0300)] 
wpa_gui: Initialize WpaGuiApp::w in the constructor

This gets rid of a static analyzer warning. The actual value for
WpaGuiApp::w will be set after the constructor has returned, so this
value was not really used uninitialized.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoUse os_* wrapper more consistently
Jouni Malinen [Tue, 23 Jun 2015 17:04:14 +0000 (20:04 +0300)] 
Use os_* wrapper more consistently

os_free() needs to be used when freeing memory that was allocated with
os_malloc()/os_zalloc()/os_calloc().

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoUse unsigned/signed printf format more consistently
Jouni Malinen [Tue, 23 Jun 2015 16:11:35 +0000 (19:11 +0300)] 
Use unsigned/signed printf format more consistently

These configuration parameters did not use matching printf format string
parameters (signed vs. unsigned). While these configuratin values are,
in practice, small unsigned integers, the implementation should use
matching types to write these.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoHS 2.0R2: Fix memory leak on error path in hs20-osu-client
Nishant Chaprana [Tue, 23 Jun 2015 12:34:40 +0000 (18:04 +0530)] 
HS 2.0R2: Fix memory leak on error path in hs20-osu-client

fqdn was not freed before return in case the server uses an unsupported
location for the PPS MO in the addMO command.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
10 years agoP2P: Use offsetof() instead of local implementation
Jouni Malinen [Tue, 23 Jun 2015 15:30:11 +0000 (18:30 +0300)] 
P2P: Use offsetof() instead of local implementation

The construction used here to figure out the offset of variable length
IEs in Probe Request frames was a bit odd looking and resulted in a
warning from a static analyzer, so replace it with more standard use of
offsetof().

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoERP server: Make erp_send_finish_reauth() easier for static analyzers
Jouni Malinen [Tue, 23 Jun 2015 15:25:35 +0000 (18:25 +0300)] 
ERP server: Make erp_send_finish_reauth() easier for static analyzers

The flags argument is used to indicate a failure case (0x80) which
allows erp == NULL. This may be a bit too difficult combination for
static analyzers to understand, so add an explicit check for !erp as
another condition for returning from the function before the erp pointer
gets dereferenced without checking it.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agobsd: Remove redundant NULL check in bsd_init()
Jouni Malinen [Tue, 23 Jun 2015 15:20:24 +0000 (18:20 +0300)] 
bsd: Remove redundant NULL check in bsd_init()

drv cannot be NULL here (it is dereferenced even on the preceding line)
and anyway, os_free(NULL) is allowed, so remove the redundant check.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRemove redundant NULL check in ieee802_1x_encapsulate_radius()
Jouni Malinen [Tue, 23 Jun 2015 15:18:25 +0000 (18:18 +0300)] 
Remove redundant NULL check in ieee802_1x_encapsulate_radius()

The eap argument to this function is never NULL and the earlier
ieee802_1x_learn_identity() call is dereferencing it anyway, so there is
no point in checking whether it is NULL later in the function.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: HT40 co-ex scan conflict (HT40-)
Jouni Malinen [Tue, 23 Jun 2015 08:23:35 +0000 (11:23 +0300)] 
tests: HT40 co-ex scan conflict (HT40-)

This verifies a case where the neighboring BSS is at the other end of
the band and has its PRI channel further away.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoAP: Add more 2.4 GHz channels for 20/40 MHz HT co-ex scan
Jouni Malinen [Tue, 23 Jun 2015 08:21:51 +0000 (11:21 +0300)] 
AP: Add more 2.4 GHz channels for 20/40 MHz HT co-ex scan

This needs to find the PRI channel also in cases where the affected
channel is the SEC channel of a 40 MHz BSS, so need to include the
scanning coverage here to be 40 MHz from the center frequency. Without
this, it was possible to miss a neighboring 40 MHz BSS that was at the
other end of the 2.4 GHz band and had its PRI channel further away from
the local BSS.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agohw_features: Merge similar return cases
Jouni Malinen [Tue, 23 Jun 2015 08:08:10 +0000 (11:08 +0300)] 
hw_features: Merge similar return cases

There is no need to have separate return statements for these corner
cases that are unlikely to be hit in practice.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Use different channel offset for the second 160 MHz VHT AP
Jouni Malinen [Mon, 22 Jun 2015 23:42:17 +0000 (02:42 +0300)] 
tests: Use different channel offset for the second 160 MHz VHT AP

This increases testing coverage a bit.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: VHT 80 MHz with different HT40 channel options
Jouni Malinen [Mon, 22 Jun 2015 23:30:24 +0000 (02:30 +0300)] 
tests: VHT 80 MHz with different HT40 channel options

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSAE: Simplify sae_prepare_commit() error path
Jouni Malinen [Sun, 21 Jun 2015 21:38:02 +0000 (00:38 +0300)] 
SAE: Simplify sae_prepare_commit() error path

There is no need to keep separate "return -1" statements for these error
cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SAE protocol tests
Jouni Malinen [Sun, 21 Jun 2015 21:04:09 +0000 (00:04 +0300)] 
tests: SAE protocol tests

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: HT40 co-ex scan and other BSS not affected
Jouni Malinen [Sun, 21 Jun 2015 19:27:34 +0000 (22:27 +0300)] 
tests: HT40 co-ex scan and other BSS not affected

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SAE and OOM in wpa_supplicant
Jouni Malinen [Sat, 20 Jun 2015 20:31:12 +0000 (23:31 +0300)] 
tests: SAE and OOM in wpa_supplicant

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoFix SAE group selection in an error case
Jouni Malinen [Sat, 20 Jun 2015 20:29:57 +0000 (23:29 +0300)] 
Fix SAE group selection in an error case

The sae_groups parameter is zero terminated array, not -1 terminated, so
must check the value against <= 0 to break out from the loop.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoHS 2.0: Add WLAN RADIUS attributes in OSEN case
Jouni Malinen [Sat, 20 Jun 2015 19:59:30 +0000 (22:59 +0300)] 
HS 2.0: Add WLAN RADIUS attributes in OSEN case

Previously, the common WLAN-* RADIUS attributes were added only when WPA
or WPA2 was used. These can be of use for OSEN as well, so include them
in that case, too.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRemove unnecessary wpa_ie_len check from wpa_parse_wpa_ie_wpa()
Jouni Malinen [Sat, 20 Jun 2015 19:50:45 +0000 (22:50 +0300)] 
Remove unnecessary wpa_ie_len check from wpa_parse_wpa_ie_wpa()

There is no need to have a separate "fail silently" case for wpa_ie_len
== 0. That condition does not seem to be reachable and even if it were,
the following "ie len too short" case will result in the exact same
return value.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Suite B with external RADIUS server
Jouni Malinen [Sat, 20 Jun 2015 19:24:57 +0000 (22:24 +0300)] 
tests: Suite B with external RADIUS server

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: D-Bus AddNetwork and connection with WPA+WPA2-Enterprise AP
Jouni Malinen [Sat, 20 Jun 2015 19:08:55 +0000 (22:08 +0300)] 
tests: D-Bus AddNetwork and connection with WPA+WPA2-Enterprise AP

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: WPA IE parsing
Jouni Malinen [Sat, 20 Jun 2015 18:21:23 +0000 (21:21 +0300)] 
tests: WPA IE parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Update wpas_ctrl_network to match removal of WEP as group cipher
Jouni Malinen [Sat, 20 Jun 2015 15:38:52 +0000 (18:38 +0300)] 
tests: Update wpas_ctrl_network to match removal of WEP as group cipher

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRemove WEP40/WEP104 cipher suite support for WPA/WPA2
Jouni Malinen [Sat, 20 Jun 2015 15:25:15 +0000 (18:25 +0300)] 
Remove WEP40/WEP104 cipher suite support for WPA/WPA2

As far as IEEE 802.11 standard is concerned, WEP is deprecated, but at
least in theory, allowed as a group cipher. This option is unlikely to
be deployed anywhere and to clean up the implementation, we might as
well remove all support for this combination.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: WPA2-PSK-FT AP and invalid response IEs
Jouni Malinen [Sat, 20 Jun 2015 14:38:39 +0000 (17:38 +0300)] 
tests: WPA2-PSK-FT AP and invalid response IEs

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoFT: Stop association attempt if Auth response processing fails (SME)
Jouni Malinen [Sat, 20 Jun 2015 14:36:58 +0000 (17:36 +0300)] 
FT: Stop association attempt if Auth response processing fails (SME)

Call the FT processing function directly instead of going through
wpa_supplicant_event() to process FT Authentication frame in SME case.
This allows parsing error to be used to trigger immediate failure for
the connection instead of trying to proceed to reassociation step that
cannot succeed.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: HT40 co-ex scan finding an AP advertising 40 MHz intolerant
Jouni Malinen [Sat, 20 Jun 2015 13:16:11 +0000 (16:16 +0300)] 
tests: HT40 co-ex scan finding an AP advertising 40 MHz intolerant

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoMake check_20mhz_bss() static
Jouni Malinen [Sat, 20 Jun 2015 13:05:54 +0000 (16:05 +0300)] 
Make check_20mhz_bss() static

This is not used outside this file anymore, so there is no need to
export the symbol either.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: HT40 co-ex scan conflict with HT 20 MHz AP
Jouni Malinen [Sat, 20 Jun 2015 13:02:53 +0000 (16:02 +0300)] 
tests: HT40 co-ex scan conflict with HT 20 MHz AP

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: HT40 on 5 GHz with invalid channel pair
Jouni Malinen [Sat, 20 Jun 2015 12:51:41 +0000 (15:51 +0300)] 
tests: HT40 on 5 GHz with invalid channel pair

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Make dbus_old_wps_pbc more robust
Jouni Malinen [Sat, 20 Jun 2015 12:35:52 +0000 (15:35 +0300)] 
tests: Make dbus_old_wps_pbc more robust

Flush the cfg80211 scan cache explicitly to avoid false failure reports
if a BSS entry from an earlier test case remain. Such a failure could be
hit, e.g., with the following test case sequence:
wpas_mesh_mode_scan p2p_channel_random_social dbus_old_wps_pbc

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoP2P: Handle P2P Device dedicated interface parent removal
Ilan Peer [Wed, 17 Jun 2015 13:18:20 +0000 (16:18 +0300)] 
P2P: Handle P2P Device dedicated interface parent removal

In case of a network interface removal, check if the interface
was also the parent interface of the P2P Device dedicated interface.
If this is the case, then stop the P2P Device functionality, and
remove the P2P Device dedicated interface.

In case that the interface is added again and P2P Device
functionality can be enabled again, add a new P2P Device dedicated
interface and allow further P2P Device functionality.

In case that the P2P Device dedicated interface is re-created, the
original P2P Device configuration file is needed, so store it in
the global params (instead in the wpa_interface configuration).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agonl8021: Allow sending wowlan configuration on any interface
Ilan Peer [Wed, 17 Jun 2015 13:18:19 +0000 (16:18 +0300)] 
nl8021: Allow sending wowlan configuration on any interface

Sending a wowlan configuration command can be done on any wireless
interface (not only netdev), as it is a device configuration and not
interface configuration specific. Fix the code to allow it to be
sent on any interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agonl80211: Remove android_genl_ctrl_resolve()
Ilan Peer [Wed, 17 Jun 2015 13:18:17 +0000 (16:18 +0300)] 
nl80211: Remove android_genl_ctrl_resolve()

Android libnl_2 implementation added support for "nl80211" name in
commit 'libnl_2: Extend genl_ctrl_resolve() to support "nl80211" name'
in July 2012 which got included in Android 4.2. It is fine to drop this
old Android ICS workaround from wpa_supplicant now.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agoP2P: Consider ht/vht on P2P_GROUP_ADD command (with no params)
Eliad Peller [Wed, 17 Jun 2015 13:18:16 +0000 (16:18 +0300)] 
P2P: Consider ht/vht on P2P_GROUP_ADD command (with no params)

p2p_ctrl_group_add() takes care of various configuration options (such
as ht/vht) before calling wpas_p2p_group_add(), so use it (just like
when P2P_GROUP_ADD is called with additional params).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
10 years agoctrl_iface: Make p2p_ctrl_group_add() more robust
Eliad Peller [Wed, 17 Jun 2015 13:18:15 +0000 (16:18 +0300)] 
ctrl_iface: Make p2p_ctrl_group_add() more robust

Parse each parameter individually and combine all the function calls.
This will allow further patch to call it with no parameters (currently
this might result in failure).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
10 years agoP2P: Fix secondary channel selection for HT40
Eliad Peller [Wed, 17 Jun 2015 13:18:14 +0000 (16:18 +0300)] 
P2P: Fix secondary channel selection for HT40

wpas_p2p_get_ht40_mode() used blacklist approach (bw != BW20) to find
the relevant op_class, but didn't take into account other non-BW40
cases, like BW80, that had been added to the bw enum after the initial
implementation. Fix this by looking for the specific BW40 bw cases.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
10 years agotests: Increase HTTPConnection timeout in ap_wps_upnp_http_proto
Jouni Malinen [Fri, 19 Jun 2015 10:45:16 +0000 (13:45 +0300)] 
tests: Increase HTTPConnection timeout in ap_wps_upnp_http_proto

It looks like the previous timeout of 0.1 seconds could be hit under
parallel VM load, so double this to 0.2 second to avoid hitting
unnecessary test failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: D-Bus RemoveClient()
Jouni Malinen [Fri, 19 Jun 2015 10:07:03 +0000 (13:07 +0300)] 
tests: D-Bus RemoveClient()

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agodbus: Add RemoveClient method to remove a client from local GO
Purushottam Kushwaha [Tue, 16 Jun 2015 11:35:56 +0000 (11:35 +0000)] 
dbus: Add RemoveClient method to remove a client from local GO

This is equivalent to the P2P_REMOVE_CLIENT command on control
interface. This can be used to remove the specified client [as object
path or string format interface address] from all groups (operating and
persistent) from the local GO.

Argument(s): peer[object path] OR iface[string format MAC address]

Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
Signed-off-by: Jijo Jacob <jijo.jacob@samsung.com>
10 years agoD-Bus: Fix wpas_dbus_register_peer() documentation
Maneesh Jain [Tue, 16 Jun 2015 05:17:00 +0000 (10:47 +0530)] 
D-Bus: Fix wpas_dbus_register_peer() documentation

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoD-Bus: Add missing params in WPS function documentation
Maneesh Jain [Tue, 16 Jun 2015 05:06:12 +0000 (10:36 +0530)] 
D-Bus: Add missing params in WPS function documentation

This adds missing parameters in all WPS events related function
documentation.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoD-Bus: Fix function documentation for wpas_dbus_signal_p2p_go_neg_resp()
Maneesh Jain [Tue, 16 Jun 2015 04:38:01 +0000 (10:08 +0530)] 
D-Bus: Fix function documentation for wpas_dbus_signal_p2p_go_neg_resp()

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agoD-Bus: Add function documentation for wpas_dbus_signal_p2p_go_neg_req()
Maneesh Jain [Tue, 16 Jun 2015 04:30:14 +0000 (10:00 +0530)] 
D-Bus: Add function documentation for wpas_dbus_signal_p2p_go_neg_req()

This is needed to add this function into Doxygen documentation.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
10 years agotests: Wait on the global control interface for CTRL-EVENT-REGDOM-CHANGE
Ben Rosenfeld [Wed, 17 Jun 2015 13:25:01 +0000 (16:25 +0300)] 
tests: Wait on the global control interface for CTRL-EVENT-REGDOM-CHANGE

The event is not interface specific, so wait for it on the global
control interface socket.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
10 years agotests: Fix grpform_wait_peer group removal in P2P Device case
Avraham Stern [Wed, 17 Jun 2015 13:24:59 +0000 (16:24 +0300)] 
tests: Fix grpform_wait_peer group removal in P2P Device case

Get the P2P group interface name so it will be used for group removal to
support configurations that use a dedicated P2P Device interface.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
10 years agotests: Fix p2p_set_discoverability waiting for CTRL-EVENT-CONNECTED
Avraham Stern [Wed, 17 Jun 2015 13:24:58 +0000 (16:24 +0300)] 
tests: Fix p2p_set_discoverability waiting for CTRL-EVENT-CONNECTED

Wait on the group control interface to support configurations that
use a dedicated P2P Device interface.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
10 years agoP2P: Fix PBC overlap detection
Avraham Stern [Wed, 17 Jun 2015 13:24:57 +0000 (16:24 +0300)] 
P2P: Fix PBC overlap detection

PBC overlap detection searches for another BSS with active PBC in the
BSS table. However, when a separate P2P interface is used, scan results
without P2P IE are not saved in the BSS table, so non-P2P BSS's with
active PBC will not be detected.

Fix this by iterating only the WPS AP array instead of the BSS table.
This is also more efficient since only WPS APs may have active PBC. This
also fixes hwsim test "grpform_pbc_overlap" when a dedicated P2P Device
is used.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
10 years agotests: Fix wifi_display to use the global control interface
Ilan Peer [Wed, 17 Jun 2015 13:24:56 +0000 (16:24 +0300)] 
tests: Fix wifi_display to use the global control interface

This is needed if the configuration is using a dedicated P2P Device
interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agotests: Fix wifi_display_persistent_group with P2P Device
Ilan Peer [Wed, 17 Jun 2015 13:24:55 +0000 (16:24 +0300)] 
tests: Fix wifi_display_persistent_group with P2P Device

Use the global control interface to list the P2P Device persistent
networks. Get and parse the P2P-GROUP-STARTED events, so later the
interface names would be available for the connectivity test etc. Both
of these are required when a dedicated P2P Device interface is used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agoP2P: Use the P2P Device interface in wpas_p2p_fallback_to_go_neg()
Ilan Peer [Wed, 17 Jun 2015 13:24:54 +0000 (16:24 +0300)] 
P2P: Use the P2P Device interface in wpas_p2p_fallback_to_go_neg()

Previously the wpa_s->parent interface was used, which is not
necessarily the P2P Device management interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agotests: Fix autogo_pbc() waiting for WPS-PBC
Ilan Peer [Wed, 17 Jun 2015 13:24:53 +0000 (16:24 +0300)] 
tests: Fix autogo_pbc() waiting for WPS-PBC

Wait on the global control interface to support
configurations that use a dedicated P2P Device interface.

Note that the group interface cannot be used, as the group
interface name is not saved since no group was created.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agotests: Use global and group control interface in test_p2p_autogo
Ilan Peer [Wed, 17 Jun 2015 13:24:50 +0000 (16:24 +0300)] 
tests: Use global and group control interface in test_p2p_autogo

This is required when a dedicated P2P Device is used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agotests: Modify reset() to use the global control interface
Ilan Peer [Wed, 17 Jun 2015 13:24:48 +0000 (16:24 +0300)] 
tests: Modify reset() to use the global control interface

Change the reset() method to use the global control interface
for resetting P2P state and also add a call to P2P_FLUSH.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agotests: Use global interface for "P2P_SET"
Ben Rosenfeld [Wed, 17 Jun 2015 13:24:47 +0000 (16:24 +0300)] 
tests: Use global interface for "P2P_SET"

Setting P2P per_sta_psk should be done using the global control
interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
10 years agotests: NFC static handover with invalid contents
Jouni Malinen [Thu, 18 Jun 2015 22:14:35 +0000 (01:14 +0300)] 
tests: NFC static handover with invalid contents

This adds test coverage to p2p_procesS_nfc_connection_handover() error
paths. This is also a regression test case for a memory leak on two of
these error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoP2P: Fix memory leak in p2p_process_nfc_connection_handover()
Ben Rosenfeld [Wed, 17 Jun 2015 13:16:35 +0000 (16:16 +0300)] 
P2P: Fix memory leak in p2p_process_nfc_connection_handover()

p2p_process_nfc_connection_handover() allocates msg memory in the parser
and might return before memory is released if the received message is
not valid.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
10 years agotests: WPA2-Enterprise connection using EAP-FAST and OOM in PRF
Jouni Malinen [Thu, 18 Jun 2015 21:50:29 +0000 (00:50 +0300)] 
tests: WPA2-Enterprise connection using EAP-FAST and OOM in PRF

This is a regression test case for a memory leak on a TLS PRF error
path. In addition, this provides more coverage for this error path.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoEAP-FAST peer: Stop immediately on key derivation failure
Jouni Malinen [Thu, 18 Jun 2015 21:49:01 +0000 (00:49 +0300)] 
EAP-FAST peer: Stop immediately on key derivation failure

If key derivation fails, there is no point in trying to continue
authentication. In theory, this could happen if memory allocation during
TLS PRF fails.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoOpenSSL: Fix memory leak on an openssl_tls_prf() error path
Ben Rosenfeld [Wed, 17 Jun 2015 13:16:34 +0000 (16:16 +0300)] 
OpenSSL: Fix memory leak on an openssl_tls_prf() error path

Free tmp_out before returning to prevent memory leak in case the second
memory allocation in openssl_tls_prf() fails. This is quite unlikely,
but at least theoretically possible memory leak with EAP-FAST.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
10 years agotests: More RADIUS testing coverage with CUI/User-Name in ACL response
Jouni Malinen [Thu, 18 Jun 2015 21:21:44 +0000 (00:21 +0300)] 
tests: More RADIUS testing coverage with CUI/User-Name in ACL response

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Make ap_wps_ap_scan_2 more robust
Jouni Malinen [Thu, 18 Jun 2015 19:33:48 +0000 (22:33 +0300)] 
tests: Make ap_wps_ap_scan_2 more robust

The test sequence "scan_and_bss_entry_removed ap_wps_ap_scan_2" resulted
in failure due to an old BSS entry remaining from the first test case to
the second and the WPS_PBC operation on a forced BSSID ending up picking
the incorrect BSS entry. Make this more robust by clearing the scan
results from cfg80211.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Make ap_wps_pbc_overlap_2* less likely to cause issues
Jouni Malinen [Thu, 18 Jun 2015 18:59:05 +0000 (21:59 +0300)] 
tests: Make ap_wps_pbc_overlap_2* less likely to cause issues

Both of these test cases were leaving out BSS entries with active PBC
mode at the end of the test. This could result in the next text case
failing, e.g., in "ap_wps_pbc_overlap_2ap grpform_ext_listen" and
"ap_wps_pbc_overlap_2sta grpform_ext_listen" sequences. Fix this by
flushing the scan results more carefully at the end of the PBC overlap
test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Print a command line to re-run failed test sequence
Jouni Malinen [Thu, 18 Jun 2015 17:44:59 +0000 (20:44 +0300)] 
tests: Print a command line to re-run failed test sequence

This makes it easier to test whether a specific test sequence results in
a reproducible test failure.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: P2PS with large number of services in Probe Request/Response
Jouni Malinen [Thu, 18 Jun 2015 15:13:30 +0000 (18:13 +0300)] 
tests: P2PS with large number of services in Probe Request/Response

This verifies capability to split the response into multiple P2P
elements.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotests: Extend P2PS service seek test to cover multiple services
Jouni Malinen [Thu, 18 Jun 2015 14:02:36 +0000 (17:02 +0300)] 
tests: Extend P2PS service seek test to cover multiple services

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotests: P2PS wildcard SD probe
Max Stepanov [Wed, 10 Jun 2015 08:43:49 +0000 (11:43 +0300)] 
tests: P2PS wildcard SD probe

Verify that advertiser returns 'org.wi-fi.wfds' wildcard in a Probe
Response frame if at least one P2PS advertisement is present.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
10 years agoP2PS: Fix Probe Response frame building in error cases
Jouni Malinen [Thu, 18 Jun 2015 14:24:52 +0000 (17:24 +0300)] 
P2PS: Fix Probe Response frame building in error cases

org.wi-fi.wfds service is not a replacement for non-WFA service matches.
Do not try to replace the results with that if there is not sufficient
room for the response. Instead, reply with all the matching services
that fit into the message. org.wi-fi.wfds is the first entry in the list
(if matching request/service is present), so it won't get overridden by
other services.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoP2PS: Fix org.wi-fi.wfds matching when building the response
Jouni Malinen [Thu, 18 Jun 2015 14:23:09 +0000 (17:23 +0300)] 
P2PS: Fix org.wi-fi.wfds matching when building the response

The service hash for org.wi-fi.wfds is supposed to match only if the
device has a WFA defined org.wi-fi.wfds.* service. Verify that before
adding org.wi-fi.wfds to the response.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoP2PS: Add more debug prints for service info building
Jouni Malinen [Thu, 18 Jun 2015 14:21:23 +0000 (17:21 +0300)] 
P2PS: Add more debug prints for service info building

This makes the debug log much more helpful for figuring out results from
service hash matching.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>