mech_eap.git
10 years agoTLS: Add tls_disable_tlsv1_1 and tls_disable_tlsv1_2 phase1 params
Dmitry Shmidt [Wed, 19 Feb 2014 21:21:58 +0000 (13:21 -0800)]
TLS: Add tls_disable_tlsv1_1 and tls_disable_tlsv1_2 phase1 params

These can be used to disable TLSv1.1 and TLSv1.2 as a workaround for AAA
servers that have issues interoperating with newer TLS versions.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agotests: Verify NAS identification attributes in Disconnect-Request
Jouni Malinen [Thu, 20 Feb 2014 11:56:27 +0000 (13:56 +0200)]
tests: Verify NAS identification attributes in Disconnect-Request

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoRADIUS DAS: Add support for NAS identification attributes
Jouni Malinen [Thu, 20 Feb 2014 11:55:36 +0000 (13:55 +0200)]
RADIUS DAS: Add support for NAS identification attributes

This allows NAS-IP-Address, NAS-Identifier, and NAS-IPv6-Address to be
included in the Disconnect-Request packets.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotests: Verify that Disconnect-Request prevents PMKSA caching
Jouni Malinen [Thu, 20 Feb 2014 11:27:16 +0000 (13:27 +0200)]
tests: Verify that Disconnect-Request prevents PMKSA caching

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoRADIUS DAS: Remove PMKSA entry on Disconnect-Request
Jouni Malinen [Thu, 20 Feb 2014 11:26:22 +0000 (13:26 +0200)]
RADIUS DAS: Remove PMKSA entry on Disconnect-Request

When a station is disconnected based on Disconnect-Request, it is better
to force the station to go through full EAP authentication if it tries
to reconnect.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoWPS: Fix STA state validation when processing PutWLANResponse
Jouni Malinen [Wed, 19 Feb 2014 21:51:55 +0000 (23:51 +0200)]
WPS: Fix STA state validation when processing PutWLANResponse

It is possible for an ER to send an unexpected PutWLANResponse action
when the destination STA is in disassociated, but not fully
deauthenticated state. sta->eapol_sm can be NULL in such state and as
such, it would be possible to hit a NULL pointer dereference in the
eapol_auth_eap_pending_cb() call at the end of the
hostapd_wps_probe_req_rx() when trying to proxy the WPS message to the
station. Fix this by validating that sta->eapol_sm is set before
processing the message.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoAndroid: Use external libnl 2.0 dynamic library
Dmitry Shmidt [Wed, 19 Feb 2014 00:26:10 +0000 (16:26 -0800)]
Android: Use external libnl 2.0 dynamic library

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoFix hostapd and wpa_supplicant build with binutils >= 2.24.x
Roger Zanoni [Mon, 17 Feb 2014 19:02:47 +0000 (15:02 -0400)]
Fix hostapd and wpa_supplicant build with binutils >= 2.24.x

Using binutils >= 2.24.x and setting
CONFIG_WPA_TRACE/CONFIG_WPA_TRACE_BDF causes both builds to fail with
"#error config.h must be included before this header" message.

Since version 2.24.x, the bfd header checks for PACKAGE and
PACKAGE_VERSION macros.

As suggested in http://sourceware.org/bugzilla/show_bug.cgi?id=14243
projects that use bfd and don't use autotools should define a PACKAGE
macro.

Signed-off-by: Roger Zanoni <roger.zanoni@openbossa.org>
10 years agoRevert "OpenSSL: Do not accept SSL Client certificate for server"
Jouni Malinen [Wed, 19 Feb 2014 09:56:02 +0000 (11:56 +0200)]
Revert "OpenSSL: Do not accept SSL Client certificate for server"

This reverts commit 51e3eafb68e15e78e98ca955704be8a6c3a7b304. There are
too many deployed AAA servers that include both id-kp-clientAuth and
id-kp-serverAuth EKUs for this change to be acceptable as a generic rule
for AAA authentication server validation. OpenSSL enforces the policy of
not connecting if only id-kp-clientAuth is included. If a valid EKU is
listed with it, the connection needs to be accepted.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoP2P: Enable U-APSD support on GO automatically
Jouni Malinen [Mon, 17 Feb 2014 11:15:29 +0000 (13:15 +0200)]
P2P: Enable U-APSD support on GO automatically

