mech_eap.git
10 years agobsd: Fix hostapd compiler warning
Masashi Honma [Sun, 2 Feb 2014 21:06:14 +0000 (23:06 +0200)]
bsd: Fix hostapd compiler warning

The hostapd compilation displays a below warning On NetBSD 6.1.2.

../src/drivers/driver_bsd.c:72:1: warning: 'get80211opmode' defined but not used

This patch solves it and moves other functions to appropriate position to
reduce #ifdef.

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

10 years agoFix authentication algorithm negotiation in SME code
Jouni Malinen [Fri, 31 Jan 2014 21:31:26 +0000 (23:31 +0200)]
Fix authentication algorithm negotiation in SME code

Commit 6ac4b15ef8af434d216fd2dac62ec82948ab0fbd (wpa_radio work for
connection) caused a regression for cases where multiple auth_alg values
are set in a network block and wpa_supplicant-based SME is supposed to
iterate through them. The connection radio work was not terminated when
receiving authentication failure and this resulted in the following
authentication attempt failing.

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

10 years agonl80211: Show DFS region info in debug messages
Janusz Dziedzic [Fri, 24 Jan 2014 22:12:23 +0000 (23:12 +0100)]
nl80211: Show DFS region info in debug messages

Print DFS region info, if provided, when printing regulatory
information.

Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>

10 years agohostapd: Increase timeout for channel list update to 5 seconds
Janusz Dziedzic [Fri, 24 Jan 2014 22:12:24 +0000 (23:12 +0100)]
hostapd: Increase timeout for channel list update to 5 seconds

Before this patch, 1 second timeout was used for regulatory updates. In
some cases, specially when we reload driver modules on some slower
platforms this could take more than 1 second (about 2 seconds). This is
important specially for DFS case, where we have to have correct DFS
region before we will start CAC. In other case (unknown DFS region), CAC
will fail. 5 seconds should be enough for all cases.

Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>

10 years agonl80211: Treat RSSI as part of each sched scan matchset
Johannes Berg [Fri, 24 Jan 2014 12:32:27 +0000 (13:32 +0100)]
nl80211: Treat RSSI as part of each sched scan matchset

The original RSSI filter semantics for scheduled scan were
really confusing - a separate matchset was created, but it
wasn't actually treated as a separate matchset in the kernel
but rather used as the global RSSI value. The RSSI matchset
thus behaved like an RSSI filter outside of the matchsets,
being ANDed rather than ORed (as normal between matchsets.)

To make this less confusing, I changed the kernel API a bit
to actually treat the RSSI inside each matchset properly,
but keeping it compatible with the old approach by using a
matchset with only an RSSI value as the default for all the
other matchsets, and adding it as a separate matchset only
if it's the only one.

The proper way for wpa_supplicant to do this then would be
to add the RSSI to each SSID matchset, and only add another
matchset without SSID if there's none with.

However, to keep compatibility with older kernels, always
keep the non-SSID matchset and only add the RSSI to all the
other matchsets. This gets close to the desired behaviour,
the only difference would be that we shouldn't add the RSSI
matchset if there are others, but stays compatible with old
and new kernels, as new ones ignore the RSSI-only matchset
if there are others and those others have an RSSI.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

10 years agoFix memory leaks and wrong memory access
Eytan Lifshitz [Tue, 28 Jan 2014 07:32:35 +0000 (09:32 +0200)]
Fix memory leaks and wrong memory access

1. In wpa_config_process_bgscan() fix memory leak after
   calling wpa_config_parse_string()
2. In hostapd_config_defaults(), on failure to allocate bss->radius,
   conf->bss was not freed.
3. In p2p_deauth_nofif(), memory allocated in p2p_parse_ies() was not
   freed in case of NULL minor_reason_code.
4. In p2p_disassoc_nofif(), memory allocated in p2p_parse_ies() was
   not freed in case of NULL minor_reason_code.
5. In p2p_process_go_neg_conf(), memory allocated was not freed in
   case that the P2P Device interface was not waiting for a
   GO Negotiation Confirm.
6. In wpa_set_pkcs11_engine_and_module_path(), the wrong pointer was
   checked.

Signed-hostap: Eytan Lifshitz <eytan.lifshitz@intel.com>

10 years agowpa_supplicant: Fix wrong size memory allocation
Eytan Lifshitz [Tue, 28 Jan 2014 07:32:34 +0000 (09:32 +0200)]
wpa_supplicant: Fix wrong size memory allocation

Fix memory allocation in wpa_scan_clone_params(), where the
allocation request used the size of a pointer rather than the
size of the structure.

Signed-hostap: Eytan Lifshitz <eytan.lifshitz@intel.com>

10 years agonl80211: Fix channel switching with VHT80
Michal Kazior [Tue, 28 Jan 2014 13:56:41 +0000 (14:56 +0100)]
nl80211: Fix channel switching with VHT80

It is possible for channel switch notification to be missing channel
type attribute. This is true at least for VHT80. This led to
iface->conf->secondary_channel being set to 0. This in turn made
subsequent DFS-triggered CSA to fail due to invalid frequency
parameters.

Signed-hostap: Michal Kazior <michal.kazior@tieto.com>

10 years agonl80211: Verify that ifindex attribute is included in survey
Shital Jaju [Thu, 30 Jan 2014 11:44:07 +0000 (13:44 +0200)]
nl80211: Verify that ifindex attribute is included in survey

