mech_eap.git
9 years agoP2PS: Callback to create pending group after sending PD Response
Krishna Vamsi [Wed, 10 Dec 2014 11:29:29 +0000 (16:59 +0530)]
P2PS: Callback to create pending group after sending PD Response

This introduces a P2P module callback function that will be used to
create the pending P2PS group after sending PD Response and receiving
ACK status for it.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Callback to remove stale persistent groups
Krishna Vamsi [Wed, 10 Dec 2014 13:38:17 +0000 (19:08 +0530)]
P2PS: Callback to remove stale persistent groups

When the peer device is trying to form a new group despite having
old persistent group with same roles, remove the stale persistent
group.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: ASP provisioning commands to control interface
Krishna Vamsi [Wed, 10 Dec 2014 09:34:32 +0000 (15:04 +0530)]
P2PS: ASP provisioning commands to control interface

This adds new wpa_supplicant control interface commands
P2P_ASP_PROVISION and P2P_ASP_PROVISION_RESP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Process P2PS provisioning commands
Krishna Vamsi [Wed, 10 Dec 2014 14:25:18 +0000 (19:55 +0530)]
P2PS: Process P2PS provisioning commands

This extends wpas_p2p_prov_disc() implementation to accept P2PS
parameters. None of the callers are yet using this functionality; the
following commit introduces a user.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add P2PS attributes into PD Request if requested
Krishna Vamsi [Wed, 10 Dec 2014 08:38:56 +0000 (14:08 +0530)]
P2PS: Add P2PS attributes into PD Request if requested

This adds a data structure for storing P2PS PD information and code to
add the related attributes into PD Request. The actual operation to
trigger this behavior will be added in a separate commit.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Allow p2p_build_ssid() to use pre-set SSID
Krishna Vamsi [Wed, 10 Dec 2014 10:14:18 +0000 (15:44 +0530)]
P2PS: Allow p2p_build_ssid() to use pre-set SSID

This is needed to allow P2PS PD to prepare SSID for the group.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add support to send ASP-RESP events
Krishna Vamsi [Tue, 9 Dec 2014 15:35:41 +0000 (21:05 +0530)]
P2PS: Add support to send ASP-RESP events

Send P2P-SERV-ASP-RESP events upon receiving GAS responses with
ASP services.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Logic to parse GAS requests for ASP services
Krishna Vamsi [Tue, 9 Dec 2014 15:25:08 +0000 (20:55 +0530)]
P2PS: Logic to parse GAS requests for ASP services

Add support to parse received GAS requests for ASP services and
prepare GAS responses accordingly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add support to send ASP service requests
Krishna Vamsi [Tue, 9 Dec 2014 15:12:27 +0000 (20:42 +0530)]
P2PS: Add support to send ASP service requests

This extends the P2P_SERV_DISC_REQ control interface command with a new
"asp" service type. This takes service id, service string, and optional
service info as arguments.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add Application Service Info to device found events
Brian Gix [Thu, 11 Sep 2014 15:18:50 +0000 (18:18 +0300)]
P2PS: Add Application Service Info to device found events

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add Advertised Service Info into Probe Response frames
Brian Gix [Fri, 5 Sep 2014 14:06:25 +0000 (17:06 +0300)]
P2PS: Add Advertised Service Info into Probe Response frames

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Parse Probe Request frames for matching ASP hashes
Krishna Vamsi [Tue, 9 Dec 2014 14:25:29 +0000 (19:55 +0530)]
P2PS: Parse Probe Request frames for matching ASP hashes

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Extend add/del services logic to support ASP
Krishna Vamsi [Tue, 9 Dec 2014 14:02:50 +0000 (19:32 +0530)]
P2PS: Extend add/del services logic to support ASP

In addition, add a new P2P_SERVICE_REP command that can be used to
replace existing ASP advertisements.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Allow p2p_get_group_num_members() to be called with NULL
Brian Gix [Thu, 11 Sep 2014 15:47:03 +0000 (18:47 +0300)]
P2P: Allow p2p_get_group_num_members() to be called with NULL

This make it easier to use wpa_s->p2p_group without having to check
whether there is a group initialized on this wpa_s instance.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: WPS changes needed for P2PS default PIN
Brian Gix [Thu, 11 Sep 2014 15:27:44 +0000 (18:27 +0300)]
P2PS: WPS changes needed for P2PS default PIN