Since P2P specification mandates P2P GO to support WMM-PS with legacy
STAs, enable this automatically if the driver indicates support for
U-APSD in AP mode. The "P2P_SET go_apsd 0" command can still be used to
disable this if needed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoP2P: Add more debug prints for Probe Request processing
Jouni Malinen [Mon, 17 Feb 2014 09:43:53 +0000 (11:43 +0200)]
P2P: Add more debug prints for Probe Request processing

It can be helpful to see from the debug log why the P2P Device role did
not reply to a Probe Request frame.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotests: Add more time for P2P discovery tests
Jouni Malinen [Mon, 17 Feb 2014 09:42:43 +0000 (11:42 +0200)]
tests: Add more time for P2P discovery tests

It looks like some of the discovery_* test cases have been failing every
now and then on the virtual server and the one second timeout could have
been a bit too short to cover some possible timing cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agowpa_supplicant: Complete radio works on disable event
Andrei Otcheretianski [Thu, 13 Feb 2014 09:24:00 +0000 (11:24 +0200)]
wpa_supplicant: Complete radio works on disable event

While testing rfkill blocking of a scanning interface, it
was seen that the ongoing scan never completes. This happens
since EVENT_SCAN_RESULTS is discarded on a disabled interface.

Fix this and also other possible radio work completion issues
by removing all the radio works (including started) of the
disabled interface.

To be able to remove already started radio works, make their
callbacks be reentrant with deinit flag (when the work
is started), so each radio work should be able to handle
its own termination.

Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>

10 years agotests: Verify CoA-Request behavior
Jouni Malinen [Sat, 15 Feb 2014 20:03:06 +0000 (22:03 +0200)]
tests: Verify CoA-Request behavior

This version verifies that hostapd NAKs a valid request since
CoA-Request is not yet supported.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Convert connect() to use kwargs
Jouni Malinen [Sat, 15 Feb 2014 17:52:56 +0000 (19:52 +0200)]
tests: Convert connect() to use kwargs

This makes it more convenient to add new network block parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Verify RADIUS Disconnect-Request behavior
Jouni Malinen [Sat, 15 Feb 2014 17:27:35 +0000 (19:27 +0200)]
tests: Verify RADIUS Disconnect-Request behavior

This uses pyrad to build and send various Disconnect-Request packets to
hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoConvert RADIUS debug dumps to use wpa_printf()
Jouni Malinen [Sat, 15 Feb 2014 17:26:12 +0000 (19:26 +0200)]
Convert RADIUS debug dumps to use wpa_printf()

This allows the debug dumps of RADIUS messages to be captured through
normal wpa_printf() mechanisms.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoEAP-SIM DB: Remove client socket file on connect() error
Jouni Malinen [Sat, 15 Feb 2014 14:45:57 +0000 (16:45 +0200)]
EAP-SIM DB: Remove client socket file on connect() error

If the connection from hostapd authentication server to hlr_auc_gw fails
due to hlr_auc_gw not running yet, the local socket file was left
behind. Delete the socket file on connect() failure path.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Verify RADIUS server MIB values
Jouni Malinen [Sat, 15 Feb 2014 13:57:21 +0000 (15:57 +0200)]
tests: Verify RADIUS server MIB values

Enable hostapd control interface for the RADIUS server instance and
verify that the RADIUS server MIB counters are incremented.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Verify RADIUS accounting functionality
Jouni Malinen [Sat, 15 Feb 2014 13:38:30 +0000 (15:38 +0200)]
tests: Verify RADIUS accounting functionality

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Build hlr_auc_gw separately for code coverage analysis
Jouni Malinen [Sat, 15 Feb 2014 15:07:35 +0000 (17:07 +0200)]
tests: Build hlr_auc_gw separately for code coverage analysis

