Commit graph

9305 commits

Author SHA1 Message Date
Peng Xu
3784c0589e Extend hw_mode to support any band for offloaded ACS case
When device supports dual band operations with offloaded ACS, hw_mode
can now be set to any band (hw_mode=any) in order to allow ACS to select
the best channel from any band. After a channel is selected, the hw_mode
is updated for hostapd.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-05-27 12:17:57 +03:00
Ben Greear
1b748e67ae HS 2.0: hs20-client: Fix hostname extraction from URL
It was not properly handling cases like this:

https://foo.local:443

Signed-off-by: Ben Greear <greearb@candelatech.com>
2015-05-27 12:01:23 +03:00
Ben Greear
dba68f2be2 HS 2.0: Fix hs20_spp_server compile error
Need to add a new -I path to get it to compile.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2015-05-27 11:56:11 +03:00
Ben Greear
e4a43a9fa3 HS 2.0: spp-client: Warn user if xml file cannot be found
Otherwise, all you get is a cryptic XML validation error out
of the SPP server.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2015-05-27 11:55:43 +03:00
Ilan Peer
b4342ca4d8 P2P: Use p2p_init_wpa_s for P2P command redirection over D-Bus
D-Bus used the p2p_dev member in struct wpa_supplicant to track the
interface used for P2P Device operations. However, this is not needed as
the interface used for P2P Device operations is stored in struct
wpa_global->p2p_init_wpa_s.

Replace all the redirections to wpa_s->p2p_dev with redirections to
wpa_s->global->p2p_init_wpa_s and removed this member as it is no
longer needed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-25 18:31:09 +03:00
Jouni Malinen
96512a00d0 P2P: Fix D-Bus PresenceRequest to use group interface
This command is for a specific P2P group, not for the P2P Device
instance and as such, wpa_s pointer must not be replaced with the
interface that is used for P2P Device management.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-05-25 18:31:09 +03:00
Ilan Peer
b740401f18 P2P: Fix wpas_remove_persistent_peer() to use P2P mgmt interface
The function used wpa_s->parent->conf to iterate the P2P networks and
update the configuration file. However, wpa_s->parent is not
necessarily the interface used to manage the P2P Device operations.

Fix this by accessing the configuration file of the interface
initialized to manage the P2P Device operations.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-25 18:31:09 +03:00
Ilan Peer
1e0a02942b P2P: Fix wpas_p2p_add_persistent_group_client() to use P2P mgmt interface
The function used wpa_s->parent->conf to iterate the P2P networks and
update the configuration file. However, wpa_s->parent is not
necessarily the interface used to manage the P2P Device operations.

Fix this by accessing the configuration file of the interface initialized
to managed the P2P Device operations.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-25 18:31:09 +03:00
Ilan Peer
86b91c89af P2P: Fix wpas_p2p_set_own_freq_preference() to use P2P mgmt interface
wpas_p2p_set_own_freq_preference() accessed wpa_s->parent->conf to test
if p2p_ignore_shared_freq is set, but wpa_s->parent is not necessarily
the interface used to manage the P2P Device operations.