This checks if the NL80211_ATTR_IFINDEX attribute is present before
trying to get the value of interface index.

Signed-hostap: Shital Jaju <shitalj@broadcom.com>

10 years agowpa_cli: Add tdls_external_control to tab completion for SET
Naresh Jayaram [Thu, 30 Jan 2014 11:10:29 +0000 (13:10 +0200)]
wpa_cli: Add tdls_external_control to tab completion for SET

This global configuration parameter was added in commit
800d58721c8a5721d1ddb1271093350ab769ade0 but the tab completion list for
the wpa_cli SET command in interactive mode was not updated.

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

10 years agoP2P: Disable DNS server from dnsmasq
Jouni Malinen [Wed, 4 Dec 2013 03:42:14 +0000 (05:42 +0200)]
P2P: Disable DNS server from dnsmasq

This avoids issues with multiple instances of dnsmasq running, e.g.,
with one on eth0 and the other one for the P2P group.

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

10 years agoP2P NFC: Add script for connection handover with nfcpy
Jouni Malinen [Fri, 22 Feb 2013 06:48:40 +0000 (22:48 -0800)]
P2P NFC: Add script for connection handover with nfcpy

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

10 years agoWPS NFC: Protect nfcpy pretty print calls against exceptions
Jouni Malinen [Fri, 29 Nov 2013 11:01:39 +0000 (13:01 +0200)]
WPS NFC: Protect nfcpy pretty print calls against exceptions

nfcpy does not yet support all the new message formats, so some of the
pretty() calls can result in exceptions.

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

10 years agoWPS NFC: nfcpy script to use new connection handover design
Jouni Malinen [Fri, 29 Nov 2013 10:59:26 +0000 (12:59 +0200)]
WPS NFC: nfcpy script to use new connection handover design

Fetch a carrier record from wpa_supplicant instead of full handover
request. This makes it easier for external programs to build handover
request messages with multiple alternative carriers.

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

10 years agoWPS NFC: Logging level configuration to wps-nfc.py and wps-ap-nfc.py
Jouni Malinen [Sat, 30 Nov 2013 14:49:04 +0000 (16:49 +0200)]
WPS NFC: Logging level configuration to wps-nfc.py and wps-ap-nfc.py

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

10 years agoWPS NFC: Clean up nfcpy script no-wait operations
Jouni Malinen [Fri, 29 Nov 2013 10:57:34 +0000 (12:57 +0200)]
WPS NFC: Clean up nfcpy script no-wait operations

This allows the scripts to terminate at proper point with --no-wait.

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

10 years agoWPS NFC: Validate ctrl_iface response before decoding it
Jouni Malinen [Fri, 29 Nov 2013 10:46:41 +0000 (12:46 +0200)]
WPS NFC: Validate ctrl_iface response before decoding it

If the operation fails for any reason ("FAIL" response), it is cleaner
to return error clearly instead of hitting an exception in the hex
decoder.

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

10 years agoWPS NFC: Use argparse in the nfcpy scripts
Jouni Malinen [Fri, 29 Nov 2013 10:41:34 +0000 (12:41 +0200)]
WPS NFC: Use argparse in the nfcpy scripts

This cleans up command line parsing and simplifies the commands.

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

10 years agoWPS NFC: Update wps-nfc.py and wps-ap-nfc.py to use new nfcpy API
Jouni Malinen [Fri, 29 Nov 2013 10:16:38 +0000 (12:16 +0200)]
WPS NFC: Update wps-nfc.py and wps-ap-nfc.py to use new nfcpy API

This moves many of the peer discovery operations into the core nfcpy.

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

10 years agotests: Add test cases for static handover for join-a-group
Jouni Malinen [Sun, 8 Sep 2013 16:46:47 +0000 (09:46 -0700)]
tests: Add test cases for static handover for join-a-group

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

10 years agotests: Add test cases WPS ER with NFC
Jouni Malinen [Sun, 28 Apr 2013 19:32:38 +0000 (22:32 +0300)]
tests: Add test cases WPS ER with NFC

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

10 years agotests: Add a test case for WPS connection handover with password token
Jouni Malinen [Thu, 4 Apr 2013 22:50:30 +0000 (01:50 +0300)]
tests: Add a test case for WPS connection handover with password token

This verifies that NFC connection handover can be used in a case where
hostapd has an enabled password token.

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

10 years agotests: Add test cases for public key hash mismatches
Jouni Malinen [Thu, 4 Apr 2013 15:47:13 +0000 (18:47 +0300)]
tests: Add test cases for public key hash mismatches

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

10 years agotests: Add a test case for NFC handover resulting in auto configuration
Jouni Malinen [Thu, 4 Apr 2013 14:32:46 +0000 (17:32 +0300)]
tests: Add a test case for NFC handover resulting in auto configuration

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

10 years agotests: Add test cases for P2P+NFC
Jouni Malinen [Tue, 2 Apr 2013 18:46:52 +0000 (21:46 +0300)]
tests: Add test cases for P2P+NFC

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

10 years agotests: Reset hostapd state with FLUSH between test cases
Jouni Malinen [Thu, 28 Nov 2013 13:50:47 +0000 (15:50 +0200)]
tests: Reset hostapd state with FLUSH between test cases