This improves accuracy of the code coverage reports with hostapd-as-AS
and hlr_auc_gw getting analyzed separately.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRADIUS: Add minimal accounting server support
Jouni Malinen [Sat, 15 Feb 2014 13:37:53 +0000 (15:37 +0200)]
RADIUS: Add minimal accounting server support

This can be used to test RADIUS Accounting in hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Verify NtPasswordHash with different UTF-8 cases
Jouni Malinen [Sat, 15 Feb 2014 10:08:50 +0000 (12:08 +0200)]
tests: Verify NtPasswordHash with different UTF-8 cases

This adds a password that uses one, two, and three octet encoding
for UTF-8 characters. The value is tested against a pre-configured
hash to verify that utf8_to_ucs2() function works correctly.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoFix MSCHAP UTF-8 to UCS-2 conversion for three-byte encoding
Jouni Malinen [Sat, 15 Feb 2014 10:06:35 +0000 (12:06 +0200)]
Fix MSCHAP UTF-8 to UCS-2 conversion for three-byte encoding

This fixes issues in using a password that includes a UTF-8 character
with three-byte encoding with EAP methods that use NtPasswordHash
(anything using MSCHAPv2 or LEAP).

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoFix nt_password_hash build
Jouni Malinen [Sat, 15 Feb 2014 09:49:09 +0000 (11:49 +0200)]
Fix nt_password_hash build

This needs librt on some systems for clock_gettime().

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRemove unused crypto_bignum_rshift()
Jouni Malinen [Sat, 15 Feb 2014 09:31:20 +0000 (11:31 +0200)]
Remove unused crypto_bignum_rshift()

Commit bf4f5d6570c847109378fd4f44e3d89c6ebb3acd removed the only user of
this function.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRemove unused NFC_RX_HANDOVER_REQ
Jouni Malinen [Sat, 15 Feb 2014 09:22:26 +0000 (11:22 +0200)]
Remove unused NFC_RX_HANDOVER_REQ

The more generic NFC_REPORT_HANDOVER is now used to report completed NFC
connection handover operations in either role and NFC_RX_HANDOVER_REQ
did not have any implementation within wpa_supplicant.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Set dh_file on EAP client
Jouni Malinen [Sat, 15 Feb 2014 08:42:56 +0000 (10:42 +0200)]
tests: Set dh_file on EAP client

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP-TTLS and server certificate with client EKU
Jouni Malinen [Sat, 15 Feb 2014 08:33:55 +0000 (10:33 +0200)]
tests: EAP-TTLS and server certificate with client EKU

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Expired server certificate
Jouni Malinen [Sat, 15 Feb 2014 08:28:22 +0000 (10:28 +0200)]
tests: Expired server certificate

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Domain name suffix match against CN
Jouni Malinen [Sat, 15 Feb 2014 08:10:56 +0000 (10:10 +0200)]
tests: Domain name suffix match against CN

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agonl80211: Use nl80211_set_iface_id() to get hw features data
Ilan Peer [Thu, 13 Feb 2014 09:24:01 +0000 (11:24 +0200)]
nl80211: Use nl80211_set_iface_id() to get hw features data

Use nl80211_set_iface_id() in wpa_driver_nl80211_get_hw_feature_data(),
as otherwise the function fails for a P2P Device interface (which does
not have a netdev associated with it).

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

10 years agohostapd: Add Operating Mode Notification support
Marek Kwaczynski [Mon, 10 Feb 2014 12:43:05 +0000 (13:43 +0100)]
hostapd: Add Operating Mode Notification support

Handle Operating Mode Notification received in (Re)Association Request
frames.

Signed-hostap: Marek Kwaczynski <marek.kwaczynski@tieto.com>

10 years agohostapd: Enable IEEE 802.11w in defconfig
Helmut Schaa [Fri, 7 Feb 2014 09:31:56 +0000 (10:31 +0100)]
hostapd: Enable IEEE 802.11w in defconfig

IEEE 802.11w is ratified since 2009 already, so this comment does not
seem to be valid anymore.

Signed-hostap: Helmut Schaa <helmut.schaa@googlemail.com>

