]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
9 years agomesh: Fix PMKID to match the standard
Bob Copeland [Sun, 27 Dec 2015 02:20:51 +0000 (21:20 -0500)] 
mesh: Fix PMKID to match the standard

IEEE Std 802.11-2012 11.3.5.4 specifies the PMKID for SAE-derived keys
as:

   L((commit-scalar + peer-commit-scalar) mod r, 0, 128)

This is already calculated in the SAE code when the PMK is derived, but
not saved anywhere. Later, when generating the PMKID for plink action
frames, the definition for PMKID from 11.6.1.3 is incorrectly used.
Correct this by saving the PMKID when the key is generated and use it
subsequently.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agowpa_supplicant: Do not wait for monitor on P2P Device interface
Ilan Peer [Sun, 27 Dec 2015 14:25:07 +0000 (16:25 +0200)] 
wpa_supplicant: Do not wait for monitor on P2P Device interface

External programs are not aware of the creation of a
dedicated P2P Device interface, so it does not make sense
to wait for a monitor to connect on such an interface.

Fix this by not waiting on a dedicated P2P Device interface
for monitor to attach.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agoDo not wait for monitor to attach if no control interface
Ilan Peer [Sun, 27 Dec 2015 14:25:06 +0000 (16:25 +0200)] 
Do not wait for monitor to attach if no control interface

In case an interface has started without a control interface
initialized, skip waiting for monitor to attach at the start of
wpa_supplicant (-W).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agoClone default LIBS value to LIBS_* for other tools
Jouni Malinen [Mon, 28 Dec 2015 11:06:43 +0000 (13:06 +0200)] 
Clone default LIBS value to LIBS_* for other tools

If LIBS is set with some global build system defaults, clone those for
LIBS_c, LIBS_h, LIBS_n, and LIBS_p to cover wpa_cli, wpa_passphrase,
hostapd_cli, hlr_auc_gw, and nt_password_hash as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Make ap_wps_probe_req_ie_oom more robust
Jouni Malinen [Mon, 28 Dec 2015 10:52:59 +0000 (12:52 +0200)] 
tests: Make ap_wps_probe_req_ie_oom more robust

It was possible to hit a race condition between WPS_CANCEL and
immediately following WPS_PIN command. Wait for a disconnection event to
avoid that. This was seen with the following test case sequence:
ap_wpa2_psk_supp_proto_wrong_group_key_len ap_wps_probe_req_ie_oom

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: wpa_supplicant AP mode with ACS
Jouni Malinen [Thu, 24 Dec 2015 20:12:32 +0000 (22:12 +0200)] 
tests: wpa_supplicant AP mode with ACS

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd "GET_CAPABILITY acs" to allow ACS build option to be detected
Jouni Malinen [Thu, 24 Dec 2015 20:11:50 +0000 (22:11 +0200)] 
Add "GET_CAPABILITY acs" to allow ACS build option to be detected

This allows upper layer software to check whether wpa_supplicant can use
ACS for AP mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agowpa_supplicant: Enable Automatic Channel Selection support for AP mode
Tomasz Bursztyka [Fri, 27 Nov 2015 11:40:37 +0000 (12:40 +0100)] 
wpa_supplicant: Enable Automatic Channel Selection support for AP mode

Since hostapd supports ACS now, let's enable its support in
wpa_supplicant as well when starting AP mode.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
[u.oelmann@pengutronix.de: rebased series from hostap_2_1~944 to master]
[u.oelmann@pengutronix.de: adjusted added text in defconfig]
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
9 years agoHandle survey event properly in wpa_supplicant
Tomasz Bursztyka [Fri, 27 Nov 2015 11:40:36 +0000 (12:40 +0100)] 
Handle survey event properly in wpa_supplicant

Let's reuse hostapd code for such handling. This will be useful to get
ACS support into wpa_supplicant where this one needs to handle the
survey event so it fills in the result ACS subsystem will require.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
[u.oelmann@pengutronix.de: rebased series from hostap_2_1~944 to master]
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
9 years agotests: vm: Output everything on console
Johannes Berg [Fri, 27 Nov 2015 13:12:14 +0000 (14:12 +0100)] 
tests: vm: Output everything on console

When running tests, make printk put all messages, including debug
messages, onto the serial console to go into the console file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoEAP-TNC peer: Remove dead code related to fragmentation
Jouni Malinen [Thu, 24 Dec 2015 17:09:21 +0000 (19:09 +0200)] 
EAP-TNC peer: Remove dead code related to fragmentation

The data->state == WAIT_FRAG_ACK case is already handling all cases
where data->out_buf could be non-NULL, so this additional check after
the WAIT_FRAG_ACK steps cannot be reached. Remove the duplicated dead
code.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2PS: Remove dead code
Jouni Malinen [Thu, 24 Dec 2015 17:00:59 +0000 (19:00 +0200)] 
P2PS: Remove dead code