This is similar to the FLUSH command for wpa_supplicant.

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

10 years agoP2P NFC: Add support for freq option in NFC ctrl_iface commands
Jouni Malinen [Wed, 4 Dec 2013 03:44:56 +0000 (05:44 +0200)]
P2P NFC: Add support for freq option in NFC ctrl_iface commands

This can be used to force an operating channel for P2P group formation
triggered by NFC operations.

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

10 years agoWPS NFC: Use BSSID and AP Channel from handover select
Jouni Malinen [Thu, 28 Nov 2013 15:48:35 +0000 (17:48 +0200)]
WPS NFC: Use BSSID and AP Channel from handover select

These optional attributes, if present, can be used to speed up the
initial connection by using a single channel scan.

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

10 years agoWPS: Add testing option to corrupt public key hash
Jouni Malinen [Thu, 28 Nov 2013 13:47:19 +0000 (15:47 +0200)]
WPS: Add testing option to corrupt public key hash

If CONFIG_WPS_TESTING=y is enabled in build configuration, the new
wps_corrupt_pkhash parameter (similar to wps_testing_dummy_cred) can be
used to request public key hash to be corrupted in all generated OOB
Device Password attributes. This can be used for testing purposes to
validate public key hash validation steps.

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

10 years agoWPS NFC: add more debug prints for connection handover report
Jouni Malinen [Thu, 28 Nov 2013 11:47:32 +0000 (13:47 +0200)]
WPS NFC: add more debug prints for connection handover report

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

10 years agoWPS NFC: Use AP Channel information from credential container
Jouni Malinen [Thu, 28 Nov 2013 10:48:28 +0000 (12:48 +0200)]
WPS NFC: Use AP Channel information from credential container

This allows NFC Configuration Token to indicate the current AP operating
channel, so that a single channel scan can be used to speed up the
initial connection.

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

10 years agoWPS NFC: Add BSSID and AP channel info to Configuration Token
Jouni Malinen [Thu, 28 Nov 2013 10:31:32 +0000 (12:31 +0200)]
WPS NFC: Add BSSID and AP channel info to Configuration Token

This information can help the Enrollee to find the AP more quickly with
an optimized scan.

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

10 years agoWPS-STRICT: Update valid Device Password ID and Config Error range
Jouni Malinen [Tue, 26 Nov 2013 18:04:56 +0000 (20:04 +0200)]
WPS-STRICT: Update valid Device Password ID and Config Error range

Accept the new values defined for WPS NFC.

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

10 years agoP2P NFC: WPA state machine config with driver-based BSS selection
Jouni Malinen [Mon, 9 Sep 2013 00:15:42 +0000 (17:15 -0700)]
P2P NFC: WPA state machine config with driver-based BSS selection

wpa_s->current_bss was updated too late for the
wpa_supplicant_rsn_supp_set_config() call within
wpa_supplicant_select_config(). Re-order code so that current_bss gets
updated between current_ssid update and this call to set the WPA state
machine configuration, so that the new code that determines whether the
current GO support the new IP address assignment mechanism works.

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

10 years agoP2P NFC: Static handover with NFC Tag on client
Jouni Malinen [Sun, 8 Sep 2013 16:45:04 +0000 (09:45 -0700)]
P2P NFC: Static handover with NFC Tag on client

This adds a new P2P Invitation mechanism to invite a P2P Device with an
NFC Tag to an already operating group when the GO with NFC Device reads
the NFC Tag. The P2P Device with the NFC Tag will then accept invitation
and connect to the group automatically using its OOB Device Password.

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

10 years agoP2P NFC: Enable own NFC Tag on GO Registrar
Jouni Malinen [Sun, 8 Sep 2013 15:08:26 +0000 (08:08 -0700)]
P2P NFC: Enable own NFC Tag on GO Registrar

When "P2P_SET nfc_tag 1" is used to enable the own NFC Tag for P2P, also
enable it for any running GO interface.

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

10 years agoP2P NFC: Add GO info into handover message when in client role
Jouni Malinen [Sun, 8 Sep 2013 00:51:04 +0000 (17:51 -0700)]
P2P NFC: Add GO info into handover message when in client role

P2P Group ID can optionally be included in the connection handover
messages when acting as a P2P Client in a group. Add this information
and show it in the P2P-NFC-PEER-CLIENT event message.

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

10 years agoP2P NFC: Optimize join-a-group operation based on NFC information
Jouni Malinen [Sat, 7 Sep 2013 22:44:29 +0000 (15:44 -0700)]
P2P NFC: Optimize join-a-group operation based on NFC information

When the NFC connection handover message received from a peer indicates
that the peer is operating as a GO on a specific channel, use that
information to avoid having to go through full scan. In addition, skip
the separate join-a-group scan since we already know the operating
channel, GO P2P Device Address, and SSID.

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

10 years agoP2P NFC: Copy DH parameters to a separate group interface
Jouni Malinen [Thu, 11 Jul 2013 14:01:49 +0000 (17:01 +0300)]
P2P NFC: Copy DH parameters to a separate group interface

The DH public and private key needs to be copied for the separate group
interface if that is used for a P2P group.

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

10 years agoWPS NFC: Update DH keys for ER operations
Jouni Malinen [Thu, 11 Jul 2013 13:33:05 +0000 (16:33 +0300)]
WPS NFC: Update DH keys for ER operations