10 years agoNFC: Workaround nfcpy message debug exception
Jouni Malinen [Thu, 13 Feb 2014 14:14:04 +0000 (16:14 +0200)]
NFC: Workaround nfcpy message debug exception

The current nfcpy version does not support new WSC connection handover
message format and the handover server fails to process the request due
to a debug print. As a temporary workaround, override
HandoverServer::_process_request() with a version that avoids pretty()
print of the handover messages. This can be removed once nfcpy has been
updated to support the new format.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoAvoid NULL dereference in ieee802_1x_get_mib_sta() printf
Eytan Lifshitz [Mon, 10 Feb 2014 10:55:09 +0000 (12:55 +0200)]
Avoid NULL dereference in ieee802_1x_get_mib_sta() printf

In function ieee802_1x_get_mib_sta(), eap_server_get_name() may return
NULL, and it could be dereferenced immidiately by os_snprintf() (if the
snprintf implementation does not handle NULL pointer).

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

10 years agowpa_supplicant: Fix NULL dereference in tls_verify_cb()
Eytan Lifshitz [Mon, 10 Feb 2014 10:55:08 +0000 (12:55 +0200)]
wpa_supplicant: Fix NULL dereference in tls_verify_cb()

In function tls_verify_cb(), X509_STORE_CTX_get_current_cert() may
return NULL, and it will be dereferenced by X509_get_subject_name().

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

10 years agowpa_supplicant: Fix NULL dereference in eap_fast_parse_end()
Eytan Lifshitz [Mon, 10 Feb 2014 10:55:07 +0000 (12:55 +0200)]
wpa_supplicant: Fix NULL dereference in eap_fast_parse_end()

In eap_fast_parse_end(), pos might be NULL if the line doesn't
contain '='.

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

10 years agoRemove unnecessary NULL check
Eytan Lifshitz [Mon, 10 Feb 2014 10:55:06 +0000 (12:55 +0200)]
Remove unnecessary NULL check

In send_assoc_resp(), sta was checked for NULL, although it can't be
NULL.

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

10 years agoFix theoretical NULL dereference in debug printf
Eytan Lifshitz [Mon, 10 Feb 2014 10:55:06 +0000 (12:55 +0200)]
Fix theoretical NULL dereference in debug printf

In hostapd_logger_cb(), module_str is checked for NULL (on a path that
does not get executed in practice), and then possibly dereferenced in
snprintf() anyway.

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

10 years agoP2P: Avoid compiler warning in p2p_supplicant.c
Max Stepanov [Mon, 10 Feb 2014 10:55:05 +0000 (12:55 +0200)]
P2P: Avoid compiler warning in p2p_supplicant.c

Initialize flag variable explicitly to avoid [-Wmaybeuninitialized]
compiler warning in wpas_p2p_verify_channel().

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

10 years agoDFS: Avoid compiler warnings in src/ap/dfs.c
Max Stepanov [Mon, 10 Feb 2014 10:55:04 +0000 (12:55 +0200)]
DFS: Avoid compiler warnings in src/ap/dfs.c

Initialize variables explicitly to avoid [-Wmaybeuninitialized] compiler
warning in hostapd_handle_dfs() and
hostapd_dfs_start_channel_switch_cac() functions.

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

10 years agowpa_supplicant: Fix memory leak in wfd_subelems error path
Eytan Lifshitz [Mon, 10 Feb 2014 10:55:03 +0000 (12:55 +0200)]
wpa_supplicant: Fix memory leak in wfd_subelems error path

Memory allocated by calling function ieee802_11_vendor_ie_concat()
was not freed on an error path int ctrl_iface BSS command.

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

10 years agoFix CONFIG_WPS_NFC=y build without CONFIG_P2P=y
Jouni Malinen [Thu, 13 Feb 2014 13:29:09 +0000 (15:29 +0200)]
Fix CONFIG_WPS_NFC=y build without CONFIG_P2P=y

Some of the control interface operations for P2P were not properly
protected with #ifdef CONFIG_P2P.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoAdd bssid/freq hint for driver-based BSS selection
Dmitry Shmidt [Thu, 13 Feb 2014 13:14:18 +0000 (15:14 +0200)]
Add bssid/freq hint for driver-based BSS selection