This provides additional WPS definitions and rules for negotiating use
of P2PS default PIN configuration method.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add service hash to Probe Request frames
Brian Gix [Fri, 5 Sep 2014 14:20:18 +0000 (17:20 +0300)]
P2PS: Add service hash to Probe Request frames

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add option to specify seek strings into P2P_FIND
Brian Gix [Fri, 5 Sep 2014 14:27:20 +0000 (17:27 +0300)]
P2PS: Add option to specify seek strings into P2P_FIND

P2PS seek strings can now be specified in the P2P_FIND control interface
command with one or more optional "seek=<str>" parameters.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Helper functions to build new P2P attributes
Krishna Vamsi [Wed, 10 Dec 2014 06:56:33 +0000 (12:26 +0530)]
P2PS: Helper functions to build new P2P attributes

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add parsing of new P2P attributes
Brian Gix [Fri, 5 Sep 2014 14:12:46 +0000 (17:12 +0300)]
P2PS: Add parsing of new P2P attributes

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2PS: Add new P2P identifier assignments from P2P spec v1.5
Brian Gix [Fri, 5 Sep 2014 13:20:44 +0000 (16:20 +0300)]
P2PS: Add new P2P identifier assignments from P2P spec v1.5

These will be used for P2P Services.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAdd helper functions for escaping and unescaping UTF-8
Brian Gix [Fri, 5 Sep 2014 13:43:57 +0000 (16:43 +0300)]
Add helper functions for escaping and unescaping UTF-8

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoFix driver-offloaded offchannel TX done processing
Jouni Malinen [Mon, 2 Feb 2015 12:00:00 +0000 (14:00 +0200)]
Fix driver-offloaded offchannel TX done processing

It was possible for a Action frame sequence completion to stop an
ongoing offchannel remain-on-channel operation unexpectedly in cases
where TX operation was offloaded to the driver and such an operation
happened to occur during a previously started remain-on-channel (e.g.,
for P2P listen state).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Add P2P state into p2p_send_action_cb() debug entry
Jouni Malinen [Mon, 2 Feb 2015 11:48:48 +0000 (13:48 +0200)]
P2P: Add P2P state into p2p_send_action_cb() debug entry

This makes it easier to debug issues related to ongoing P2P operations
getting stopped due to Action frame exchanges.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Ignore remain-on-channel callback event if not waiting for one
Jouni Malinen [Mon, 2 Feb 2015 11:32:06 +0000 (13:32 +0200)]
P2P: Ignore remain-on-channel callback event if not waiting for one

It was possible for the previously requested remain-on-channel for P2P
listen state to get canceled before having received driver event
indicating start of that remain-on-channel operation. In such a case,
the event was able to trigger P2P module to start processing listen
timeout even though there was not supposed to be a following listen
operation anymore. Skip the driver event if we are not waiting for a new
listen state.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoHS 2.0R2: Add password to DB in case of machine managed subscription
Sreenath S [Thu, 10 Apr 2014 10:46:45 +0000 (16:16 +0530)]
HS 2.0R2: Add password to DB in case of machine managed subscription

Add password and machine_managed flag to database in case of machine
managed subscription to fix EAP-TTLS connection failure to production
AP. In case of user managed subscription, the entered password is added
to DB from the PHP script. However in machine managed subscription,
machine generated password is added only in SOAP messages and PPS MO. So
connection to production will fail as the generated password is not
present in the database used by AAA server.

Signed-off-by: Sreenath Sharma <sreenath.mailing.lists@gmail.com>
9 years agoImprove BSS selection with default noise floor values
Mukesh Agrawal [Wed, 9 Apr 2014 00:54:49 +0000 (17:54 -0700)]
Improve BSS selection with default noise floor values

When noise floor measurements are not available, compute SNR
using default values for the noise floor. This helps steer us
towards 5 GHz BSSes in high signal strength environments.

In more detail...

Existing code prefers a 5 GHz BSS when the 5 GHz BSS's signal
strength is "close" to that of the 2.4 GHz BSS, or when both SNRs
are large. However, the mwifiex driver does not provide noise
floor measurements, so we can't compute SNRs.

Because mwifiex doesn't provide NF measurements, the "large SNR"
code wasn't effective. By using default values for the noise floor,
we can again compute SNRs, and decide that the SNR is high enough
that we shouldn't worry about the exact difference in SNR.

The default noise floor values (one for 2.4 GHz, and one for 5 GHz)
were chosen by measurement in a noisy environment, so they should be
conservative.

Note that while this patch is motivated by mwifiex, it affects
ath9k as well. Although ath9k provides noise floor measurements
in general, it will sometimes fail to provide a measurement for
one or more specific channels.