Commit f8a80e39b33212992f88ce2e638193f81664230a ('P2PS: Change
connection capability handling') added the identical P2PS_SETUP_CLIENT
check into two places within p2ps_group_capability(). However, only the
first one of these can be reached. In the second case, role can only
have values 0 or P2PS_SETUP_NEW and as such, the P2PS_SETUP_CLIENT case
is not possible. It looks like the first part of the commit is
sufficient, so remove the dead code added by the second part.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-TNC protocol tests
Jouni Malinen [Thu, 24 Dec 2015 12:28:00 +0000 (14:28 +0200)] 
tests: EAP-TNC protocol tests

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoTNC: Print received IF-TNCCS message as debug ASCII hexdump
Jouni Malinen [Thu, 24 Dec 2015 16:32:36 +0000 (18:32 +0200)] 
TNC: Print received IF-TNCCS message as debug ASCII hexdump

This makes it easier to see what TNCC is processing.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-TNC peer: Allow fragment_size to be configured
Jouni Malinen [Thu, 24 Dec 2015 12:19:23 +0000 (14:19 +0200)] 
EAP-TNC peer: Allow fragment_size to be configured

Previously, a fixed 1300 fragment_size was hardcoded. Now the EAP
profile parameter fragment_size can be used to override this.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Move P2P-REMOVE-AND-REFORM-GROUP cases more robust
Jouni Malinen [Thu, 24 Dec 2015 11:40:54 +0000 (13:40 +0200)] 
tests: Move P2P-REMOVE-AND-REFORM-GROUP cases more robust

Wait for the AP-DISABLED and AP-ENABLED group events before reading the
current group operation frequency after P2P-REMOVE-AND-REFORM-GROUP.
This reduces a possibility of a race condition making a test case fail
with the returned frequency being 0 when reading this before the
reformed group is fully up. This may help avoid false error reports for
the following test cases: p2p_go_move_reg_change p2p_go_move_scm
p2p_go_move_scm_peer_supports p2p_go_move_scm_multi.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRADIUS: Add EACCES to list of recognized send() errno values
Jouni Malinen [Thu, 24 Dec 2015 10:43:05 +0000 (12:43 +0200)] 
RADIUS: Add EACCES to list of recognized send() errno values

This allows RADIUS failover to be performed if send() return EACCES
error which is what happens after a recent Linux kernel commit
0315e382704817b279e5693dca8ab9d89aa20b3f ('net: Fix behaviour of
unreachable, blackhole and prohibit') for a local sender when route type
is prohibit.

This fixes the hwsim test case radius_failover when running against a
kernel build that includes that commit.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RADIUS Accounting and non-ASCII SSID
Jouni Malinen [Thu, 24 Dec 2015 10:19:41 +0000 (12:19 +0200)] 
tests: RADIUS Accounting and non-ASCII SSID

This shows an example of Called-Station-Id in Access-Request and
Accounting-Request with non-ASCII characters.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoFix RADIUS Called-Station-Id to not escape SSID
Jouni Malinen [Thu, 24 Dec 2015 10:15:36 +0000 (12:15 +0200)] 
Fix RADIUS Called-Station-Id to not escape SSID

Commit 986de33d5c3e11dd08a26ed65eacede8b75aa339 ('Convert remaining SSID
routines from char* to u8*') started using wpa_ssid_txt() to print out
the SSID for the Called-Station-Id attribute in RADIUS messages. This
was further modified by commit 6bc1f95613cc2bedd8849564d30419bff82ed074
('Use printf escaping in SSID-to-printable-string conversion') to use
printf escaping (though, even without this, wpa_ssid_txt() would have
masked characters).

This is not desired for Called-Station-Id attribute. While it is defined
as a "String", RFC 2865 indicates that "a robust implementation SHOULD
support the field as undistinguished octets.".

Copy the SSID as an array of arbitrary octets into Called-Station-Id to
avoid any kind of masking or escaping behavior. This goes a step further
from the initial implementation by allowing even the possible (but
unlikely in practical use cases) 0x00 octet in the middle of an SSID.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-TLS with intermediate CAs and OCSP multi
Jouni Malinen [Wed, 23 Dec 2015 22:42:40 +0000 (00:42 +0200)] 
tests: EAP-TLS with intermediate CAs and OCSP multi

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoTLS client: Multi-OCSP check to cover intermediate CAs
Jouni Malinen [Tue, 22 Dec 2015 22:00:13 +0000 (00:00 +0200)] 
TLS client: Multi-OCSP check to cover intermediate CAs

This extends multi-OCSP support to verify status for intermediate CAs in
the server certificate chain.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAdd ocsp=3 configuration parameter for multi-OCSP
Jouni Malinen [Tue, 22 Dec 2015 22:28:13 +0000 (00:28 +0200)] 
Add ocsp=3 configuration parameter for multi-OCSP

ocsp=3 extends ocsp=2 by require all not-trusted certificates in the
server certificate chain to receive a good OCSP status. This requires
support for ocsp_multi (RFC 6961). This commit is only adding the
configuration value, but all the currently included TLS library wrappers
are rejecting this as unsupported for now.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoTLS: Move variable declaration to the beginning of the block
Jouni Malinen [Tue, 22 Dec 2015 22:01:25 +0000 (00:01 +0200)] 
TLS: Move variable declaration to the beginning of the block

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Minimal testing of OCSP stapling with ocsp_multi
Jouni Malinen [Tue, 22 Dec 2015 17:33:18 +0000 (19:33 +0200)] 
tests: Minimal testing of OCSP stapling with ocsp_multi

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoTLS client: OCSP stapling with ocsp_multi option (RFC 6961)
Jouni Malinen [Tue, 22 Dec 2015 17:39:37 +0000 (19:39 +0200)] 
TLS client: OCSP stapling with ocsp_multi option (RFC 6961)

This adds a minimal support for using status_request_v2 extension and
ocsp_multi format (OCSPResponseList instead of OCSPResponse) for
CertificateStatus. This commit does not yet extend use of OCSP stapling
to validate the intermediate CA certificates.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoTLS server: OCSP stapling with ocsp_multi option (RFC 6961)
Jouni Malinen [Tue, 22 Dec 2015 17:37:12 +0000 (19:37 +0200)] 
TLS server: OCSP stapling with ocsp_multi option (RFC 6961)

This allows hostapd with the internal TLS server implementation to
support the extended OCSP stapling mechanism with multiple responses
(ocsp_stapling_response_multi).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoServer configuration for OCSP stapling with ocsp_multi (RFC 6961)
Jouni Malinen [Tue, 22 Dec 2015 17:34:36 +0000 (19:34 +0200)] 
Server configuration for OCSP stapling with ocsp_multi (RFC 6961)

This adds a new hostapd configuration parameter
ocsp_stapling_response_multi that can be used similarly to the existing
ocsp_stapling_response, but for the purpose of providing multiple cached
OCSP responses. This commit adds only the configuration parameter, but
does not yet add support for this mechanism with any of the supported
TLS implementations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoTLS server: OCSP stapling
Jouni Malinen [Tue, 22 Dec 2015 15:53:45 +0000 (17:53 +0200)] 
TLS server: OCSP stapling

This adds support for hostapd-as-authentication-server to be build with
the internal TLS implementation and OCSP stapling server side support.
This is more or less identical to the design used with OpenSSL, i.e.,
the cached response is read from the ocsp_stapling_response=<file> and
sent as a response if the client requests it during the TLS handshake.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Add dh_file parameter for integrated EAP server
Jouni Malinen [Tue, 22 Dec 2015 15:51:54 +0000 (17:51 +0200)] 
tests: Add dh_file parameter for integrated EAP server

This is needed for number of EAP test cases at least when using the
internal TLS server implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoGnuTLS: OCSP stapling on the server side
Jouni Malinen [Tue, 22 Dec 2015 14:47:29 +0000 (16:47 +0200)] 
GnuTLS: OCSP stapling on the server side

This adds support for hostapd-as-authentication-server to be build
against GnuTLS with OCSP stapling server side support. This is more or
less identical to the design used with OpenSSL, i.e., the cached
response is read from the ocsp_stapling_response=<file> and sent as a
response if the client requests it during the TLS handshake.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoUse wpa_msg() for the "RSN: PMKID mismatch" message
Jouni Malinen [Tue, 22 Dec 2015 09:22:19 +0000 (11:22 +0200)] 
Use wpa_msg() for the "RSN: PMKID mismatch" message

This message is sent at MSG_INFO level and it is supposed to go out even
even debug messages were to be removed from the build. As such, use
wpa_msg() instead of wpa_dbg() for it.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoEAP-EKE: Merge identical error return paths
Jouni Malinen [Mon, 21 Dec 2015 22:02:02 +0000 (00:02 +0200)] 
EAP-EKE: Merge identical error return paths

There is no need to maintain multiple copies of the same error return
path.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-EKE: Reject too long Prot() data when building a frame
Jouni Malinen [Mon, 21 Dec 2015 22:03:44 +0000 (00:03 +0200)] 
EAP-EKE: Reject too long Prot() data when building a frame

This error case in own buffer lengths being too short was not handled
properly. While this should not really happen since the wpabuf
allocation is made large for the fixed cases that are currently
supported, better make eap_eke_prot() safer if this functionally ever
gets extended with a longer buffer need.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: WPA2-Enterprise connection using EAP-EKE (many connections)
Jouni Malinen [Mon, 21 Dec 2015 21:57:16 +0000 (23:57 +0200)] 
tests: WPA2-Enterprise connection using EAP-EKE (many connections)

This tries to make it more likely to hit the special case of pub_len <
prime_len for additional code coverage.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP protocol tests with expanded header
Jouni Malinen [Mon, 21 Dec 2015 21:31:15 +0000 (23:31 +0200)] 
tests: EAP protocol tests with expanded header

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoDocument previously missing key_mgmt values
Jouni Malinen [Mon, 21 Dec 2015 15:45:57 +0000 (17:45 +0200)] 
Document previously missing key_mgmt values

Number of key_mgmt options were missing from the documentation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Add AP Location Public Identifier into gas_anqp_extra_elements
Jouni Malinen [Mon, 21 Dec 2015 09:55:30 +0000 (11:55 +0200)] 
tests: Add AP Location Public Identifier into gas_anqp_extra_elements

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: GAS fragmentation and comeback delay
Jouni Malinen [Sun, 20 Dec 2015 18:02:56 +0000 (20:02 +0200)] 
tests: GAS fragmentation and comeback delay

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoGAS: Do not cancel initial offchannel wait with comeback delay 1
Jouni Malinen [Sun, 20 Dec 2015 17:58:05 +0000 (19:58 +0200)] 
GAS: Do not cancel initial offchannel wait with comeback delay 1

The minimum comeback delay 1 is used to indicate that fragmentation is
needed instead of indicating that the response is going to be available
only after some time. Do not cancel offchannel wait for this case
between the initial and comeback exchanges to avoid delaying the full
operation unnecessarily.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: GAS fragmentation with mac80211_hwsim MCC enabled
Jouni Malinen [Sun, 20 Dec 2015 16:13:17 +0000 (18:13 +0200)] 
tests: GAS fragmentation with mac80211_hwsim MCC enabled

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Update gas_anqp_oom_hapd to match new implementation
Jouni Malinen [Sun, 20 Dec 2015 18:56:34 +0000 (20:56 +0200)] 
tests: Update gas_anqp_oom_hapd to match new implementation

Since wpa_supplicant is now retrying GAS comeback failures once, the
gas_anqp_oom_hapd test case started failing. Fix this by updating the
test case to expect success (on the retry).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoGAS: Retry full GAS query if comeback response is not received
Jouni Malinen [Sun, 20 Dec 2015 17:26:01 +0000 (19:26 +0200)] 
GAS: Retry full GAS query if comeback response is not received

It is possible for a comeback response to get lost especially when going
through a large GAS exchange fragmented to multiple frames in an
environment with interference or other traffic. Make this less likely to
fail the full exchange by trying full GAS query again and using longer
wait time on the GAS comeback exchanges.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Modify gas_malformed_comeback_resp to allow GAS retries
Jouni Malinen [Sun, 20 Dec 2015 19:06:21 +0000 (21:06 +0200)] 
tests: Modify gas_malformed_comeback_resp to allow GAS retries

This is in preparation of a wpa_supplicant change to allow GAS retries
which can result in the previous test case design showing failures due
to "unexpected" management frames (GAS Initial Request from the retry).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoGAS server: Replenish temporary STA entry timeout on comeback request
Jouni Malinen [Sun, 20 Dec 2015 17:23:58 +0000 (19:23 +0200)] 
GAS server: Replenish temporary STA entry timeout on comeback request

Previously, the five second timeout was added at the beginning of the
full GAS query and it was not replenished during fragmented exchanges.
This could result in timing out a query if it takes significant time to
go through the possibly multiple fragments and long comeback delay.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoGAS: Shorten the duration of the wait for GAS comeback response
Matti Gottlieb [Thu, 10 Dec 2015 10:56:09 +0000 (12:56 +0200)] 
GAS: Shorten the duration of the wait for GAS comeback response

When exchanging GAS frames with the AP, the initial response from the AP
may take a while to come, since the AP may need to fetch the info from a
server. The next fragments/comeback response frames should take much
less time since the AP already has all of the info, so the wait time
for these frames can be reduced.

In addition, some drivers, e.g., mac80211, try to combine ROC based flows,
to improve medium utilization. For example, if the requested ROC fits
entirely in a previous requested ROC they can be combined. Thus, reducing
the wait time for the next frames can improve medium utilization.

Shorten the duration of GAS comeback to improve medium utilization and
overall GAS exchange times.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
9 years agoGAS: Clear offchannel_tx_started when ending remain-on-channel
Jouni Malinen [Sun, 20 Dec 2015 17:37:06 +0000 (19:37 +0200)] 
GAS: Clear offchannel_tx_started when ending remain-on-channel

Commit 2c0d0ae370f72fbe6248feed7ea0635303e3dc5a ('GAS: End
remain-on-channel due to delayed GAS comeback request') started ending
the remain-on-channel operation between the initial request and the
following comeback request. However, it did not check or update the
offchannel_tx_started variable. While this alone would not necessarily
be problematic, this makes it more difficult to optimize wait time for
offchannel TX operations, so make sure the internal tracking variable
gets updated.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-PEAP phase1 TLS flags
Jouni Malinen [Sun, 20 Dec 2015 15:36:51 +0000 (17:36 +0200)] 
tests: EAP-PEAP phase1 TLS flags

This adds some more test coverage for phase1 parameters that had not
previously been included in any of the test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-TTLS with unsupported Phase 2 EAP method in configuration
Jouni Malinen [Sun, 20 Dec 2015 15:33:03 +0000 (17:33 +0200)] 
tests: EAP-TTLS with unsupported Phase 2 EAP method in configuration

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-TTLS/PEAP/FAST: Reject unsupported Phase 2 method in configuration
Jouni Malinen [Sun, 20 Dec 2015 15:32:10 +0000 (17:32 +0200)] 
EAP-TTLS/PEAP/FAST: Reject unsupported Phase 2 method in configuration

Instead of using default list of methods, reject a configuration with an
unsupported EAP method at the time the main TLS method is being
initialized.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-TLS: Merge common error paths
Jouni Malinen [Sun, 20 Dec 2015 15:25:04 +0000 (17:25 +0200)] 
EAP-TLS: Merge common error paths

There is no need to keep these identical error paths separate.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-TLS and TLS Message Length in unfragmented packets
Jouni Malinen [Sun, 20 Dec 2015 15:12:15 +0000 (17:12 +0200)] 
tests: EAP-TLS and TLS Message Length in unfragmented packets

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-TLS and config blob missing
Jouni Malinen [Sun, 20 Dec 2015 15:07:25 +0000 (17:07 +0200)] 
tests: EAP-TLS and config blob missing

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Speed up TNC test cases with the use of a single channel scan
Jouni Malinen [Sun, 20 Dec 2015 14:58:33 +0000 (16:58 +0200)] 
tests: Speed up TNC test cases with the use of a single channel scan

There is no need for these test cases to run a full scan.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: TNC PEAP-SoH local error cases
Jouni Malinen [Sun, 20 Dec 2015 14:56:42 +0000 (16:56 +0200)] 
tests: TNC PEAP-SoH local error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-PEAP peer: Fix a memory leak on an error path
Jouni Malinen [Sun, 20 Dec 2015 14:55:28 +0000 (16:55 +0200)] 
EAP-PEAP peer: Fix a memory leak on an error path

If memory allocation for adding SoH response fails, the SoH response was
not freed properly on the error path.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: TNC TTLS local error cases
Jouni Malinen [Sun, 20 Dec 2015 11:43:41 +0000 (13:43 +0200)] 
tests: TNC TTLS local error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoDrop any pending EAPOL RX frame when starting a new connection
Jouni Malinen [Sun, 20 Dec 2015 11:40:59 +0000 (13:40 +0200)] 
Drop any pending EAPOL RX frame when starting a new connection

Such a pending frame cannot be valid anymore, so drop it instead of
risking of using an unexpected EAPOL frame after association if a
previous association received one at the end and the new association can
happen within 100 ms.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Fix scan result clearing in ssid_hidden*
Jouni Malinen [Sun, 20 Dec 2015 10:59:19 +0000 (12:59 +0200)] 
tests: Fix scan result clearing in ssid_hidden*

These test cases were supposed to clear the cfg80211 and wpa_supplicant
scan caches in the end to avoid causing issues to the following test
cases. This did not work properly after introduction of the support for
aborting a pending scan. Fix this by using the flush_scan_cache()
function and waiting within the test case until the final scan operation
completes.

This issue was triggered by ssid_hidden/ssid_hidden2 followed by
ext_password_interworking (though, not every time).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-TTLS/MSCHAP with password hash
Jouni Malinen [Sun, 20 Dec 2015 10:46:45 +0000 (12:46 +0200)] 
tests: EAP-TTLS/MSCHAP with password hash

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-TTLS local error cases
Jouni Malinen [Sun, 20 Dec 2015 09:55:18 +0000 (11:55 +0200)] 
tests: EAP-TTLS local error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoWPA: Explicitly clear the buffer used for decrypting Key Data
Jouni Malinen [Sun, 20 Dec 2015 08:52:30 +0000 (10:52 +0200)] 
WPA: Explicitly clear the buffer used for decrypting Key Data

When AES-WRAP was used to protect the EAPOL-Key Key Data field, this was
decrypted using a temporary heap buffer with aes_unwrap(). That buffer
was not explicitly cleared, so it was possible for the group keys to
remain in memory unnecessarily until the allocated area was reused.
Clean this up by clearing the temporary allocation explicitly before
freeing it.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-PEAP local error cases
Jouni Malinen [Sat, 19 Dec 2015 19:04:39 +0000 (21:04 +0200)] 
tests: EAP-PEAP local error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-PEAP version forcing
Jouni Malinen [Sat, 19 Dec 2015 18:59:14 +0000 (20:59 +0200)] 
tests: EAP-PEAP version forcing

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-PEAP peer: Check SHA1 result when deriving Compond_MAC
Jouni Malinen [Sat, 19 Dec 2015 18:34:27 +0000 (20:34 +0200)] 
EAP-PEAP peer: Check SHA1 result when deriving Compond_MAC

This handles a mostly theoretical case where hmac_sha1_vector() might
fail for some reason.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-PEAP session resumption with crypto binding
Jouni Malinen [Sat, 19 Dec 2015 18:23:51 +0000 (20:23 +0200)] 
tests: EAP-PEAP session resumption with crypto binding

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-PEAP server: Add support for fast-connect crypto binding
Jouni Malinen [Sat, 19 Dec 2015 18:22:43 +0000 (20:22 +0200)] 
EAP-PEAP server: Add support for fast-connect crypto binding

IPMK and CMK are derived from TK when using TLS session resumption with
PEAPv0 crypto binding. The EAP-PEAP peer implementation already
supported this, but the server side did not.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-PEAP with peap_outer_success=0
Jouni Malinen [Sat, 19 Dec 2015 18:05:50 +0000 (20:05 +0200)] 
tests: EAP-PEAP with peap_outer_success=0

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-PEAP peer: Remove unused return value and error path
Jouni Malinen [Sat, 19 Dec 2015 17:54:56 +0000 (19:54 +0200)] 
EAP-PEAP peer: Remove unused return value and error path

eap_peap_parse_phase1() returned 0 unconditionally, so there was no need
for that return value or the code path that tried to address the error
case.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoHS 2.0: Remove duplicate icon entries
Jouni Malinen [Sat, 19 Dec 2015 16:53:27 +0000 (18:53 +0200)] 
HS 2.0: Remove duplicate icon entries

Only one of the icon entries with a matching BSSID and file name can be
fetched from wpa_supplicant and as such, there is no need to maintain
the old data if it was not explicitly deleted before running a new fetch
for the same BSSID and icon. Remove older duplicated entries whenever
completing a pending icon fetch to optimize memory use.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoHS 2.0: Convert icon storage to use dl_list
Jouni Malinen [Sat, 19 Dec 2015 16:49:32 +0000 (18:49 +0200)] 
HS 2.0: Convert icon storage to use dl_list

This simplifies the list operations quite a bit.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: REQ_HS20_ICON and DEL_HS20_ICON
Jouni Malinen [Fri, 18 Dec 2015 15:46:51 +0000 (17:46 +0200)] 
tests: REQ_HS20_ICON and DEL_HS20_ICON

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoHS 2.0: Add a command to retrieve icon with in-memory storage
Jan Nordqvist [Fri, 11 Dec 2015 01:01:46 +0000 (17:01 -0800)] 
HS 2.0: Add a command to retrieve icon with in-memory storage

This adds a new command based Hotspot 2.0 icon retrieval option.

In short, here is the new command sequence:
1. REQ_HS20_ICON <bssid> <file-name>
2. event: RX-HS20-ICON <bssid> <file-name> <size>
3. GET_HS20_ICON <bssid> <file-name> <offset> <size>
   (if needed, repeat with larger offset values until full icon is
   fetched)
5. DEL_HS20_ICON <bssid> <file-name>

REQ_HS20_ICON is a new command that is analogous to HS20_ICON_REQUEST
with the slight difference that an entry to store the icon in memory is
prepared. The RX-HS20-ICON event has been augmented with BSSID,
file-name and size, and GET_HS20_ICON is used to retrieve a chunk of up
to <size> bytes of icon data at offset <offset>. Each chunk is returned
as a base64 encoded fragment, preceded by "HS20-ICON-DATA", BSSID, and
file-name as well as the starting offset of the data.

If there is no entry prepared for the icon when the ANQP result comes
back, hs20_process_icon_binary_file falls back to legacy behavior.

Finally the DEL_HS20_ICON command deletes (all) icons associated with
BSSID and file-name (there could be several if retries are used and they
have different dialog tokens).

Signed-off-by: Jan Nordqvist <jannq@google.com>
9 years agotests: Add rfkill tests for P2P Device operations
Ilan Peer [Thu, 17 Dec 2015 13:54:12 +0000 (15:54 +0200)] 
tests: Add rfkill tests for P2P Device operations

Add a couple of tests for rfkill with P2P Device operations
(with and without P2P Device interface).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agorfkill: Match only the correct expected wiphy rfkill
Johannes Berg [Thu, 17 Dec 2015 13:54:11 +0000 (15:54 +0200)] 
rfkill: Match only the correct expected wiphy rfkill

On systems that have multiple WLAN rfkill instances, the rfkill code
can become confused into thinking that the device was unblocked when
in fact it wasn't, because it only matches on the WLAN type.

Since it then stores the new (unblocked) state from the wrong rfkill
instance, it will never retry the failing IFF_UP operation and the
user has to toggle rfkill again, or otherwise intervene manually, in
this case to get back to operational state.

Fix this by using the existing (but unused) ifname argument when the
rfkill instance is created to match to a specific rfkill index only.

As a P2P Device interface does not have a netdev interface associated
with it, use the name of a sibling interface to initialize the rfkill
context for the P2P Device interface. For nl80211, as the wiphy index
is known only after getting the driver capabilities from the kernel,
move the initialization of the rfkill object to
wpa_driver_nl80211_finish_drv_init().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agonl80211: Handle rfkill for P2P Device interface
Ilan Peer [Thu, 17 Dec 2015 13:54:10 +0000 (15:54 +0200)] 
nl80211: Handle rfkill for P2P Device interface

The rfkill processing in nl80211 driver assumes that the
INTERFACE_ENABLED/DISABLED will be also issued, so does not do much in
the rfkill callbacks. However, as a P2P Device interface is not
associated with a network interface, these events are not issued for it.

Handle rfkill events for the P2P_DEVICE interface by faking the
INTERFACE_ENABLED/DISABLED.

Signed-off-by: Moshe Benji <Moshe.Benji@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agotests: Prepare ap_open_out_of_memory for modified rfkill init path
Jouni Malinen [Fri, 18 Dec 2015 20:22:25 +0000 (22:22 +0200)] 
tests: Prepare ap_open_out_of_memory for modified rfkill init path

The rfkill initialization will be moved out from
wpa_driver_nl80211_drv_init() which would break one step in this OOM
test case due to the memory allocation not existing anymore. Fix this by
skipping that OOM step to avoid causing false failures with the
following commits.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: wpa_supplicant SIGNAL_MONITOR command
Jouni Malinen [Fri, 18 Dec 2015 19:01:42 +0000 (21:01 +0200)] 
tests: wpa_supplicant SIGNAL_MONITOR command

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agowpa_supplicant: Add SIGNAL_MONITOR command
Dmitry Shmidt [Wed, 16 Dec 2015 22:18:18 +0000 (14:18 -0800)] 
wpa_supplicant: Add SIGNAL_MONITOR command

SIGNAL_MONITOR THRESHOLD=DD HYSTERESIS=DD command will request signal
strength monitoring events based on there having been requested amount
of drop in the signal strength. The threshold value is the RSSI
threshold in dBm for the event to be sent. 0 threshold can be used to
disable monitoring. The hysteresis value is RSSI hysteresis in dB to
specify the minimum amount of change before a consecutive event is
reported.

With nl80211 driver interface, these values map to the
NL80211_CMD_SET_CQM command with NL80211_ATTR_CQM_RSSI_THOLD and
NL80211_ATTR_CQM_RSSI_HYST attributes to the driver.

This command cannot be used when bgscan module is in use since that
depends on being able to control the connection monitoring parameters.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
9 years agoGAS: End remain-on-channel due to delayed GAS comeback request
Matti Gottlieb [Thu, 10 Dec 2015 10:56:08 +0000 (12:56 +0200)] 
GAS: End remain-on-channel due to delayed GAS comeback request

During the sequence of exchanging GAS frames with the AP, the AP can
request to come back in X amount of time and resend the GAS request.

Previously, wpa_supplicant did not terminate the remain-on-channel
session, but rather waited until the requested comeback delay had
expired, and then tried to send the GAS frame (potentially to save the
time that is required to schedule a new remain on channel flow).

This might cause unnecessary idle time (can be close to 1000 ms) in
which the device might be off-channel. Ending the current
remain-on-channel session and then rescheduling makes better usage of
the time in this case.

End remain-on-channel session due to receiving a delayed GAS comeback
request from the AP.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
9 years agoTDLS: Ignore incoming TDLS Setup Response retries
Arik Nemtsov [Thu, 10 Dec 2015 10:56:07 +0000 (12:56 +0200)] 
TDLS: Ignore incoming TDLS Setup Response retries

The Setup Response timer is relatively fast (500 ms) and there are
instances where it fires on the responder side after the initiator has
already sent out the TDLS Setup Confirm frame. Prevent the processing of
this stale TDLS Setup Response frame on the initiator side.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
9 years agohlr_auc_gw: Simplify string parsers with str_token()
Jouni Malinen [Fri, 18 Dec 2015 18:13:39 +0000 (20:13 +0200)] 
hlr_auc_gw: Simplify string parsers with str_token()

The helper function allows these string parsers to be made much simpler.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agohlr_auc_gw: Fix a typo in an error message
Jouni Malinen [Fri, 18 Dec 2015 17:56:21 +0000 (19:56 +0200)] 
hlr_auc_gw: Fix a typo in an error message

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agohlr_auc_gw: Remove unnecessary assignment
Jouni Malinen [Fri, 18 Dec 2015 17:55:01 +0000 (19:55 +0200)] 
hlr_auc_gw: Remove unnecessary assignment

The pos variable is not used after the final parsed item, so no need to
set it here.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Detect invitation GO issues more quickly
Jouni Malinen [Fri, 18 Dec 2015 14:14:55 +0000 (16:14 +0200)] 
tests: Detect invitation GO issues more quickly

This speeds up and clarifies error reporting for cases where the GO
fails to start in invitation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agowpa_cli: Send ALL_STA command to the correct interface
Eliad Peller [Thu, 10 Dec 2015 10:56:06 +0000 (12:56 +0200)] 
wpa_cli: Send ALL_STA command to the correct interface

wpa_ctrl_command_sta(), called by the "ALL_STA" handler, didn't consider
ifname_prefix, resulting in various commands being sent to the global
control interface, rather than the specified interface when IFNAME=
prefix was used.

This in turn caused the unexpected "UNKNOWN COMMAND" result be
considered as valid station, resulting in infinite loop while trying to
get all stations.

Fix it by considering ifname_prefix, similarly to _wpa_ctrl_command().

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
9 years agoDisconnect before trying to switch to a different network
Ayala Beker [Thu, 10 Dec 2015 10:56:05 +0000 (12:56 +0200)] 
Disconnect before trying to switch to a different network

Previously, when wpa_supplicant received bgscan results with a preferred
network, it connected to that network without disconnecting from the
previous one. This might result in an inconsistent state of upper
layers.

Fix this by disconnecting from the current AP before connecting to the
new one when the network profile changes and there is an existing
connection.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
9 years agoAvoid network selection from scan during connection
Arik Nemtsov [Thu, 10 Dec 2015 10:56:04 +0000 (12:56 +0200)] 
Avoid network selection from scan during connection

If scan results arrive during the connection process, the network
selection function was called, interrupting the current connection.
While a regular scan is mutually exclusive with connection establishment
via the nature of radio work, there's no such protection for scheduled
scan. Prevent network selection while a connection is in progress.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
9 years agoutils: Fix NULL pointer dereference with unexpected kernel behavior
Ayala Beker [Thu, 10 Dec 2015 10:56:03 +0000 (12:56 +0200)] 
utils: Fix NULL pointer dereference with unexpected kernel behavior

Fix mostly theoretical NULL pointer dereference in
wpa_debug_open_linux_tracing() if /proc/mounts were to return a
malformed line.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
9 years agoP2P: Fix possible NULL pointer dereference
Ayala Beker [Thu, 10 Dec 2015 10:56:02 +0000 (12:56 +0200)] 
P2P: Fix possible NULL pointer dereference

Fix wpas_p2p_invite() to call p2p_set_own_pref_freq_list() after the
NULL check, to avoid NULL pointer dereference if P2P initialization were
to have failed or P2P module getting deinitialized.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
9 years agotests: vm: Honor EPATH in uevent.sh
Johannes Berg [Fri, 11 Dec 2015 16:44:23 +0000 (17:44 +0100)] 
tests: vm: Honor EPATH in uevent.sh

This is useful for testing CRDA since it means you can use EPATH to
redirect the test scripts to a different crda binary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agotests: EAP-TTLS with invalid phase2 parameter values
Jouni Malinen [Thu, 17 Dec 2015 22:05:07 +0000 (00:05 +0200)] 
tests: EAP-TTLS with invalid phase2 parameter values

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-TTLS peer: Fix parsing auth= and autheap= phase2 params
Pali Rohár [Sun, 6 Dec 2015 11:01:32 +0000 (12:01 +0100)] 
EAP-TTLS peer: Fix parsing auth= and autheap= phase2 params

This patch fixes an issue with an invalid phase2 parameter value
auth=MSCHAPv2 getting interpreted as auth=MSCHAP (v1) which could
degrade security (though, only within a protected TLS tunnel). Now when
invalid or unsupported auth= phase2 parameter combinations are
specified, EAP-TTLS initialization throws an error instead of silently
doing something.

More then one auth= phase2 type cannot be specified and also both auth= and
autheap= options cannot be specified.

Parsing phase2 type is case sensitive (as in other EAP parts), so phase2
parameter auth=MSCHAPv2 is invalid. Only auth=MSCHAPV2 is correct.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
[Use cstr_token() to get rid of unnecessary allocation; cleanup]
Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoatheros: Unify memory processing functions
Matt Woods [Sat, 12 Dec 2015 10:25:42 +0000 (10:25 +0000)] 
atheros: Unify memory processing functions

There are two types of memory processing functions in the file
atheros_driver.c, such as memory and os_memory. Unify the processing
functions into one type which has the prefix "os_".

Signed-off-by: Matt Woods <matt.woods@aliyun.com>
9 years agotests: TDLS with VHT 80, 80+80, and 160
Jouni Malinen [Thu, 17 Dec 2015 17:26:40 +0000 (19:26 +0200)] 
tests: TDLS with VHT 80, 80+80, and 160

This adds more coverage for TDLS testing for a case where the direct
link should use various VHT channel bandwidths.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agomesh: Fix VHT Operation information in peering messages
Jouni Malinen [Thu, 17 Dec 2015 16:37:19 +0000 (18:37 +0200)] 
mesh: Fix VHT Operation information in peering messages

The full VHT channel information was not set in the hostapd data
structures which resulted in incorrect information (all zeros) being
used when building the VHT Operation element for peering messages while
the actual driver mode was set with the full details. We did not seem to
use the VHT information from peering messages, so this does not change
behavior with another wpa_supplicant-based mesh implementation. Anyway,
these elements should match the ones used in Beacon frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Verify SIGNAL_POLL values in ap_vht80
Jouni Malinen [Thu, 17 Dec 2015 10:54:50 +0000 (12:54 +0200)] 
tests: Verify SIGNAL_POLL values in ap_vht80

This confirms that the station recognized and negotiated 80 MHz
channel use with VHT.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Run OCSP test cases with internal TLS library
Jouni Malinen [Thu, 17 Dec 2015 09:31:37 +0000 (11:31 +0200)] 
tests: Run OCSP test cases with internal TLS library

There is no sufficient OCSP support to go through these test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoTLS: Report OCSP rejection cases when no valid response if found
Jouni Malinen [Thu, 17 Dec 2015 09:45:48 +0000 (11:45 +0200)] 
TLS: Report OCSP rejection cases when no valid response if found

This adds a CTRL-EVENT-EAP-TLS-CERT-ERROR and CTRL-EVENT-EAP-STATUS
messages with 'bad certificate status response' for cases where no valid
OCSP response was received, but the network profile requires OCSP to be
used.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoTLS: Process OCSP SingleResponse(s)
Jouni Malinen [Wed, 16 Dec 2015 23:45:51 +0000 (01:45 +0200)] 
TLS: Process OCSP SingleResponse(s)

This completes OCSP stapling support on the TLS client side. Each
SingleResponse value is iterated until a response matching the server
certificate is found. The validity time of the SingleResponse is
verified and certStatus good/revoked is reported if all validation step
succeed.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoTLS: Store DER encoded version of Subject DN for X.509 certificates
Jouni Malinen [Thu, 17 Dec 2015 09:27:31 +0000 (11:27 +0200)] 
TLS: Store DER encoded version of Subject DN for X.509 certificates

This is needed for OCSP issuerNameHash matching.

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