This uses the new nl80211 attributes to allow the connect command to
provide bssid and freq hints to the driver without limiting roaming to
the specific BSS/frequency. This can be used by drivers that perform
internal BSS selection (WPA_DRIVER_FLAGS_BSS_SELECTION) as a candidate
for initial association.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoStart using unodified Developer Certificate of Origin v1.1
Jouni Malinen [Thu, 13 Feb 2014 12:56:42 +0000 (14:56 +0200)]
Start using unodified Developer Certificate of Origin v1.1

With the license terms having been cleaned up in the hostap.git files,
there is no continued need for the additional (e) item to explicitly
acknowledge BSD license option for contributions. Since DCO v1.1 is now
available from http://developercertificate.org/ it looks reasonable to
move to the unmodified version of DCO and to the commonly used
Signed-off-by tag for this project.

Signed-hostap: Jouni Malinen <j@w1.fi>
Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoSync with wireless-testing.git include/uapi/linux/nl80211.h
Jouni Malinen [Thu, 13 Feb 2014 12:35:01 +0000 (14:35 +0200)]
Sync with wireless-testing.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2014-02-12.

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

10 years agoFix SAE state validation on AP
Jouni Malinen [Wed, 12 Feb 2014 15:46:33 +0000 (17:46 +0200)]
Fix SAE state validation on AP

Confirm-before-commit validation step allowed execution to continue on
error case. This could result in segfault in sae_check_confirm() if the
temporary SAE data was not available (as it would not be, e.g., in case
of an extra SAE confirm message being received after successful
exchange). Fix this by stopping SAE processing immediately after
detecting unexpected state for confirm message. In addition, make the
public sae.c functions verify sae->tmp before dereferencing it to make
this type of bugs less likely to result in critical issues.

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

10 years agoNFC: Add summary and success file options for nfcpy scripts
Jouni Malinen [Wed, 12 Feb 2014 10:48:26 +0000 (12:48 +0200)]
NFC: Add summary and success file options for nfcpy scripts

These can be used to get updates on NFC operation status and success for
external programs.

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

10 years agoP2P NFC: Add p2p-nfc.py --handover-only option
Jouni Malinen [Wed, 12 Feb 2014 10:45:07 +0000 (12:45 +0200)]
P2P NFC: Add p2p-nfc.py --handover-only option

p2p-nfc.py allowed an NFC Tag to be read and reported to wpa_supplicant
even in cases where it was explicitly asked to initiate negotiated
connection handover and return after completing this operation. The new
command line argument can be used to disable NFC Tag read operations
when a negotiated connection handover is expected.

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

10 years agoP2P NFC: Clean up p2p-nfc.py error handling
Jouni Malinen [Tue, 11 Feb 2014 17:33:43 +0000 (19:33 +0200)]
P2P NFC: Clean up p2p-nfc.py error handling

If wpa_supplicant reports a failure when trying to generate a handover
request, detect that before trying to decode the response as a hex
string.

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

10 years agoWPS: Make UUID-from-MAC Address easily available
Jouni Malinen [Wed, 18 Dec 2013 00:00:21 +0000 (16:00 -0800)]
WPS: Make UUID-from-MAC Address easily available

"hostapd -u<MAC Address>" can now be used to display the UUID that will
be generated based on a MAC Address (i.e., when hostapd configuration
does not set a specific UUID).

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

10 years agoP2P: Do not indicate P2P_FIND failure if p2p_scan is in progress
Jouni Malinen [Mon, 10 Feb 2014 12:36:39 +0000 (14:36 +0200)]
P2P: Do not indicate P2P_FIND failure if p2p_scan is in progress

It was possible to FAIL return for a P2P_FIND command that was issued
while an already started P2P_FIND operation was in the scan phase. This
can be confusing for upper layer software, so hide the failure report
from the ctrl_iface response. The previously started scan will continue
the find operation after this.

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

10 years agoWPS: Add more debug information to M7 AP Settings
Jouni Malinen [Thu, 16 Jan 2014 15:37:39 +0000 (17:37 +0200)]
WPS: Add more debug information to M7 AP Settings