Fix this by accessing the configuration file of the interface
initialized to manage the P2P Device operations.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-25 18:31:09 +03:00
Ben Rosenfeld
43677494fb P2P: Use the P2P Device management interface in wpas_p2p_remove_client()
As wpas_p2p_remove_client() is not necessarily called from the interface
used to manage the P2P Device operations, when removing a client, use
the P2P management interface to iterate over the saved networks and
remove the relevant entries form the P2P GO network blocks.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-25 18:31:09 +03:00
Jouni Malinen
571a1af270 tests: D-Bus FindStopped signal
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-05-25 18:31:09 +03:00
Nishant Chaprana
7b642dc80b P2P: Add D-Bus FindStopped to notify P2P-FIND-STOPPED event
Add D-Bus notification mechanism of P2P-FIND-STOPPED event on
fi.w1.wpa_supplicant1.Interface.P2PDevice interface.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2015-05-25 18:31:09 +03:00
Sunil Dutt
d63f1419b5 P2P: Advertize cross connection to WLAN AP on a non-P2P interface
Commit 1c2aa04c96 ('P2P: Do not add P2P
IEs on P2P disabled interface') removed the P2P IEs from association on
non-P2P interface. However, an AP functioning as a P2P manager needs the
cross connection capability of the station (P2P Device). This needs to
be done to meet the P2P specification requirements even if the station
interface has p2p_disabled=1 in case P2P in general is enabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-05-25 12:44:53 +03:00
Jouni Malinen
7d2736795a wlantest: Fix a copy-paste error in a debug message
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 13:44:42 +03:00
Jouni Malinen
efe353d1aa tests: UPDATE_BEACON to change vendor_elements at runtime
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 13:43:30 +03:00
Jouni Malinen
5e0bedc63c tests: EAP-EKE with server OOM
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 13:36:16 +03:00
Jouni Malinen
f7e3c17b68 tests: WPA2-Enterprise connection using EAP-EKE with serverid NAI
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 12:48:52 +03:00
Jouni Malinen
b4b2f300db tests: ERP with EAP-EKE
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 12:01:25 +03:00
Jouni Malinen
ca24117a5a EAP-EKE: Add Session-Id
While RFC 6124 does not define how Session-Id is constructed for
EAP-EKE, there seems to be consensus among the authors on the
construction. Use this Type | Nonce_P | Nonce_S construction based on
the following email:

 From: Yaron Sheffer <yaronf.ietf at gmail.com>
 To: ietf at ietf.org
 Date: Wed, 17 Nov 2010 13:13:42 +0200

Expanding on my previous response, I suggest to resolve Bernard's
concern by adding the following text:

5.6 EAP Key Generation

EAP-EKE can be used for EAP key generation, as defined by [RFC 5247].
When used in this manner, the values required to establish the key
hierarchy are defined as follows:

- Peer-Id is the EAP-EKE ID_P value.
- Server-Id is the EAP-EKE ID_S value.
- Session-Id is the concatenated Type | Nonce_P | Nonce_S, where Type is
  the method type defined for EAP-EKE in [Sec. 4.1], a single octet.

Thanks,
	Yaron

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 11:58:45 +03:00
Jouni Malinen
5748d1e5f8 tests: EAP-TTLS with server certificate valid beyond UNIX time 2^31
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 11:24:35 +03:00
Jouni Malinen
768ea0bc32 tests: DH params with 2048-bit key
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 11:03:42 +03:00
Jouni Malinen
7f2f3a67d2 Increase DH key size in the hostapd.conf example
OpenSSL is moving to use 2048-bit DH key size as the default with
dhparam. Increase the value in the hostapd.conf to match that to reduce
likelihood of ending up using a shorter key.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 10:47:21 +03:00
Jouni Malinen
75e41ab78a tests: Automatic channel selection with chanlist set
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 10:43:44 +03:00
Srinivasa Duvvuri
567098ec74 ACS: Scan only channels specified in the channel list
The ACS code part of hostapd scans all the channels even if the channel
list is specified in the hostapd.conf. Limit the ACS scan channels to
the list specified in the config file.

Signed-off-by: Srinivasa Duvvuri<sduvvuri@chromium.org>
2015-05-24 10:38:27 +03:00
Jouni Malinen
c7dafdf9b0 WPS: Fix build without CONFIG_WPS=y
Commit 5add410162 ('WPS: Use shorter
authentication timeout during no-SelReg iteration') broke the build with
WPS disabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-24 10:33:26 +03:00
Jouni Malinen
38ad1ea317 tests: Fix persistent_group_per_sta_psk for P2P Device case
The dev[1] <--> dev[2] data connectivity test was using incorrect
function. dev[2] is also using a P2P group and as such, can have a
different group interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-08 18:33:20 +03:00
Jouni Malinen
36e6633415 tests: Fix go_neg_with_bss_connected with P2P Device
Group interface name was fetched from the results of an incorrect group
formation and because of this, group removal failed in case P2P Device
is used and dev[1] ends up getting different group ifname for the
groups.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-08 18:33:16 +03:00
Jouni Malinen
f033200e94 tests: Add P2P Device support for persistent_group
The network operations need to use the global control interface to be
performed on the interface that stores the network profiles for
persistent groups.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-08 18:33:11 +03:00
Ben Rosenfeld
622ef15b77 tests: Update group_ifname after group start
After P2P-GROUP-STARTED event, use group_form_result in order to update
the group_ifname for the device. This is needed when using P2P Device
for managing P2P operations which results in a separate group interface
being used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:32:34 +03:00
Ben Rosenfeld
6f27f79084 tests: Use list_networks with p2p=true in test_p2p_channel
In case that there is a need to list the persistent P2P networks,
the global control interface needs to be used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:31:05 +03:00
Ben Rosenfeld
9766d403a6 tests: Change persistent_go_client_list to use global interface
Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:30:45 +03:00
Ben Rosenfeld
85ef1f4345 tests: Use global interface in persistent_group_invite_removed_client
When removing a persistent P2P group, global interface needs to be used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:29:29 +03:00
Ben Rosenfeld
8e751cfa05 tests: Change list_networks() to use global interface with P2P
list_networks() always used the wlanX control interface to query for the
current list of networks. However, when a dedicated P2P Device is used,
the global control interface should be used when checking persistent
group network profiles.

Fix this by adding an optional parameter indicating that the P2P
networks are requested, and in such a case use the global control
interface.

In addition update test_p2p_persistent to use the argument when needed.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:29:03 +03:00
Ben Rosenfeld
d7e2d79b1a tests: Change persistent_group_per_sta_psk to use global interface
This is required for cases that a dedicated P2P Device interface
is used and then the event will happen on the global interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:27:25 +03:00
Ben Rosenfeld
cbeab59c9f tests: Change test_p2p_persistent to use the global control interface
Send request to set persistent_reconnect on the global control
interface so it would also work when using a dedicated P2P Device
interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:27:04 +03:00
Ben Rosenfeld
cf5d768b33 tests: Change p2p_device_nfc_invite to use global interface
When testing P2P invitation flow, setting the NFC selector
should be done using the global control interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:35:29 +03:00
Ben Rosenfeld
cc259e2650 tests: Change p2p_device_misuses() to use group interface
Calling "DISASSOCIATE" should be done on the group interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:30:40 +03:00
Ilan Peer
6420643d45 tests: Skip some tests in P2PS when a dedicated P2P Device is used
Some tests in test_p2ps.py test a scenario where a separate P2P
group interface is not used. However, this is not a valid case
when a dedicated P2P Device interface is used, as in such a case
a separate group interface must be used.

Handle this by skipping such tests in case a dedicated P2P Device is
used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-07 21:19:38 +03:00
Ilan Peer
5cef80647e tests: Fix test_p2ps.py to save group results
Call group_form_result() whenever a new group is started, so that
group_ifname gets updated and later, the group can be removed when
needed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-07 21:17:31 +03:00
Ben Rosenfeld
09f60224a5 tests: Remove all P2P networks in call to reset
When resetting a device, remove all the P2P networks to prevent
unexpected behavior in following tests. This is needed for the case
where P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:14:31 +03:00
Ben Rosenfeld
6f96fdaefb tests: Change test_p2p_messages to use global interface
This is required for cases where P2P Device is used and the event
happens on the global interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:11:03 +03:00
Ben Rosenfeld
eb1d68eff0 tests: Change set_country() to use the global interface to get event
This is required for cases that multiple interfaces are used and the
event can happen on any of them, for example when a dedicated P2P Device
interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:09:29 +03:00
Ben Rosenfeld
91d3483273 tests: Change p2p_set_ssid_postfix to use the group interface for SSID
This is required for cases where thea P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:07:20 +03:00
Ben Rosenfeld
3d5b1a6452 tests: Fix test_ap_pmf to use own_addr
The tests used p2p_dev_addr that can be different from own_addr,
if a dedicated P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:02:37 +03:00
Ilan Peer
9b05135aa4 P2P: Fix association with an AP/P2P GO that is not a P2P manager
Do not add a P2P IE when a station interface is trying to associate
to an AP or P2P GO that publishes a P2P IE but does not include
a P2P manageability attribute.

This addresses an interoperability issue that was reported in
https://bugzilla.kernel.org/show_bug.cgi?id=96471, where a P2P GO
rejects association from a station interface without a specified
reason.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-07 21:00:22 +03:00
Matthias May
8884ce03bc hostapd: check validity of cwMin/cwMax values
Signed-off-by: Matthias May <matthias.may@neratec.com>
2015-05-07 20:57:32 +03:00
Michael Braun
9649b5342d vlan: Print libnl error message on vlan_add / vlan_del
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
2015-05-07 20:54:26 +03:00
Sunil Dutt
279724d835 Add QCA vendor subcmd for Link Property Query
Link Property query vendor command shall facilitate the information
of the Wi-Fi link. MAC address of the Wi-Fi peer is given as an input
for querying the link properties.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-05-07 18:53:23 +03:00
Jouni Malinen
58606fd987 EAP-pwd server: Make sure in_frag_pos is cleared to zero on allocation
The cleanup code will handle this, but it is more robust to make sure
this is cleared to zero when allocating a new buffer.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-03 18:26:50 +03:00
Jouni Malinen
6aa5d95dab EAP-pwd peer: Make sure in_frag_pos is cleared to zero on allocation
The cleanup code will handle this, but it is more robust to make sure
this is cleared to zero when allocating a new buffer.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-03 18:26:50 +03:00