Since wpa_s->conf->wps_nfc_dh_* parameters can be set in number of code
paths, update the wps_context copy of the DH keys even if no new keys
were generated for the request. This tries to avoid some cases where
public key hash may not have matched the public key used in the ER
operation.

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

10 years agoWPS NFC: Use pubkey mismatch config error from Enrollee
Jouni Malinen [Thu, 11 Jul 2013 13:17:36 +0000 (16:17 +0300)]
WPS NFC: Use pubkey mismatch config error from Enrollee

This was already done for Registrar, but the Enrollee case did not
set config error properly if Registrar public key did not match the
hash received during NFC connection handover.

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

10 years agoP2P NFC: Add processing of P2P client while NFC handover case
Jouni Malinen [Thu, 4 Apr 2013 13:18:46 +0000 (16:18 +0300)]
P2P NFC: Add processing of P2P client while NFC handover case

Instead of automatically triggering a connection, provide an indication
of one of the devices being a P2P client to upper layers to allow user
to determine what to do next.

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

10 years agoP2P NFC: Do not try to join peer if both devices are already GO
Jouni Malinen [Thu, 4 Apr 2013 12:32:09 +0000 (15:32 +0300)]
P2P NFC: Do not try to join peer if both devices are already GO

Send a P2P-NFC-BOTH-GO event to upper layers to determine what to
do in case both devices going through NFC connection handover are
already operating as a GO.

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

10 years agoP2P: Add test option to disable IP address assignment request
Jouni Malinen [Thu, 4 Apr 2013 16:09:10 +0000 (19:09 +0300)]
P2P: Add test option to disable IP address assignment request

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

10 years agoP2P: Add support for IP address assignment in 4-way handshake
Jouni Malinen [Sat, 16 Mar 2013 17:13:31 +0000 (19:13 +0200)]
P2P: Add support for IP address assignment in 4-way handshake

This new mechanism allows P2P Client to request an IPv4 address from the
GO as part of the 4-way handshake to avoid use of DHCP exchange after
4-way handshake. If the new mechanism is used, the assigned IP address
is shown in the P2P-GROUP-STARTED event on the client side with
following new parameters: ip_addr, ip_mask, go_ip_addr. The assigned IP
address is included in the AP-STA-CONNECTED event on the GO side as a
new ip_addr parameter. The IP address is valid for the duration of the
association.

The IP address pool for this new mechanism is configured as global
wpa_supplicant configuration file parameters ip_addr_go, ip_addr_mask,
ip_addr_star, ip_addr_end. For example:

ip_addr_go=192.168.42.1
ip_addr_mask=255.255.255.0
ip_addr_start=192.168.42.2
ip_addr_end=192.168.42.100

DHCP mechanism is expected to be enabled at the same time to support P2P
Devices that do not use the new mechanism. The easiest way of managing
the IP addresses is by splitting the IP address range into two parts and
assign a separate range for wpa_supplicant and DHCP server.

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

10 years agoP2P NFC: Optimize GO Negotiation retries
Jouni Malinen [Sun, 24 Feb 2013 19:54:55 +0000 (21:54 +0200)]
P2P NFC: Optimize GO Negotiation retries

When NFC connection handover is used to trigger GO Negotiation, the
channel used for the GO Negotiation frames is already known. As such,
there is no need to use the Listen operations to find the peer.

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

10 years agoP2P NFC: Add NFC tag enabling for static handover
Jouni Malinen [Sat, 27 Apr 2013 14:50:50 +0000 (17:50 +0300)]
P2P NFC: Add NFC tag enabling for static handover

The device with the NFC Tag can be configured to enable NFC to be used
with "P2P_SET nfc_tag 1" and "P2P_LISTEN" commands to allow static
handover to be used.

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

10 years agoP2P NFC: Report handover select from tag for static handover
Jouni Malinen [Sat, 27 Apr 2013 15:38:41 +0000 (18:38 +0300)]
P2P NFC: Report handover select from tag for static handover

WPS_NFC_TAG_READ can be used to report static connection handover where
the connection handover select message was read from an NFC tag.

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

10 years agoP2P NFC: Report connection handover as trigger for P2P
Jouni Malinen [Sat, 27 Apr 2013 15:50:14 +0000 (18:50 +0300)]
P2P NFC: Report connection handover as trigger for P2P

"NFC_REPORT_HANDOVER {INIT,RESP} P2P <req> <sel>" can now be used to
report completed NFC negotiated connection handover in which the P2P
alternative carrier was selected.

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

10 years agoP2P NFC: Build connection handover messages
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
P2P NFC: Build connection handover messages

"NFC_GET_HANDOVER_{REQ,SEL} NDEF P2P-CR" can now be used to build P2P
alternative carrier record for NFC connection handover request/select
messages.