This allows the AP Settings data to be included in debug log
(only with -K on command line).

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

10 years agoWPS: Indicate current AP settings in M7 in unconfigurated state
Jouni Malinen [Thu, 16 Jan 2014 15:35:45 +0000 (17:35 +0200)]
WPS: Indicate current AP settings in M7 in unconfigurated state

Previously, unconfigured state was forcing the best supported
authentication and encryption state to be shown in WPS messages,
including AP Settings in M7 in case the AP acts as an Enrollee. This is
not really correct for the AP Settings case, so change that one to
indicate the currently configured state.

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

10 years agoP2P: Handle unexpected GO Neg Req reject message more cleanly
Jouni Malinen [Fri, 7 Feb 2014 14:26:59 +0000 (16:26 +0200)]
P2P: Handle unexpected GO Neg Req reject message more cleanly

The mechanism of using Status attribute in GO Negotiation Request was
used in some early specification drafts, but it is not compliant with
the current P2P specification where GO Negotiation Request is used only
for the purpose of initiating a new GO Negotiation. However, some
deployed devices use it to indicate rejection of GO Negotiation in a
case where they have sent out GO Negotiation Response with status 1. The
P2P specification explicitly disallows this.

To avoid unnecessary interoperability issues and extra frames, mark the
pending negotiation as failed and do not reply to this GO Negotiation
Request frame. Previously, GO Negotiation Response frame with status=4
was sent back as an indication of the GO Negotiation Request frame being
invalid. This response is not sent anymore and the status code for the
P2P-GO-NEG-FAILURE event is changed from 4 (invalid parameters) to 11
(rejected by user) for this specific workaround case.

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

10 years agoFix persistent P2P connection failure in case channel list changes
Mahesh A Saptasagar [Mon, 27 Jan 2014 14:46:02 +0000 (20:16 +0530)]
Fix persistent P2P connection failure in case channel list changes

P2P persistent connection may fail due to 802.11d channel change event
invalidating support of the operating frequency sent in the invitation
request, before receiving the invitation response. If the operating
frequency is invalid at the time the invitation response is processed
and there is no forced frequency provided by user, allow frequency
re-selection.

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

10 years agowpa_supplicant: Add DFS indicator to get_capability freq
Dmitry Shmidt [Mon, 3 Feb 2014 21:30:46 +0000 (13:30 -0800)]
wpa_supplicant: Add DFS indicator to get_capability freq

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoHandle Wi-Fi Display commands more carefully if P2P is disabled
Jouni Malinen [Thu, 6 Feb 2014 14:03:42 +0000 (16:03 +0200)]
Handle Wi-Fi Display commands more carefully if P2P is disabled

If P2P was disabled (e.g., due to driver not supporting it or through
p2p_disabled=1 configuration), setting Wi-Fi Display parameters could
result in segmentation fault when the WFD IE is updated without the P2P
module being initialized. Fix this by skipping the update if P2P module
is not in use. In addition, show Wi-Fi Display as disabled in "GET
wifi_display" and refuse to enable it with "SET wifi_display 1" if P2P
is not enabled.

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

10 years agoFix Beacon RX before AP setup completion
Jouni Malinen [Thu, 6 Feb 2014 13:22:06 +0000 (15:22 +0200)]
Fix Beacon RX before AP setup completion

It is possible for the driver to report Beacon RX prior to hostapd
having completed AP mode setup, e.g., when changing country code. Beacon
frame processing for OLBC was not prepared for this and could trigger
segfault due to NULL pointer dereference. Fix this by ignoring the
Beacon frames received prior to completing interface setup when
determining OLBC updates.

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

10 years agonl80211: Fix regression in returning to AP mode after scan
Yun Park [Tue, 4 Feb 2014 21:11:14 +0000 (23:11 +0200)]
nl80211: Fix regression in returning to AP mode after scan