As a result of this patch, we'll always compare BSSes based on SNR
(either measured or estimated), rather than sometimes comparing
based on signal strength. ("Always" assumes that the
WPA_SCAN_LEVEL_DBM flag is set. It is for mwifiex and ath9k.)

While there:
- fix a whitespace issue (spaces -> tab)
- clean up existing comments
- update dump_scan_res to indicate whether the noise floor is
  measured, or default

Signed-hostap: mukesh agrawal <quiche@chromium.org>

9 years agoAdd an option allow canned EAP-Success for wired IEEE 802.1X
Jouni Malinen [Sun, 1 Feb 2015 17:22:54 +0000 (19:22 +0200)]
Add an option allow canned EAP-Success for wired IEEE 802.1X

For wired IEEE 802.1X authentication, phase1="allow_canned_success=1"
can now be used to configure a mode that allows EAP-Success (and
EAP-Failure) without going through authentication step. Some switches
use such sequence when forcing the port to be authorized/unauthorized or
as a fallback option if the authentication server is unreachable. By
default, wpa_supplicant discards such frames to protect against
potential attacks by rogue devices, but this option can be used to
disable that protection for cases where the server/authenticator does
not need to be authenticated.

When enabled, this mode allows EAP-Success/EAP-Failure as an immediate
response to EAPOL-Start (or even without EAPOL-Start) and EAP-Success is
also allowed immediately after EAP-Identity exchange (fallback case for
authenticator not being able to connect to authentication server).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoEAP-MSCHAPv2 peer: Add option to disable password retry query
Jouni Malinen [Sun, 1 Feb 2015 15:45:19 +0000 (17:45 +0200)]
EAP-MSCHAPv2 peer: Add option to disable password retry query

wpa_supplicant used to request user to re-enter username/password if the
server indicated that EAP-MSCHAPv2 (e.g., in PEAP Phase 2)
authentication failed (E=691), but retry is allowed (R=1). This is a
reasonable default behavior, but there may be cases where it is more
convenient to close the authentication session immediately rather than
wait for user to do something.

Add a new "mschapv2_retry=0" option to the phase2 field to allow the
retry behavior to be disabled. This will make wpa_supplicant abort
authentication attempt on E=691 regardless of whether the server allows
retry.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAP-PEAP/MSCHAPv2 password failure
Jouni Malinen [Sun, 1 Feb 2015 15:37:35 +0000 (17:37 +0200)]
tests: EAP-PEAP/MSCHAPv2 password failure

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agohostapd: Simplify vlan_add_dynamic error paths
Helmut Schaa [Mon, 17 Mar 2014 13:16:24 +0000 (14:16 +0100)]
hostapd: Simplify vlan_add_dynamic error paths

Preparation for upcoming changes.
No functional changes.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
9 years agoInterworking: Convert wpa_printf() to wpa_msg()
Ben Greear [Thu, 6 Mar 2014 00:19:51 +0000 (16:19 -0800)]
Interworking: Convert wpa_printf() to wpa_msg()

Also adds a few messages that helped me track down why things
were not working as expected.

Signed-off-by: Ben Greear <greearb@candelatech.com>
9 years agoAdd a variable to handle extra CFLAGS values
Roger Zanoni [Tue, 25 Feb 2014 19:06:08 +0000 (15:06 -0400)]
Add a variable to handle extra CFLAGS values

Some packages don't install its headers in the default directory
(e.g.: In Arch Linux libiberty and libn13 includes are installed)
in their own subdirectory under /usr/include) and the build fails
trying to find the headers.

This patch will allow passing extra CFLAGS values without discarding
the assignments made in the Makefile. The CFLAGS values in the Makefile
are ignored, if defined directly in the make command line.

Signed-off-by: Roger Zanoni <roger.zanoni@openbossa.org>
9 years agotests: Make *_key_lifetime_in_memory more robust
Jouni Malinen [Sat, 31 Jan 2015 16:06:06 +0000 (18:06 +0200)]
tests: Make *_key_lifetime_in_memory more robust

It was possible for the GTK-found-in-memory case to be triggered due to
a retransmission of EAPOL-Key msg 3/4 especially when running test cases
under heavy load (i.e., timeout on hostapd due to not receiving the 4/4
response quickly enough). Make this false failure report less likely by
waiting a bit longer after the connection has been completed before
fetching the process memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: wpa_supplicant and station interface in a bridge
Jouni Malinen [Sat, 31 Jan 2015 15:28:08 +0000 (17:28 +0200)]
tests: wpa_supplicant and station interface in a bridge

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoWork around Linux packet socket regression
Jouni Malinen [Sat, 31 Jan 2015 15:21:58 +0000 (17:21 +0200)]
Work around Linux packet socket regression