Static connection handover case can be enabled by configuring the DH
parameters (either with wps_nfc_* configuration parameters or with
WPS_NFC_TOKEN command at run time. The NFC Tag contents can be generated
with "NFC_GET_HANDOVER_SEL NDEF P2P-CR-TAG" after having configured
Listen channel (p2p_listen_reg_class/p2p_listen_channel).

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

10 years agoP2P NFC: Define WPS_NFC config method
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
P2P NFC: Define WPS_NFC config method

This will be used to track NFC as config method in P2P operations.

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

10 years agoP2P NFC: Allow separate WPS/P2P IES to be parsed
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
P2P NFC: Allow separate WPS/P2P IES to be parsed

This will be needed for processing the NFC connection handover messages
for P2P.

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

10 years agoP2P NFC: Pass OOB Dev Password through P2P parser
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
P2P NFC: Pass OOB Dev Password through P2P parser

This will be needed for processing the NFC connection handover messages
for P2P.

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

10 years agoP2P NFC: Pass OOB Device Password ID to P2P
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
P2P NFC: Pass OOB Device Password ID to P2P

GO Negotiation needs to know which OOB Device Password ID is assigned
for the peer when NFC is used as the trigger.

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

10 years agoP2P NFC: Add WPS attribute building for P2P NFC
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
P2P NFC: Add WPS attribute building for P2P NFC

These functions can be used to build the WPS attributes for P2P NFC
connection handover messages.

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

10 years agoP2P NFC: Add NDEF helpers for P2P connection handover messages
Jouni Malinen [Sat, 27 Apr 2013 14:55:20 +0000 (17:55 +0300)]
P2P NFC: Add NDEF helpers for P2P connection handover messages

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

10 years agoP2P NFC: Add OOB GO Negotiation Channel attribute
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
P2P NFC: Add OOB GO Negotiation Channel attribute

Add definition and helper functions for the new OOB GO Negotiation
Channel attribute.

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

10 years agoWPS NFC: Allow BSSID and channel to be included in handover select
Jouni Malinen [Sat, 27 Apr 2013 17:31:28 +0000 (20:31 +0300)]
WPS NFC: Allow BSSID and channel to be included in handover select

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

10 years agoNFC: Update WPS ER to use the new connection handover design
Jouni Malinen [Fri, 12 Apr 2013 04:37:41 +0000 (21:37 -0700)]
NFC: Update WPS ER to use the new connection handover design

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

10 years agoWPS NFC: Add support for wpa_supplicant AP/GO mode to use handover
Jouni Malinen [Thu, 4 Apr 2013 13:43:12 +0000 (16:43 +0300)]
WPS NFC: Add support for wpa_supplicant AP/GO mode to use handover

New functionality is needed for this with the update NFC connection
handover design that depends on the AP side using the public key hash
from the handover request.

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

10 years agoWPS NFC: Process new style handover select
Jouni Malinen [Tue, 2 Apr 2013 15:30:58 +0000 (18:30 +0300)]
WPS NFC: Process new style handover select

The new WPS connection handover select includes Registrar public key
hash instead of credential. Use the new information to start
abbreviated WPS handshake instead of configuring a new network directly
from the old Credential-from-NFC design.

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

10 years agoWPS NFC: New style connection handover select from AP/Registrar
Jouni Malinen [Sat, 27 Apr 2013 13:58:56 +0000 (16:58 +0300)]
WPS NFC: New style connection handover select from AP/Registrar

The contents of the WPS connection handover select message was modified
to include the Registrar public key hash instead of the credential.

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

10 years agoWPS NFC: Add AP mode connection handover report
Jouni Malinen [Tue, 2 Apr 2013 15:30:58 +0000 (18:30 +0300)]
WPS NFC: Add AP mode connection handover report

The new NFC connection handover design requires the AP/Registrar to
process the connection handover request message received from the
Enrollee. Add control interface commands for handling this.

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

10 years agoWPS NFC: Build new style carrier record for connection handover request
Jouni Malinen [Tue, 2 Apr 2013 15:30:58 +0000 (18:30 +0300)]
WPS NFC: Build new style carrier record for connection handover request

It is more useful to be able to build a single NFC carrier record
instead of the full connection handover request message to allow
external components to decide whether to negotiate which alternative
carrier is used. This updates the carrier record contents to the new
design to include Enrollee public key hash and provides this as a
carrier record instead of full message. An external program is expected
to be used to build the full NFC connection handover message with
potentially other alternative carrier records included.

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

10 years agoWPS NFC: Split DH key generation to a separate function
Jouni Malinen [Tue, 30 Apr 2013 15:17:23 +0000 (18:17 +0300)]
WPS NFC: Split DH key generation to a separate function

This allows DH key generation to be shared for other purposes than just
the case of OOB Device Password building. In addition, force the DH
public key buffer to be full 192 octets with zero padding to avoid
issues with the buffer being used in messages sent to a peer device.

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

10 years agoWPS NFC: Update NFC connection handover design
Jouni Malinen [Tue, 2 Apr 2013 15:30:58 +0000 (18:30 +0300)]
WPS NFC: Update NFC connection handover design

The new Device Password ID 7 is used to indicate that NFC connection
handover is used with DH public key hash from both devices being
exchanged over the NFC connection handover messages. This allows an
abbreviated M1-M2 handshake to be used since Device Password does not
need to be used when DH is authenticated with the out-of-band
information (validation of the public key against the hash).

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

10 years agoWPS NFC: Use abbreviated handshake if both PK hashes delivered OOB
Jouni Malinen [Sun, 24 Feb 2013 15:30:18 +0000 (17:30 +0200)]
WPS NFC: Use abbreviated handshake if both PK hashes delivered OOB

When both the Registrar and Enrollee public key hashes are delivered
out-of-band (in NFC connection handover), use abbreviated WPS handshake
(skip M3-M8).

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

10 years agoWPS: Preparations for allowing SSID filtering for provisioning step
Jouni Malinen [Tue, 2 Apr 2013 15:29:23 +0000 (18:29 +0300)]
WPS: Preparations for allowing SSID filtering for provisioning step

If the SSID of the WPS AP is known, it should be possible to limit AP
selection based on this when searching for an active WPS AP. This commit
adds a mechanism to specify SSID for this type of uses.

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

10 years agoWPS NFC: Validate peer public key hash on Enrollee
Jouni Malinen [Fri, 15 Feb 2013 19:29:22 +0000 (21:29 +0200)]
WPS NFC: Validate peer public key hash on Enrollee

Since the Enrollee can now get the public key hash from the Registrar,
there is need to validate this during the WPS protocol run.

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

10 years agoWPS NFC: Send M2D with config error 20 on pkhash mismatch
Jouni Malinen [Sat, 13 Apr 2013 18:15:36 +0000 (11:15 -0700)]
WPS NFC: Send M2D with config error 20 on pkhash mismatch

Instead of terminating the WPS protocol immediately, go through an M2D
exchange to notify Enrollee of the public key hash mismatch.

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

10 years agoWPS: Remove Version attribute from NFC messages
Jouni Malinen [Thu, 4 Apr 2013 07:03:17 +0000 (10:03 +0300)]
WPS: Remove Version attribute from NFC messages

This old Version attribute is not really needed anymore for these use
cases with the assumption that there are no existing WPS+NFC
deployments. It was removed from the WSC specification, so make the
implementation match that change.

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

10 years agoWPS: Add builder functions for AP Channel and RF Bands attributes
Jouni Malinen [Sat, 27 Apr 2013 17:43:35 +0000 (20:43 +0300)]
WPS: Add builder functions for AP Channel and RF Bands attributes

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

10 years agoP2P: Make group operating channel available
Jouni Malinen [Sat, 16 Mar 2013 18:45:21 +0000 (20:45 +0200)]
P2P: Make group operating channel available

Provide local GO channel to the P2P module so that it can be used in
messages that indicate the current operating channel.

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

10 years agoP2P: Split add-group-info into a helper function
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
P2P: Split add-group-info into a helper function

This functionality is needed for other messages, too, so split the group
info building code into a separate helper function.

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

10 years agoP2P: Apply unsafe frequency rules to available channels
Arif Hussain [Fri, 24 Jan 2014 14:14:29 +0000 (16:14 +0200)]
P2P: Apply unsafe frequency rules to available channels

This adds a QCA vendor specific nl80211 event to allow the driver to
indicate a list of frequency ranges that should be avoided due to
interference or possible known co-existance constraints. Such
frequencies are marked as not allowed for P2P use to force groups to be
formed on different channels.

If a P2P GO is operating on a channel that the driver recommended not to
use, a notification about this is sent on the control interface and
upper layer code may decide to tear down the group and optionally
restart it on another channel. As a TODO item, this could also be changed
to use CSA to avoid removing the group.

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

10 years agoAdd a header file defining QCA OUI and vendor extensions
Jouni Malinen [Fri, 24 Jan 2014 13:58:00 +0000 (15:58 +0200)]
Add a header file defining QCA OUI and vendor extensions

This file is used as a registry of identifier assignments from the
Qualcomm Atheros OUI 00:13:74 for purposes other than MAC address
assignment. One of the first uses will be for nl80211 vendor
commands/events which is reason for the preparation change in
driver_nl80211.c

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

10 years agoIncrease global ctrl_iface buffer to same size as per-interface
Jouni Malinen [Thu, 23 Jan 2014 14:57:15 +0000 (16:57 +0200)]
Increase global ctrl_iface buffer to same size as per-interface

Since the global ctrl_iface can be used with IFNAME= prefix to send
commands to be processed by per-interface code, it should have the same
(well, close to same since the prefix takes some space) limits on
command length as the per-interface ctrl_iface. Increase the buffer from
256 to 4096 to achieve this.

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

10 years agotests: Verify GAS/ANQP use during PMF association
Jouni Malinen [Thu, 23 Jan 2014 08:28:04 +0000 (10:28 +0200)]
tests: Verify GAS/ANQP use during PMF association

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

10 years agoGAS client: Use Protected Dual of Public Action frames with PMF
Jouni Malinen [Thu, 23 Jan 2014 09:18:20 +0000 (11:18 +0200)]
GAS client: Use Protected Dual of Public Action frames with PMF

When GAS is used with PMF negotiated, Protected Dual of Public Action
frames are expected to be used instead of Public Action frames, i.e.,
the GAS/ANQP frames are expected to be encrypted. Conver Public Action
GAS queries to use Dual of Public Action frame if PMF has been
negotiated with the AP to which the frame is being sent.

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

10 years agoGAS server: Add support for Protected Dual of Public Action frames
Jouni Malinen [Thu, 23 Jan 2014 09:15:28 +0000 (11:15 +0200)]
GAS server: Add support for Protected Dual of Public Action frames

When GAS is used with PMF negotiated, Protected Dual of Public Action
frames are expected to be used instead of Public Action frames, i.e.,
the GAS/ANQP frames are expected to be encrypted. Add support for this
different category of Action frames being used for GAS. The payload
after the Category field is identical, so the only change is in using
the Category field based on what was received in the request frames. For
backwards compatibility, do not enforce protected dual to be used on the
AP side, i.e., follow what the station does.

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

10 years agoAdd definitions for Protected Dual of Public Action frames
Jouni Malinen [Thu, 23 Jan 2014 09:12:27 +0000 (11:12 +0200)]
Add definitions for Protected Dual of Public Action frames

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

10 years agohostapd: Fix PMF robust Action frame processing rules
Jouni Malinen [Thu, 23 Jan 2014 08:24:21 +0000 (10:24 +0200)]
hostapd: Fix PMF robust Action frame processing rules

Due to misplaced parenthesis, unprotected not-Robust Action frames
(e.g., Public Action frames) were dropped in handle_assoc() when such
frames were received during an association that had negotiated use of
PMF. This is not correct since only unprotected Robust Action frames
were supposed to be handled in this way.

This would have broken any Public Action frame use during PMF
association, but such frames were not really supposed to be used
currently (ANQP as the only possible use case should really use
protected dual option in such case).

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

10 years agoClear more configuration parameters to default on FLUSH
Jouni Malinen [Thu, 23 Jan 2014 08:21:49 +0000 (10:21 +0200)]
Clear more configuration parameters to default on FLUSH

This makes it more convenient for test scripts to change parameters for
a specific test case without having to separately clear them between
each test case.

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

10 years agowpa_supplicant: Schedule PNO on completion of ongoing sched_scan
Raja Mani [Wed, 22 Jan 2014 14:15:23 +0000 (19:45 +0530)]
wpa_supplicant: Schedule PNO on completion of ongoing sched_scan

When start PNO request comes from control interface, wpa_supplicant
should wait until ongoing sched_scan (triggered by wpa_supplicant)
gets cancelled. Issuing cancel sched_scan and start PNO scan
one after another from pno_start() would lead wpa_supplicant to clear
wps->sched_scanning flag while getting sched_scan stopped event
from driver for cancel sched_scan request. In fact, PNO scan will
be in progress in driver and wpa_s->sched_scanning will not be set
in such cases.

In addition to this change, RSSI threshold limit is passed as part of
start sched_scan request. This was previously set only in pno_start(),
but the same parameter should be available for generic sched_scan calls
as well and this can now be reached through the new PNO start sequence.

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

10 years agonl80211: Fix sizeof check in vendor command/event handling
Max Stepanov [Wed, 22 Jan 2014 14:05:47 +0000 (16:05 +0200)]
nl80211: Fix sizeof check in vendor command/event handling

Fix sizeof in a validity comparison of nl80211_vendor_cmd_info size. The
incorrect version happened to work on 64-bit builds due the structure
being eight octets, but this was incorrect and would not used with
32-bit builds.

Signed-hostap: Max Stepanov <Max.Stepanov@intel.com>

10 years agohostapd: Fix segmentation fault when calling hostapd_cli all_sta
Ilan Peer [Wed, 22 Jan 2014 14:05:46 +0000 (16:05 +0200)]
hostapd: Fix segmentation fault when calling hostapd_cli all_sta

While iterating over the stations hostapd_ctrl_iface_sta_mib()
might be called with sta == NULL. Fix this.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>

10 years agowpa_supplicant: Fix seg fault in wpas_ctrl_radio_work_flush() in error case
Max Stepanov [Wed, 22 Jan 2014 14:05:45 +0000 (16:05 +0200)]
wpa_supplicant: Fix seg fault in wpas_ctrl_radio_work_flush() in error case

Verify wpa_s->radio pointer before accessing it. If interface addition
fails, this could get called before wpa_s->radio has been set.

The segmentation fault details:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004b9591 in wpas_ctrl_radio_work_flush (wpa_s=0x77fff0) at ctrl_iface.c:5754
5754 dl_list_for_each_safe(work, tmp, &wpa_s->radio->work,

Call stack:
0  wpas_ctrl_radio_work_flush (wpa_s=0x77fff0) at ctrl_iface.c:5754
1  wpa_supplicant_deinit_iface (wpa_s=0x77fff0, notify=0, terminate=0) at wpa_supplicant.c:3619
2  wpa_supplicant_add_iface (global=0x75db10, iface=0x7fffffffe270) at wpa_supplicant.c:3691
3  wpas_p2p_add_p2pdev_interface (wpa_s=0x75dd20) at p2p_supplicant.c:3700
4  main (argc=<optimized out>, argv=<optimized out>) at main.c:317

Function:
5750 void wpas_ctrl_radio_work_flush(struct wpa_supplicant *wpa_s)
5751 {
5752 struct wpa_radio_work *work, *tmp;
5753
5754 dl_list_for_each_safe(work, tmp, &wpa_s->radio->work,
5755       struct wpa_radio_work, list) {
5756 struct wpa_external_work *ework;
5757
5758 if (os_strncmp(work->type, "ext:", 4) != 0)

Root cause:
(gdb) p wpa_s->radio
$1 = (struct wpa_radio *) 0x0

Signed-hostap: Max Stepanov <Max.Stepanov@intel.com>

10 years agoP2P: Clone dtim_period to a new interface
David Spinadel [Wed, 22 Jan 2014 14:05:44 +0000 (16:05 +0200)]
P2P: Clone dtim_period to a new interface

Cloning dtim_period is needed for P2P GO.

Signed-hostap: David Spinadel <david.spinadel@intel.com>

10 years agoUpdate copyright years in the manpages
Jouni Malinen [Tue, 21 Jan 2014 14:33:25 +0000 (16:33 +0200)]
Update copyright years in the manpages

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

10 years agoSync manpages and command-line options
Dan Winship [Mon, 20 Jan 2014 23:11:31 +0000 (17:11 -0600)]
Sync manpages and command-line options

Signed-hostap: Dan Williams <dcbw@redhat.com>

10 years agoAdd manpage for eapol_test
Dan Williams [Mon, 20 Jan 2014 23:04:03 +0000 (17:04 -0600)]
Add manpage for eapol_test

Signed-hostap: Dan Williams <dcbw@redhat.com>

10 years agowpa_supplicant: Fix usage text based on build options
Dan Williams [Mon, 20 Jan 2014 23:03:15 +0000 (17:03 -0600)]
wpa_supplicant: Fix usage text based on build options

Signed-hostap: Dan Williams <dcbw@redhat.com>

10 years agoP2P: Reduce peer expiration age to 60 sec and allow customization
Dmitry Shmidt [Fri, 17 Jan 2014 18:58:50 +0000 (10:58 -0800)]
P2P: Reduce peer expiration age to 60 sec and allow customization

The new default value (from 300 to 60 seconds) makes the internal P2P
peer list somewhat faster to react to peers becoming unreachable while
still maintaining entries for some time to avoid them disappearing
during user interaction (e.g., selecting a peer for a connection or
entering a PIN).

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoSkip normal scan when PNO is already in progress
Raja Mani [Sat, 18 Jan 2014 14:46:24 +0000 (20:16 +0530)]
Skip normal scan when PNO is already in progress

Scan request failures are observed in wpa_supplicant debug log when
Android framework starts PNO scan in driver via ctrl interface command
'set pno 1' and wpa_supplicant also tries to issue a scan request after
PNO has started in the driver.

Some drivers may reject a normal scan request when PNO is already in
progress. wpa_supplicant should consider PNO status before issuing start
scan request to the driver. Otherwise, wpa_supplicant will get failures
from driver for the scan request and it will end up rescheduling scan
request in periodic interval and get a start scan request failure for
each attempt.

In order to avoid unnecessary scan attempt when PNO scan is already
running, PNO status is checked before issuing scan request to driver.

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

10 years agoP2P: Extend the listen time based on the active concurrent session
Rashmi Ramanna [Mon, 20 Jan 2014 20:55:09 +0000 (22:55 +0200)]
P2P: Extend the listen time based on the active concurrent session

A P2P Device while in the Listen state waiting to respond for the
obtained group negotiation request shall give a fair chance for other
concurrent sessions to use the shared radio by inducing an idle time
between the successive listen states. However, if there are no
concurrent operations, this idle time can be reduced.

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

10 years agotests: Verify peer discovery in no-Probe Request case
Jouni Malinen [Fri, 17 Jan 2014 17:38:02 +0000 (19:38 +0200)]
tests: Verify peer discovery in no-Probe Request case

Verify that PD Request followed by GO Negotiation Request is enough to
learn the Listen frequency of the peer.

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

10 years agoP2P: Allow GO Negotiation Request to update peer entry after PD
Po-Lun Lai [Fri, 17 Jan 2014 17:35:03 +0000 (19:35 +0200)]
P2P: Allow GO Negotiation Request to update peer entry after PD

Previously, GO Negotiation Request frame was used to update a peer entry
if only a Probe Request from that peer had been received. However, it
would be possible, even if unlikely, for a peer to be discovered based
on receiving Provision Discovery Request frame from it and no Probe
Request frame. In such a case, the Listen frequency of the peer would
not be known and group formation could not be (re-)initialized with that
peer. Fix this by allowing the GO Negotiation Request frame to update
peer entry if the current peer entry does not include Listen or
Operating frequency.

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

10 years agohwsim tests: vm: add optional time-warp
Johannes Berg [Wed, 15 Jan 2014 19:58:39 +0000 (20:58 +0100)]
hwsim tests: vm: add optional time-warp

To test the code under the influence of time jumps, add the option
(--timewarp) to the VM tests to reset the clock all the time, which
makes the wall clock time jump speed up 20x, causing gettimeofday()
to be unreliable for timeout calculations.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

10 years agoP2P: Add missing direct global ctrl_iface commands for P2P
Dmitry Shmidt [Wed, 15 Jan 2014 18:27:19 +0000 (10:27 -0800)]
P2P: Add missing direct global ctrl_iface commands for P2P

It should be noted that these commands are not exclusively used for P2P
or in the global context, so use of these commands through the global
control interface for operations that are specific to a single interface
have undefined behavior and that behavior may change in the future. As
such, these are recommend only for operations that are in the global
context (e.g., for P2P management).

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoP2P: Use GO's operating channel to optimize scan during join
Jithu Jance [Wed, 15 Jan 2014 13:47:19 +0000 (19:17 +0530)]
P2P: Use GO's operating channel to optimize scan during join

Use P2P GO's operating channel information, if known, to do a single
channel scan during the join operation.

Signed-hostap: Jithu Jance <jithu@broadcom.com>