Commit b1f625e0d81b76bb2380d0b47b95f5ad61123ba5 extended
ap_scan_as_station to be able to distinguish between AP and P2P GO
iftypes. However, it did this in a way that completely lost the original
mode because drv->nlmode had already been replaced with the station
mode. Fix this by storing the correct old mode.

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

10 years agoP2P: Do not re-start invitation on Probe Req RX if already ack'ed
Jouni Malinen [Tue, 4 Feb 2014 15:16:32 +0000 (17:16 +0200)]
P2P: Do not re-start invitation on Probe Req RX if already ack'ed

If the peer device has already acknowledge receipt of the Invitation
Request frame, it is better not to re-start invitation by sending
another Invitation Request. This should not be needed since the peer
already has received the Invitation Request frame and sending the second
round in this type of sequence can cause issues with nl80211 offloaded
offchannel TX operations since driver_nl80211.c will lose the cookie
value for the first pending Action frame and may not be able to cancel
offchannel wait for it properly. this has been seen to trigger a failure
in the p2p_go_invite_auth test case with the scan failing due to GO
sending out Probe Response frame on incorrect channel (the channel used
in that not-cancelled Action TX).

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

10 years agoThe hostap.git master branch is now used for 2.2 development
Jouni Malinen [Tue, 4 Feb 2014 14:10:44 +0000 (16:10 +0200)]
The hostap.git master branch is now used for 2.2 development

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

10 years agoRemove dead code from AP setup
Jouni Malinen [Mon, 3 Feb 2014 19:11:46 +0000 (21:11 +0200)]
Remove dead code from AP setup

wpa_supplicant_create_ap() is only called for AP mode, so there is no
point in trying to address station (infra/IBSS) modes.

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

10 years agoWPS: Remove unused Credential AP Channel processing
Jouni Malinen [Mon, 3 Feb 2014 08:54:21 +0000 (10:54 +0200)]
WPS: Remove unused Credential AP Channel processing

Commit bd3a3737672aaf6eb50dba2b8caa3941c8df42e9 added a mechanism to use
AP Channel attribute from within a Credential attribute to optimize
scans. However, this design is not actually used with the WPS NFC use
cases. With configuration token, the AP Channel attribute is in the same
container with the Credential attribute (and that was also handled in
the previous implementation). With connection handover, AP Channel
information is outside the Credential attribute as well.

Simplify implementation by removing the AP Channel within Credential
case. This allows wpas_wps_use_cred() to get the AP Channel from the
container instead of having to find this during credential iteration.

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

10 years agoWPS: Remove unused 802.1X attribute parsing and processing
Jouni Malinen [Sun, 2 Feb 2014 21:41:47 +0000 (23:41 +0200)]
WPS: Remove unused 802.1X attribute parsing and processing

This is not really used in practice and there is no need to maintain
unsed code that would only print debug log entries.

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

10 years agoReplace ieee802_11_print_ssid() with wpa_ssid_txt()
Jouni Malinen [Fri, 31 Jan 2014 20:20:41 +0000 (22:20 +0200)]
Replace ieee802_11_print_ssid() with wpa_ssid_txt()

There is no need to maintain two different functions for printing out
ASCII text version of SSID.

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

10 years agoChange version information for the 2.1 release hostap_2_1
Jouni Malinen [Tue, 4 Feb 2014 11:12:50 +0000 (13:12 +0200)]
Change version information for the 2.1 release

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

10 years agoUpdate ChangeLog files to match current implementation
Jouni Malinen [Fri, 31 Jan 2014 18:46:51 +0000 (20:46 +0200)]
Update ChangeLog files to match current implementation

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

10 years agotests: Report unexpected STATUS lines instead of stopping
Jouni Malinen [Tue, 4 Feb 2014 11:22:10 +0000 (13:22 +0200)]
tests: Report unexpected STATUS lines instead of stopping

It looks like get_status() has failed in some test runs because of a
STATUS command returning an line without '=' on it. Instead of stopping
there on exception, report the unexpected line in the log and ignore it
to allow test to continue.

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

10 years agotests: wpa_supplicant ctrl_iface
Jouni Malinen [Mon, 3 Feb 2014 22:08:18 +0000 (00:08 +0200)]
tests: wpa_supplicant ctrl_iface

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