Linux kernel commit 576eb62598f10c8c7fd75703fe89010cdcfff596 ('bridge:
respect RFC2863 operational state') from 2012 introduced a regression
for using wpa_supplicant with EAPOL frames and a station interface in a
bridge. Since it does not look like this regression is going to get
fixed any time soon (it is already two years from that commit and over
1.5 from a discussion pointing out the regression), add a workaround in
wpa_supplicant to avoid this issue.

The wpa_supplicant workaround uses a secondary packet socket to capture
all frames (ETH_P_ALL) from the netdev that is in a bridge. This is
needed to avoid the kernel regression. However, this comes at the price
of more CPU load. Some of this is avoided with use of Linux socket
filter, but still, this is less efficient than a packet socket bound to
the specific EAPOL ethertype. The workaround gets disabled
automatically, if the main packet socket interface on the bridge
interface turns out to be working for RX (e.g., due to an old kernel
version being used or a new kernel version having a fix for the
regression). In addition, this workaround is only taken into use for the
special case of running wpa_supplicant with an interface in a bridge.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RSN pre-authentication OOM in wpa_supplicant
Jouni Malinen [Sat, 31 Jan 2015 11:45:52 +0000 (13:45 +0200)]
tests: RSN pre-authentication OOM in wpa_supplicant

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoFix resource leaks on rsn_preauth_init() error paths
Jouni Malinen [Sat, 31 Jan 2015 11:44:48 +0000 (13:44 +0200)]
Fix resource leaks on rsn_preauth_init() error paths

The l2_packet instances were not freed on some of the rsn_preauth_init()
error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RSN pre-authentication timeout
Jouni Malinen [Sat, 31 Jan 2015 11:35:31 +0000 (13:35 +0200)]
tests: RSN pre-authentication timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: PMKSA cache size limit in wpa_supplicant
Jouni Malinen [Sat, 31 Jan 2015 11:26:46 +0000 (13:26 +0200)]
tests: PMKSA cache size limit in wpa_supplicant

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Invalid NFC NDEF record handling
Jouni Malinen [Sat, 31 Jan 2015 00:00:02 +0000 (02:00 +0200)]
tests: Invalid NFC NDEF record handling

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Add capture file validation for IPv6 in proxyarp_open
Jouni Malinen [Fri, 30 Jan 2015 19:55:46 +0000 (21:55 +0200)]
tests: Add capture file validation for IPv6 in proxyarp_open

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Add capture file validation for IPv4 in proxyarp_open
Jouni Malinen [Fri, 30 Jan 2015 14:23:26 +0000 (16:23 +0200)]
tests: Add capture file validation for IPv4 in proxyarp_open

Verify that the expected frames were seend and unexpected frames
weren't.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Add another bridge port to proxyarp_open
Jouni Malinen [Fri, 30 Jan 2015 11:53:34 +0000 (13:53 +0200)]
tests: Add another bridge port to proxyarp_open

Use another AP instance as a separate bridge port in the proxyarp_open
test cases to increase testing coverage for kernel proxyarp
functionality.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Add brctl showmacs output to proxyarp_open test cases
Jouni Malinen [Fri, 30 Jan 2015 11:33:32 +0000 (13:33 +0200)]
tests: Add brctl showmacs output to proxyarp_open test cases

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Run the proxyarp_open test case both with and without ebtables
Jouni Malinen [Fri, 30 Jan 2015 11:26:12 +0000 (13:26 +0200)]
tests: Run the proxyarp_open test case both with and without ebtables

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Fix tshark refactoring
Jouni Malinen [Fri, 30 Jan 2015 13:28:59 +0000 (15:28 +0200)]
tests: Fix tshark refactoring

Commit 2e1d7386e2766b57bc295702af543cc784a0d2be ('tests: Refactor tshark
running') added a helper function for running tshark. However, it did
not use the filter argument correctly, added an extra -Tfields on the
command line, and failed to use global variable. In practice, this ended
up disabling all the tshark sniffer checks. Fix that by using the filter
argument from the caller and marking the _tshark_filter_arg global.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agodhcp_snoop: Make IPv4 addresses human readable in debug log
Jouni Malinen [Fri, 30 Jan 2015 16:38:47 +0000 (18:38 +0200)]
dhcp_snoop: Make IPv4 addresses human readable in debug log

Use standard numbers-and-dots format for IPv4 in debug logs instead
of hexdump in two different byte orders.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: RADIUS server changing VLAN ID assignment
Jouni Malinen [Thu, 29 Jan 2015 23:11:56 +0000 (01:11 +0200)]
tests: RADIUS server changing VLAN ID assignment

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoFix STA re-bind to another VLAN on reauthentication
Jouni Malinen [Thu, 29 Jan 2015 23:09:51 +0000 (01:09 +0200)]
Fix STA re-bind to another VLAN on reauthentication

Previously, the old VLAN ID could have been deleted before the STA was
bound to the new VLAN in case the RADIUS server changed the VLAN ID
during an association. This did not exactly work well with mac80211, so
reorder the operations in a way that first binds the STA to the new VLAN
ID and only after that, removes the old VLAN interface if no STAs remain
in it.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoFree old eap_user_file data on configuration change
Jouni Malinen [Thu, 29 Jan 2015 22:54:40 +0000 (00:54 +0200)]
Free old eap_user_file data on configuration change

This fixes a memory leak if hostapd eap_user_file parameter is modified.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: PMKSA caching OOM error cases
Jouni Malinen [Thu, 29 Jan 2015 22:14:57 +0000 (00:14 +0200)]
tests: PMKSA caching OOM error cases

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: hostapd OOM loop tests for WPA2-PSK and WPA2-EAP connection
Jouni Malinen [Thu, 29 Jan 2015 20:33:25 +0000 (22:33 +0200)]
tests: hostapd OOM loop tests for WPA2-PSK and WPA2-EAP connection

These verify number of previously uncovered error paths.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoWPA auth: Disconnect STA if MSK cannot be fetched
Jouni Malinen [Thu, 29 Jan 2015 20:31:41 +0000 (22:31 +0200)]
WPA auth: Disconnect STA if MSK cannot be fetched

Previously, it was possible for some corner cases to leave the WPA
authenticator state machine running if PMK could not be derived. Change
this to forcefully disconnect the STA to get more consistent behavior
and faster notification of the error.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoWPA auth: Clear temporary MSK storage from stack explicitly
Jouni Malinen [Thu, 29 Jan 2015 20:24:27 +0000 (22:24 +0200)]
WPA auth: Clear temporary MSK storage from stack explicitly

This reduces the duration of time a key may remain unnecessarily in
memory.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoConvert couple of remaining printf to wpa_printf in ap_list
Jouni Malinen [Thu, 29 Jan 2015 19:12:51 +0000 (21:12 +0200)]
Convert couple of remaining printf to wpa_printf in ap_list

This type of error reporting cases should use wpa_printf() to get
consistent debug logging behavior.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: OLBC AP table error cases
Jouni Malinen [Thu, 29 Jan 2015 19:11:41 +0000 (21:11 +0200)]
tests: OLBC AP table error cases

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: hostapd OOM loop targeting RADIUS accounting
Jouni Malinen [Thu, 29 Jan 2015 18:52:30 +0000 (20:52 +0200)]
tests: hostapd OOM loop targeting RADIUS accounting

The hostapd_oom_wpa2_eap test case did not always catch these code
paths, so add a variant of that test case explicitly targeting RADIUS
functions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: cfg80211 DEL_STATION issued externally to hostapd
Jouni Malinen [Thu, 29 Jan 2015 14:26:31 +0000 (16:26 +0200)]
tests: cfg80211 DEL_STATION issued externally to hostapd

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: RADIUS MAC ACL and accounting enabled
Jouni Malinen [Thu, 29 Jan 2015 13:48:23 +0000 (15:48 +0200)]
tests: RADIUS MAC ACL and accounting enabled

This ends up using the special User-Name = STA MAC address case for
Accounting-Request. In addition, add Chargeable-User-Identity for one of
the STAs.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: EAP-MSCHAPv2 server out-of-memory cases
Jouni Malinen [Wed, 28 Jan 2015 14:17:25 +0000 (16:17 +0200)]
tests: EAP-MSCHAPv2 server out-of-memory cases

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoEAP-PEAP server: Fix Phase 2 TLV length in error case
Jouni Malinen [Wed, 28 Jan 2015 14:15:58 +0000 (16:15 +0200)]
EAP-PEAP server: Fix Phase 2 TLV length in error case

The payload length in a Phase 2 TLV message reporting error was not set
correctly. Fix this to not include the TLVs that are included only in
success case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: EAP-GTC server error cases
Jouni Malinen [Wed, 28 Jan 2015 13:59:02 +0000 (15:59 +0200)]
tests: EAP-GTC server error cases

In addition, no-password-configured coverage extended to EAP-MD5 and
EAP-MSCHAPv2 as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agomesh: Create new station entry on popen frames
Bob Copeland [Tue, 27 Jan 2015 13:17:59 +0000 (08:17 -0500)]
mesh: Create new station entry on popen frames

Currently, there is a race in open mesh networks where mesh STA A
receives a beacon from B and sends a peering open frame to initiate
peering. STA B, having not yet received a beacon from A and thus
created the corresponding station entry, will ignore all such open
frames. If the beacon interval is sufficiently long then peering
will not succeed as a result.

In fact B can simply create the station entry when the popen is
received, as is done in Linux's in-kernel MPM, avoiding the issue.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agomesh: Always free the station if peering failed
Bob Copeland [Tue, 27 Jan 2015 13:17:58 +0000 (08:17 -0500)]
mesh: Always free the station if peering failed

Previously, we would only free the station entry if a peering close
frame was received (freeing the station entry causes the kernel to
start sending peer candidate events again when suitable beacons are
received, triggering peering or authentication to restart).

The end result is the same in any case regardless of close reason:
if we leave holding state then peering has started again, so go
ahead and remove the station in all cases.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agomesh: Sync plink state with kernel
Masashi Honma [Thu, 22 Jan 2015 05:22:16 +0000 (14:22 +0900)]
mesh: Sync plink state with kernel

The plink_state exists both wpa_supplicant and kernel. Synchronize them
with wpa_mesh_set_plink_state().

Signed-off-by: Kenzoh Nishikawa <Kenzoh.Nishikawa@jp.sony.com>
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
9 years agotests: Pending EAP peer processing with VENDOR-TEST
Jouni Malinen [Tue, 27 Jan 2015 23:39:35 +0000 (01:39 +0200)]
tests: Pending EAP peer processing with VENDOR-TEST

This extends the VENDOR-TEST EAP method peer implementation to allow
pending processing case to be selected at run time. The
ap_wpa2_eap_vendor_test test case is similarly extended to include this
option as the second case for full coverage.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoSimplify eapol_sm_notify_pmkid_attempt()
Jouni Malinen [Tue, 27 Jan 2015 23:26:14 +0000 (01:26 +0200)]
Simplify eapol_sm_notify_pmkid_attempt()

Drop the unneeded 'attempt' argument. This was originally used for
indicating an aborted PMKID caching attempt, but a fix in 2006 removed
the only such user and since that time, only attempt == 1 has been used.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAPOL supplicant invalid frame handling
Jouni Malinen [Tue, 27 Jan 2015 15:06:26 +0000 (17:06 +0200)]
tests: EAPOL supplicant invalid frame handling

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: STATUS-VERBOSE
Jouni Malinen [Tue, 27 Jan 2015 14:02:35 +0000 (16:02 +0200)]
tests: STATUS-VERBOSE

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAdd eap_session_id to wpa_supplicant STATUS output
Jouni Malinen [Tue, 27 Jan 2015 14:14:40 +0000 (16:14 +0200)]
Add eap_session_id to wpa_supplicant STATUS output

This makes the current EAP Session-Id available for external programs.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoOpenSSL: Implement aes_wrap() and aes_unwrap()
Jouni Malinen [Tue, 27 Jan 2015 11:57:59 +0000 (13:57 +0200)]
OpenSSL: Implement aes_wrap() and aes_unwrap()

This replaces the implementation in aes-wrap.c and aes-unwrap.c with
OpenSSL AES_wrap_key() and AES_unwrap_key() functions when building
hostapd or wpa_supplicant with OpenSSL.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoOpenSSL: Remove support for versions older than 0.9.8
Jouni Malinen [Tue, 27 Jan 2015 11:37:49 +0000 (13:37 +0200)]
OpenSSL: Remove support for versions older than 0.9.8

These have reached out-of-life status in the OpenSSL project and there
is no need to maintain support for them in hostapd/wpa_supplicant
either.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoOpenSSL: Use a common helper function for HMAC
Jouni Malinen [Tue, 27 Jan 2015 11:32:38 +0000 (13:32 +0200)]
OpenSSL: Use a common helper function for HMAC

There is no need to duplicate this construction for each hash algorithm.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoOpenSSL: Replace internal HMAC-MD5 implementation
Jouni Malinen [Tue, 27 Jan 2015 11:26:01 +0000 (13:26 +0200)]
OpenSSL: Replace internal HMAC-MD5 implementation

Use OpenSSL HMAC_* functions to implement HMAC-MD5 instead of depending
on the src/crypto/md5.c implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoIgnore pmf=1 default if driver does not support PMF
Jouni Malinen [Mon, 26 Jan 2015 15:40:22 +0000 (17:40 +0200)]
Ignore pmf=1 default if driver does not support PMF

Connection with a PMF enabled AP will fail if we try to negotiate PMF
while the local driver does not support this. Since pmf=1 does not
require PMF for a successful connection, it can be ignored in such a
case to avoid connectivity issues with invalid configuration. This makes
it somewhat easier to allow upper layer programs to use pmf=1 default
regardless of driver capabilities.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Fix build with libnl 1.1
Jouni Malinen [Mon, 26 Jan 2015 23:50:02 +0000 (01:50 +0200)]
nl80211: Fix build with libnl 1.1

Commit 630b3230c86abf1976a39db596c51540e57e31c8 ('nl80211: Increase
netlink receive buffer size') added unconditional use of
nl_socket_set_buffer_size() which was not included in libnl 1.1. Fix use
of that old version by making this conditional on CONFIG_LIBNL20.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoUpdate copyright notices for the new year 2015
Jouni Malinen [Mon, 26 Jan 2015 00:25:22 +0000 (02:25 +0200)]
Update copyright notices for the new year 2015

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Suite B 192-bit profile
Jouni Malinen [Sun, 25 Jan 2015 11:16:06 +0000 (13:16 +0200)]
tests: Suite B 192-bit profile

This adds a Suite B test case for 192-bit level.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Complete Suite B 128-bit coverage
Jouni Malinen [Sat, 24 Jan 2015 20:24:10 +0000 (22:24 +0200)]
tests: Complete Suite B 128-bit coverage

Enable BIP-GMAC-128 and enforce Suite B profile for TLS.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Fix ft_psk_key_lifetime_in_memory with new PTK derivation debug
Jouni Malinen [Mon, 26 Jan 2015 00:07:32 +0000 (02:07 +0200)]
tests: Fix ft_psk_key_lifetime_in_memory with new PTK derivation debug

PTK is not printed out anymore as a single entry, so fetch KCK, KEK, and
TK separately.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd Suite B AKMs to key_mgmt capability list
Jouni Malinen [Mon, 26 Jan 2015 00:00:18 +0000 (02:00 +0200)]
Add Suite B AKMs to key_mgmt capability list

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd Suite B 192-bit AKM
Jouni Malinen [Sun, 25 Jan 2015 21:32:01 +0000 (23:32 +0200)]
Add Suite B 192-bit AKM

WPA-EAP-SUITE-B-192 can now be used to select 192-bit level Suite B into
use as the key management method.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd HMAC-SHA384
Jouni Malinen [Sun, 25 Jan 2015 22:37:18 +0000 (00:37 +0200)]
Add HMAC-SHA384

For now, this is only implemented with OpenSSL.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoPreparations for variable length KCK and KEK
Jouni Malinen [Sun, 25 Jan 2015 14:49:18 +0000 (16:49 +0200)]
Preparations for variable length KCK and KEK

This modifies struct wpa_ptk to allow the length of KCK and KEK to be
stored. This is needed to allow longer keys to be used, e.g., with
Suite B 192-bit level.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Group management frame cipher suites
Jouni Malinen [Fri, 23 Jan 2015 13:58:51 +0000 (15:58 +0200)]
tests: Group management frame cipher suites

This extends testing coverage of PMF group management cipher suites to
include all the cases supported by the driver (existing BIP =
AES-128-CMAC and the new BIP-GMAC-128, BIP-GMAC-256, BIP-CMAC-256).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agowlantest: Extend BIP validation to support GMAC-128 and GMAC-256
Jouni Malinen [Sat, 24 Jan 2015 10:21:49 +0000 (12:21 +0200)]
wlantest: Extend BIP validation to support GMAC-128 and GMAC-256

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agowlantest: New mgmt_group_cipher values for BSS info and debug log
Jouni Malinen [Sat, 24 Jan 2015 10:09:04 +0000 (12:09 +0200)]
wlantest: New mgmt_group_cipher values for BSS info and debug log

This adds BIP-GMAC-128, BIP-GMAC-256, and BIP-CMAC-256 to info_bss
command and debug log.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agowlantest: Extend BIP support to cover BIP-CMAC-256
Jouni Malinen [Fri, 23 Jan 2015 15:24:24 +0000 (17:24 +0200)]
wlantest: Extend BIP support to cover BIP-CMAC-256

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoExtend AES-CMAC routines to support 256-bit keys
Jouni Malinen [Fri, 23 Jan 2015 14:59:33 +0000 (16:59 +0200)]
Extend AES-CMAC routines to support 256-bit keys

omac1_aes_256() and omac1_aes_vector() can now be used to perform
256-bit CMAC operations similarly to the previously supported 128-bit
cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agonl80211: Fix default group key management index configuration
Jouni Malinen [Fri, 23 Jan 2015 14:47:53 +0000 (16:47 +0200)]
nl80211: Fix default group key management index configuration

The correct nl80211 flag for group key management cipher was set only
for BIP (AES-CMAC-128). The same flag needs to be used with the newer
ciphers BIP-CMAC-256, BIP-GMAC-128, and BIP-GMAC-256.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoShow supported group_mgmt capabilities
Jouni Malinen [Fri, 23 Jan 2015 13:57:05 +0000 (15:57 +0200)]
Show supported group_mgmt capabilities

This extends GET_CAPABILITY command to allow the supported group
management frame cipher suites to be listed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoInterworking: More debug messages
Ben Greear [Mon, 12 Jan 2015 22:15:48 +0000 (14:15 -0800)]
Interworking: More debug messages

And convert some wpa_printf to wpa_msg.

Signed-off-by: Ben Greear <greearb@candelatech.com>
9 years agoInterworking: Add logging to track nai_realm_find_eap failures
Ben Greear [Mon, 12 Jan 2015 22:15:47 +0000 (14:15 -0800)]
Interworking: Add logging to track nai_realm_find_eap failures

There are lots of reasons we can fail to match an EAP credential, so add
logging to help determine why it is happening in various cases.

Signed-off-by: Ben Greear <greearb@candelatech.com>
9 years agoInterworking: Remove unnecessary NULL check
Jouni Malinen [Sat, 24 Jan 2015 17:36:55 +0000 (19:36 +0200)]
Interworking: Remove unnecessary NULL check

nai_realm_find_eap() is called only in cases where the cred pointer is
not NULL.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agohostapd: Debug messages for dodgy RADIUS servers
Ben Greear [Mon, 12 Jan 2015 22:15:45 +0000 (14:15 -0800)]
hostapd: Debug messages for dodgy RADIUS servers

These were helpful when tracking down why hostapd did not work
properly with a RADIUS server.

Signed-hostap: Ben Greear <greearb@candelatech.com>

9 years agowpa_gui: Sort frequency and signal numerically in the scan results dialog
Adrian Nowicki [Thu, 15 Jan 2015 16:53:38 +0000 (17:53 +0100)]
wpa_gui: Sort frequency and signal numerically in the scan results dialog

Signal strength was sorted lexically rather than numerically, which
put "-100 dBm" before "-50 dBm" if sorted in descending order.
This change fixes that. It also treats frequency in the same
manner, preparing it for the IEEE 802.11ah.

Signed-off-by: Adrian Nowicki <adinowicki@gmail.com>
9 years agotests: Make ap_wps_er_pbc_overlap more robust
Jouni Malinen [Thu, 22 Jan 2015 22:52:56 +0000 (00:52 +0200)]
tests: Make ap_wps_er_pbc_overlap more robust

Reorder scanning in a way that allows the ER behavior to be more
predictable. The first Probe Request report is for a previously received
frame on the AP and this new sequence avoids leaving either of the PBC
test STAs to be that one.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Make active scans more robust
Jouni Malinen [Thu, 22 Jan 2015 20:38:38 +0000 (22:38 +0200)]
tests: Make active scans more robust

This makes testing under very heavy load or under extensive kernel
debugging options more robust by allowing number of test cases to scan
multiple times before giving up on active scans. The main reason for
many of the related test failures is in Probe Response frame from
hostapd not getting out quickly enough especially when multiple BSSes
are operating.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: P2P group formation using PBC multiple times in a row
Jouni Malinen [Thu, 22 Jan 2015 18:53:03 +0000 (20:53 +0200)]
tests: P2P group formation using PBC multiple times in a row

This verifies that PBC session overlap detection does not get indicated
when forming the group with the same peer multiple times.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAdd passive_scan configuration parameter
Jouni Malinen [Thu, 22 Jan 2015 18:50:01 +0000 (20:50 +0200)]
Add passive_scan configuration parameter

This new wpa_supplicant configuration parameter can be used to force
passive scanning to be used for most scanning cases at the cost of
increased latency and less reliably scans. This may be of use for both
testing purposes and somewhat increased privacy due to no Probe Request
frames with fixed MAC address being sent out.

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