10 years agotests: AP mode operations with wpa_supplicant
Jouni Malinen [Mon, 3 Feb 2014 19:52:33 +0000 (21:52 +0200)]
tests: AP mode operations with wpa_supplicant

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

10 years agotests: Verify functionality with WPS 1.0 ER
Jouni Malinen [Mon, 3 Feb 2014 09:06:55 +0000 (11:06 +0200)]
tests: Verify functionality with WPS 1.0 ER

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

10 years agotests: Verify WPS AP does not activate PBC during overlap
Jouni Malinen [Sun, 2 Feb 2014 22:07:42 +0000 (00:07 +0200)]
tests: Verify WPS AP does not activate PBC during overlap

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

10 years agotests: Verify WPS ER behavior on selecting a single Enrollee
Jouni Malinen [Sun, 2 Feb 2014 22:01:39 +0000 (00:01 +0200)]
tests: Verify WPS ER behavior on selecting a single Enrollee

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

10 years agotests: WEP
Jouni Malinen [Fri, 31 Jan 2014 21:34:09 +0000 (23:34 +0200)]
tests: WEP

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

10 years agotests require_ht=1
Jouni Malinen [Fri, 31 Jan 2014 21:16:35 +0000 (23:16 +0200)]
tests require_ht=1

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

10 years agotests: ctrl_iface STA-FIRST and STA-NEXT iteration
Jouni Malinen [Fri, 31 Jan 2014 21:12:38 +0000 (23:12 +0200)]
tests: ctrl_iface STA-FIRST and STA-NEXT iteration

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

10 years agotests: NAI Home Realm Query
Jouni Malinen [Fri, 31 Jan 2014 21:00:07 +0000 (23:00 +0200)]
tests: NAI Home Realm Query

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

10 years agotests: OLBC AP detection
Jouni Malinen [Fri, 31 Jan 2014 20:45:08 +0000 (22:45 +0200)]
tests: OLBC AP detection

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

10 years agotests: Hidden SSID using zero octets as payload
Jouni Malinen [Fri, 31 Jan 2014 20:33:39 +0000 (22:33 +0200)]
tests: Hidden SSID using zero octets as payload

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

10 years agotests: HT40 OBSS scan and 20/40 MHz co-ex report
Jouni Malinen [Fri, 31 Jan 2014 20:13:23 +0000 (22:13 +0200)]
tests: HT40 OBSS scan and 20/40 MHz co-ex report

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

10 years agotests: Add test cases for various AP mode parameters
Jouni Malinen [Fri, 31 Jan 2014 14:59:41 +0000 (16:59 +0200)]
tests: Add test cases for various AP mode parameters

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

10 years agotests: Verify different ways of configuring passphrase/PSK
Jouni Malinen [Fri, 31 Jan 2014 14:39:50 +0000 (16:39 +0200)]
tests: Verify different ways of configuring passphrase/PSK

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

10 years agowpa_supplicant: Fix misplaced os_free
Prashanth Kumar [Mon, 3 Feb 2014 12:19:02 +0000 (17:49 +0530)]
wpa_supplicant: Fix misplaced os_free

os_free has wfd_dev_info_hex as an argument which is defined within
CONFIG_NO_STDOUT_DEBUG

Signed-hostap: Prashanth Kumar <prashanthkumar.kr@globaledgesoft.com>

10 years agoFix hostapd segfault on beacon hint event
Jouni Malinen [Mon, 3 Feb 2014 11:24:50 +0000 (13:24 +0200)]
Fix hostapd segfault on beacon hint event

Commit 795baf773f6d53bae3cfae4df6edda63e5022344 ('hostapd: Filter
channel list updated events after country code change') uses the
EVENT_CHANNEL_LIST_CHANGED data pointer, but it updated only one of the
callers to provide that data. NL80211_CMD_REG_BEACON_HINT event was
still sending the event without the initiator data and resulted in NULL
pointer dereference, e.g., if a scan was run while hostapd was running
and the driver was in world roaming state and enabled a channel for
active scans.

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

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>