mech_eap.git
8 years agoP2P: Clear groups first on FLUSH command
Jouni Malinen [Wed, 6 Jan 2016 16:49:15 +0000 (18:49 +0200)]
P2P: Clear groups first on FLUSH command

This is needed to get proper P2P group removal processing for some test
cases. discovery_group_client followed by nfc_p2p_client was able to hit
a case where the P2P group idle timeout survived to the next group
instance because of the FLUSH command not clearing the group and this
timeout properly.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomesh: Do not force another peering exchange on driver event
Jouni Malinen [Wed, 6 Jan 2016 15:20:20 +0000 (17:20 +0200)]
mesh: Do not force another peering exchange on driver event

If the local driver indicated a peer candidate event when the peer had
already initiated peering exchange in open mesh case, we used to force a
new exchange to be started instead of allowing the previously started
exchange to complete. This is not desirable, so make this initiation of
the new exchange conditional on there not being an already started (or
successfully completed) exchange.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomesh: Do not clear link state on driver event if exchange was started
Jouni Malinen [Wed, 6 Jan 2016 15:17:13 +0000 (17:17 +0200)]
mesh: Do not clear link state on driver event if exchange was started

If the local driver event for a new peer candidate arrived only after
the peer had already initiated the peering exchange, we used to clear
the link state. This resulted in the already completed (or in progress)
exchange getting abandoned and a new exchange initiated. This is not
desirable since the already started (or even completed) exchange can be
used. Clear the link state only when adding the new STA entry for the
first time, i.e., use the same !sta->my_lid condition in handling the
driver event similarly to how the peer initiated cases were already
handled.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomesh: Add some more details to MPM debug messages
Jouni Malinen [Wed, 6 Jan 2016 15:16:24 +0000 (17:16 +0200)]
mesh: Add some more details to MPM debug messages

This makes it easier to follow the debug log when trying to figure out
issues with mesh peering exchange.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Add a missing space to a debug message
Jouni Malinen [Wed, 6 Jan 2016 11:20:31 +0000 (13:20 +0200)]
nl80211: Add a missing space to a debug message

The "nl80211: New peer candidate" debug message did not have a space
before the MAC address.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomesh: Connection and group started/removed events into debug log
Jouni Malinen [Wed, 6 Jan 2016 11:13:13 +0000 (13:13 +0200)]
mesh: Connection and group started/removed events into debug log

The messages were sent out with wpa_msg_ctrl() so they were not visible
in the debug log. However, these would be quite helpful strings to
search for in the debug log, so change these messages to use wpa_msg().

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd more hostapd.conf documentation for hw_mode with HT/VHT
Jouni Malinen [Wed, 6 Jan 2016 10:50:40 +0000 (12:50 +0200)]
Add more hostapd.conf documentation for hw_mode with HT/VHT

Try to make it more obvious that hw_mode=a needs to be used with HT and
VHT when using the 5 GHz band.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-PEAP peer: Cryptobinding in fast-reconnect case with inner EAP
Jouni Malinen [Tue, 5 Jan 2016 21:50:50 +0000 (23:50 +0200)]
EAP-PEAP peer: Cryptobinding in fast-reconnect case with inner EAP

This was reported to fail with Windows 2012r2 with "Invalid Compound_MAC
in cryptobinding TLV". It turns out that the server decided to go
through inner EAP method (EAP-MSCHAPv2 in the reported case) even when
using PEAP fast-reconnect. This seems to be against the [MS-PEAP]
specification which claims that inner EAP method is not used in such a
case. This resulted in a different CMK being derived by the server (used
the version that used ISK) and wpa_supplicant (used the version where
IPMK|CMK = TK without ISK when using fast-reconnect).

Fix this interop issue by making wpa_supplicant to use the
fast-reconnect version of CMK derivation only when using TLS session
resumption and the server having not initiated inner EAP method before
going through the cryptobinding exchange.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoP2P: Try SD Query with each non-ACK peer only once per search iteration
Jouni Malinen [Mon, 4 Jan 2016 23:03:28 +0000 (01:03 +0200)]
P2P: Try SD Query with each non-ACK peer only once per search iteration

The previous behavior of bursting out all retry attempts of an SD Query
frame during a single search/listen iteration does not look very helpful
in the case where the peer does not ACK the query frame. Since the peer
was found in the search, but is not ACKing frames anymore, it is likely
that it left its listen state and we might as well do something more
useful to burst out a significant number of frames in hopes of seeing
the peer.

Modify the SD Query design during P2P Search to send out only a single
attempt (with likely multiple link-layer retries, if needed) per
search/listen iteration to each peer that has pending SD queries. Once
no more peers with pending queries remain, force another Listen and
Search phase to go through before continuing with the pending SD
queries.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoClear wpa_supplicant state to DISCONNECTED on FLUSH command
Jouni Malinen [Mon, 4 Jan 2016 21:37:43 +0000 (23:37 +0200)]
Clear wpa_supplicant state to DISCONNECTED on FLUSH command

It was possible for the FLUSH command to trigger auto connect mechanism
to schedule a new scan in 100 ms. This is not desired since all the
network profiles will be removed immediately and the scan or an attempt
to reconnect would not be of any benefit here. Such a scan in 100 ms can
cause issues for cases where multiple test sequences are run back to
back, so prevent this by clearing wpa_supplicant state to DISCONNECTED
(which avoids scheduling of the 100 ms scan trigger on disconnection) if
the state was AUTHENTICATING or higher when the FLUSH command was
issued.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Make P2P discovery on non-social channel cases more robust
Jouni Malinen [Mon, 4 Jan 2016 21:25:26 +0000 (23:25 +0200)]
tests: Make P2P discovery on non-social channel cases more robust

The test cases discovery_ctrl_char_in_devname and discovery_group_client
tried to allow three P2P_FIND instances to be used before reporting an
error. However, this did not really work properly since the second and
third attempts would likely fail to start the initial special P2P_FIND
scan due to an already ongoing p2p_scan operation. Fix this by stopping
the previous P2P_FIND and waiting for the scan to complete if a retry is
needed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoHS 2.0: Add some documentation for OSEN and network block use
Jouni Malinen [Mon, 4 Jan 2016 19:34:39 +0000 (21:34 +0200)]
HS 2.0: Add some documentation for OSEN and network block use

This adds notes on how wpa_supplicant can be configured for OSEN for a
link-layer protected online signup connection and how network profiles
can be set for a Hotspot 2.0 data connection when using external
Interworking network selection.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: EAP-LEAP protocol tests (error paths)
Jouni Malinen [Mon, 4 Jan 2016 16:11:28 +0000 (18:11 +0200)]
tests: EAP-LEAP protocol tests (error paths)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: wpa_supplicant AP mode - unexpected P2P IE in Association Request
Jouni Malinen [Fri, 1 Jan 2016 15:14:46 +0000 (17:14 +0200)]
tests: wpa_supplicant AP mode - unexpected P2P IE in Association Request

This verifies that there is no NULL pointer dereference when the AP code
processes Probe Request and (Re)Association Request frames with a P2P IE
in case P2P support is explicitly disabled on the AP mode interface.
This is a regression test case for the fixes in the previous commit.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix wpa_supplicant AP mode P2P IE handling if P2P is disabled
Jouni Malinen [Fri, 1 Jan 2016 15:12:43 +0000 (17:12 +0200)]
Fix wpa_supplicant AP mode P2P IE handling if P2P is disabled

If P2P support is included in wpa_supplicant build (CONFIG_P2P=y), but
P2P functionality is explicitly disabled (e.g., "P2P_SET disabled 1"),
couple of AP management frame processing steps did not check against
hapd->p2p_group being NULL and could end up dereferencing a NULL pointer
if a Probe Request frame or (Re)Association Request frame was received
with a P2P IE in it. Fix this by skipping these steps if hapd->p2p_group
is NULL.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix wpa_supplicant build with CONFIG_L2_PACKET=pcap
Jouni Malinen [Fri, 1 Jan 2016 14:50:24 +0000 (16:50 +0200)]
Fix wpa_supplicant build with CONFIG_L2_PACKET=pcap

Commit e6dd8196e5daf39e4204ef8ecd26dd50fdca6040 ('Work around Linux
packet socket regression') forgot to add the l2_packet_init_bridge()
wrapper for l2_packet_pcap.c while updating all the other l2_packet
options. This resulted in wpa_supplicant build failing due to missing
l2_packet_init_bridge() function when using CONFIG_L2_PACKET=pcap in
wpa_supplicant/.config. Fix this by adding the wrapper function.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUpdate copyright notices for the new year 2016
Jouni Malinen [Fri, 1 Jan 2016 11:08:57 +0000 (13:08 +0200)]
Update copyright notices for the new year 2016

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS PIN provisioning with configured AP (WPA+WPA2)
Jouni Malinen [Fri, 1 Jan 2016 10:02:48 +0000 (12:02 +0200)]
tests: WPS PIN provisioning with configured AP (WPA+WPA2)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Testing mechanism to force auth/encr type flags
Jouni Malinen [Fri, 1 Jan 2016 11:03:25 +0000 (13:03 +0200)]
WPS: Testing mechanism to force auth/encr type flags

The new wps_force_{auth,encr}_types parameters can be used in test build
(CONFIG_WPS_TESTING) to force wpa_supplicant to use the specified value
in the Authentication/Encryption Type flags attribute. This can be used
to test AP behavior on various error cases for which there are
workarounds to cover deployed device behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Add a workaround for WPA2PSK missing from Enrollee auth flags
Jouni Malinen [Fri, 1 Jan 2016 10:49:27 +0000 (12:49 +0200)]
WPS: Add a workaround for WPA2PSK missing from Enrollee auth flags

Some deployed implementations seem to advertise incorrect information in
this attribute. A value of 0x1b (WPA2 + WPA + WPAPSK + OPEN, but no
WPA2PSK) has been reported to be used. Add WPA2PSK to the list to avoid
issues with building Credentials that do not use the strongest actually
supported authentication option (that device does support WPA2PSK even
when it does not claim it here).

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Do not build Credential with unsupported encr combination on AP
Jouni Malinen [Fri, 1 Jan 2016 09:59:20 +0000 (11:59 +0200)]
WPS: Do not build Credential with unsupported encr combination on AP

It was possible for the Registrar code to generate a Credential with
auth type WPAPSK (i.e., WPA v1) with encr type AES if the Enrollee
claimed support for WPAPSK and not WPA2PSK while the AP was configured
in mixed mode WPAPSK+WPA2PSK regardless of how wpa_pairwise (vs.
rsn_pairwise) was set since encr type was selected from the union of
wpa_pairwise and rsn_pairwise. This could result in the Enrollee
receiving a Credential that it could then not use with the AP.

Fix this by masking the encryption types separately on AP based on the
wpa_pairwise/rsn_pairwise configuration. In the example case described
above, the Credential would get auth=WPAPSK encr=TKIP instead of
auth=WPAPSK encr=AES.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Use full prefix of the P2P-GO-NEG-FAILURE
Jouni Malinen [Thu, 31 Dec 2015 20:40:14 +0000 (22:40 +0200)]
tests: Use full prefix of the P2P-GO-NEG-FAILURE

Couple of waits for this event used the "GO-NEG-FAILURE" string instead
of the full event prefix. While this worked in the tests due to a
substring matching, it is better to use the full event prefix here.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Do not dump pending events in p2p_go_neg_init timeout=0 case
Jouni Malinen [Thu, 31 Dec 2015 20:38:55 +0000 (22:38 +0200)]
tests: Do not dump pending events in p2p_go_neg_init timeout=0 case

It was possible for the dump_monitor() call to drop a P2P-GO-NEG-FAILURE
event that was indicated quickly after the P2P_CONNECT command was
issued. This could result in grpform_reject test case failing to see the
expected event and fail the test due to "Rejection not reported".

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoHS 2.0: Postpone WNM-Notification sending by 100 ms
Jouni Malinen [Thu, 31 Dec 2015 19:46:08 +0000 (21:46 +0200)]
HS 2.0: Postpone WNM-Notification sending by 100 ms

This makes it somewhat easier for the station to be able to receive and
process the encrypted WNM-Notification frames that the AP previously
sentt immediately after receiving EAPOL-Key msg 4/4. While the station
is supposed to have the TK configured for receive before sending out
EAPOL-Key msg 4/4, not many actual implementations do that. As such,
there is a race condition in being able to configure the key at the
station and the AP sending out the first encrypted frame after EAPOL-Key
4/4. The extra 100 ms time here makes it more likely for the station to
have managed to configure the key in time.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: EAP-FAST and different TLS cipher suites
Jouni Malinen [Thu, 31 Dec 2015 18:53:43 +0000 (20:53 +0200)]
tests: EAP-FAST and different TLS cipher suites

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoEAP-FAST: Enable AES256-based TLS cipher suites with OpenSSL
Jouni Malinen [Thu, 31 Dec 2015 18:52:58 +0000 (20:52 +0200)]
EAP-FAST: Enable AES256-based TLS cipher suites with OpenSSL

This extends the list of TLS cipher suites enabled for EAP-FAST to
include AES256-based suites.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoOpenSSL: Share a single openssl_tls_prf() implementation
Jouni Malinen [Thu, 31 Dec 2015 18:10:30 +0000 (20:10 +0200)]
OpenSSL: Share a single openssl_tls_prf() implementation

Add SSL_SESSION_get_master_key() compatibility wrapper for older OpenSSL
versions to be able to use the new openssl_tls_prf() implementation for
OpenSSL 1.1.0 with all supported versions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoOpenSSL: Clean up function to fetch client/server random
Jouni Malinen [Thu, 31 Dec 2015 16:15:09 +0000 (18:15 +0200)]
OpenSSL: Clean up function to fetch client/server random

SSL_get_client_random() and SSL_get_server_random() will be added in
OpenSSL 1.1.0. Provide compatibility wrappers for older versions to
simplify the tls_connection_get_random() implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoOpenSSL: Drop support for OpenSSL 1.0.0
Jouni Malinen [Thu, 31 Dec 2015 16:05:28 +0000 (18:05 +0200)]
OpenSSL: Drop support for OpenSSL 1.0.0

The OpenSSL project will not support version 1.0.0 anymore. As there
won't be even security fixes for this branch, it is not really safe to
continue using 1.0.0 and we might as well drop support for it to allow
cleaning up the conditional source code blocks.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoOpenSSL: Drop support for OpenSSL 0.9.8
Jouni Malinen [Thu, 31 Dec 2015 15:55:03 +0000 (17:55 +0200)]
OpenSSL: Drop support for OpenSSL 0.9.8

The OpenSSL project will not support version 0.9.8 anymore. As there
won't be even security fixes for this branch, it is not really safe to
continue using 0.9.8 and we might as well drop support for it to allow
cleaning up the conditional source code blocks.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clear BSS table at the end of rsn_ie_proto_eap_sta
Jouni Malinen [Wed, 30 Dec 2015 22:53:20 +0000 (00:53 +0200)]
tests: Clear BSS table at the end of rsn_ie_proto_eap_sta

rsn_ie_proto_eap_sta followed by eap_ttls_mschapv2_session_resumption
showed a failure case where the special RSNE from rsn_ie_proto_eap_sta
ended up remaining in a wpa_supplicant BSS entry and the SELECT_NETWORK
command used the previous scan results without checking for changed AP
configuration. This resulted in test failure due to RSN IE being claimed
to be different in EAPOL-Key msg 3/4. This is not really a real world
issue, but try to avoid false failure reports by explicitly clearing the
BSS table at the end of rsn_ie_proto_eap_sta.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: P2P_LISTEN immediately followed by P2P_FIND
Jouni Malinen [Wed, 30 Dec 2015 22:37:45 +0000 (00:37 +0200)]
tests: P2P_LISTEN immediately followed by P2P_FIND

This verifies that the previous commit works correctly by forcing a
P2P_LISTEN command execution to be interupted by a P2P_FIND command
timed in a manner that forces it to show up before the kernel ROC has
started for the Listen.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Fix P2P_FIND while waiting for listen ROC to start in the driver
Jouni Malinen [Wed, 30 Dec 2015 22:35:21 +0000 (00:35 +0200)]
P2P: Fix P2P_FIND while waiting for listen ROC to start in the driver

It was possible for the p2p->pending_listen_freq to be left indicating
that there is a pending ROC for a listen operation if a P2P_FIND command
was timed to arrive suitably between a previous Listen operation issuing
a ROC request and the kernel code starting that request. This could
result in the P2P state machine getting stuck unable to continue the
find ("P2P: p2p_listen command pending already").

Fix this by clearing p2p->pending_listen_freq when starting P2P_FIND
command execution.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: GO Negotiation stopped after TX start
Jouni Malinen [Wed, 30 Dec 2015 22:06:06 +0000 (00:06 +0200)]
tests: GO Negotiation stopped after TX start

This verifies that P2P_STOP_FIND stops a pending offchannel TX wait in
the kernel by checking that a listen operation can be started in less
than a second after stopping a pending Action frame TX. This verifies
that the optimization introduced in the previous commit works properly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Stop offchannel TX wait on P2P_STOP_FIND/P2P_LISTEN
Jouni Malinen [Wed, 30 Dec 2015 22:03:21 +0000 (00:03 +0200)]
P2P: Stop offchannel TX wait on P2P_STOP_FIND/P2P_LISTEN

Previously it was possible for the pending Action frame TX to be
cleared, but the offchannel TX operation being left in wait state in the
kernel. This would delay start of the next operation (e.g., that listen
operation requested by P2P_LISTEN) until the wait time for the
previously pending Action frame had expired.

Optimize this by explicitly stopping any pending offchannel Action frame
TX when clearing the internal offchannel TX state in
wpas_p2p_clear_pending_action_tx().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRevert "tests: vm: Output everything on console"
Jouni Malinen [Wed, 30 Dec 2015 19:51:52 +0000 (21:51 +0200)]
Revert "tests: vm: Output everything on console"

This reverts commit be9fe3d8aff394ea6868f1a2347e8c12609b086e. While I
did manage to complete multiple test runs without failures, it looks
like this change increases full test run duration by about 30 seconds
when using seven VMs. The most visible reason for that seems to be in
"breaking" active scanning quite frequently with the Probe Response
frame coming out about 40 ms (or more) after the Probe Request frame
which is long enough for the station to already have left the channel.

Since this logging change is not critical, it is simplest to revert it
for now rather than make changes to huge number of test cases to allow
more scan attempts to be performed before timing out.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Increase connection timeout for number of EAP test cases
Jouni Malinen [Wed, 30 Dec 2015 18:00:01 +0000 (20:00 +0200)]
tests: Increase connection timeout for number of EAP test cases

The previously used 10 second timeout allowed only two scan attempts
(five seconds between scans) and it was possible to hit a failure every
now and then when running under heavy load and the Probe Response frame
got delayed by 40 ms or so twice in a row. Add more time for one more
scan attempt to reduce the likelihood of this happening.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Make scan test cases more robust by allowing retries
Jouni Malinen [Wed, 30 Dec 2015 17:52:42 +0000 (19:52 +0200)]
tests: Make scan test cases more robust by allowing retries

These test caases depended on a single active scan round finding the AP.
It is possible for the Probe Response frame to get delayed sufficiently
to miss the response especially when testing under heavy load with
multiple parallel VMs. Allow couple of scan retries to avoid reporting
failures from these test cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Make P2PS join-a-group cases more robust
Jouni Malinen [Wed, 30 Dec 2015 17:14:40 +0000 (19:14 +0200)]
tests: Make P2PS join-a-group cases more robust

Use the group SSID (if known) when requesting a join operation. This
makes some of the P2PS test cases more robust in cases where previously
executed tests have added older groups into the cached scan results with
the same MAC addresses and an incorrect BSS could have been picked
previously.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Add an option to specify group SSID in P2P_CONNECT join case
Jouni Malinen [Wed, 30 Dec 2015 17:12:38 +0000 (19:12 +0200)]
P2P: Add an option to specify group SSID in P2P_CONNECT join case

The new optional ssid=<hexdump> argument to P2P_CONNECT can be used to
make P2P Client operations during join-an-existing-group more robust by
filtering out scan results based on the SSID in addition to the P2P
Device/Interface Address. This can help if the same MAC address has been
used in multiple groups recently and the cached scan results may still
include an older BSS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Provide group SSID, if specified, to P2P Client join step
Jouni Malinen [Wed, 30 Dec 2015 17:08:51 +0000 (19:08 +0200)]
P2P: Provide group SSID, if specified, to P2P Client join step

At least one of the wpas_p2p_connect() callers (NFC join case) already
had access to the Group SSID. Pass that information through
wpas_p2p_connect() to wpas_p2p_join() so that the join operation can
filter out incorrect groups more easily.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Do not accept any GO BSS entry if SSID is specified for join
Jouni Malinen [Wed, 30 Dec 2015 17:06:19 +0000 (19:06 +0200)]
P2P: Do not accept any GO BSS entry if SSID is specified for join

Accept only a BSS entry matching the SSID when trying to find the
operating channel of a GO during join operation for which the SSID was
already specified. Previously, it could have been possible to pick an
incorrect BSS entry if the new GO was not found in the latest scan and
there was an older cached scan entry for the same BSSID.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Use join SSID in the skip-PD cases
Jouni Malinen [Wed, 30 Dec 2015 17:04:43 +0000 (19:04 +0200)]
P2P: Use join SSID in the skip-PD cases

It was already possible to limit join operation to accept only a
specific SSID. However, this constraint was not used when starting a P2P
Client interface as a WPS Enrollee without going through a Provision
Discovery exchange.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Do not accept any BSS entry for join if SSID is already known
Jouni Malinen [Wed, 30 Dec 2015 17:02:33 +0000 (19:02 +0200)]
P2P: Do not accept any BSS entry for join if SSID is already known

Use wpa_bss_get() with the specific Group SSID instead of
wpa_bss_get_bssid_latest() if the SSID is already known. This makes the
P2P join operations more robust in case the frequency of the group was
not yet known and the same P2P Interface Address may have been used in
multiple group instances with an older group entry still present in the
cached scan results.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Use group SSID, if known, for join operation even if no BSS entry
Jouni Malinen [Wed, 30 Dec 2015 17:00:56 +0000 (19:00 +0200)]
P2P: Use group SSID, if known, for join operation even if no BSS entry

This allows the cases where a specific group SSID is known to filter out
groups on the P2P Client even if the specific BSS entry for the target
group is not yet available.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2PS: Add group SSID, if known, to the P2PS-PROV-DONE event
Jouni Malinen [Wed, 30 Dec 2015 16:59:03 +0000 (18:59 +0200)]
P2PS: Add group SSID, if known, to the P2PS-PROV-DONE event

The new optional group_ssid=<hexdump> argument in the P2PS-PROV-DONE
event can be used to help in identifying the exact group if there have
been multiple groups with the same P2P Interface Address in short period
of time.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Dump control interface sockets during FST operations
Jouni Malinen [Wed, 30 Dec 2015 11:54:18 +0000 (13:54 +0200)]
tests: Dump control interface sockets during FST operations

This makes it less likely to hit issues with running out of control
interface TX queue when running multiple FST test in a row. Number of
the FST operation sequences seemed to leave quite a few event messages
pending in one of the attached control interface sockets for wlan5 which
could result in test failure if the buffer space ran out and some of the
wpa_supplicant events were not delivered.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Use logger.info() instead of print in FST test cases
Jouni Malinen [Wed, 30 Dec 2015 11:40:58 +0000 (13:40 +0200)]
tests: Use logger.info() instead of print in FST test cases

It is better to get these messages into the actual debug log instead of
hoping they will be noticed from stdout.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clean up at the end of connect_cmd_disconnect_event
Jouni Malinen [Wed, 30 Dec 2015 11:29:32 +0000 (13:29 +0200)]
tests: Clean up at the end of connect_cmd_disconnect_event

This test case used to leave the dynamically added wlan5 interface in a
state where it was still trying to reconnect to a network. This could
result in the following test cases being unable to clear the cfg80211
scan cache. Avoid this type of issues by explicitly stopping the
connection attempt and making sure that there are no scan results in the
cache at the end of connect_cmd_disconnect_event.

The following test case sequence triggered a failure due to the
remaining BSS table entry:
connect_cmd_disconnect_event connect_cmd_wep ap_hs20_random_mac_addr

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Fix handling of Rx FST Setup Request when session already exists
Dedy Lansky [Tue, 29 Dec 2015 07:24:51 +0000 (09:24 +0200)]
FST: Fix handling of Rx FST Setup Request when session already exists

When we receive FST Setup Request when session already exists, the
following validations take place:
1. we drop the frame if needed according to MAC comparison
2. we drop the frame if the session is "not pending", i.e., if FST
   Setup Response was already exchanged (sent or received).

There are two issues with the above:
1. MAC comparison is relevant only before the Setup Response exchange.
   In other words, Setup Request should not be dropped due to MAC
   comparison after Setup Response has been exchanged.
2. Receiving Setup Request after Setup Response exchange most likely
   means that FST state machine is out of sync with the peer. Dropping
   the Setup Request will not help solve this situation.

The fix is:
1. do MAC comparison only if session is "pending", i.e., Setup Response
   was not yet exchanged.
2. In case Setup Response was already exchanged, reset our session and
   handle the Setup Request as if it arrived when session doesn't exist.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoTLS: Make tls_cert_chain_failure_event() more robust
Jouni Malinen [Mon, 28 Dec 2015 16:31:11 +0000 (18:31 +0200)]
TLS: Make tls_cert_chain_failure_event() more robust

Explicitly check for the failure event to include a certificate before
trying to build the event.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoTLS: Remove storing of never-read value
Jouni Malinen [Mon, 28 Dec 2015 16:15:18 +0000 (18:15 +0200)]
TLS: Remove storing of never-read value

While this could in theory be claimed to be ready for something to be
added to read a field following the server_write_IV, it does not look
likely that such a use case would show up. As such, just remove the
unused incrementing of pos at the end of the function to get rid of a
useless static analyzer complaint.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRemove unnecessary cleanup assignment in SHA1Final()
Jouni Malinen [Mon, 28 Dec 2015 16:12:03 +0000 (18:12 +0200)]
Remove unnecessary cleanup assignment in SHA1Final()

This makes some static analyzers complain about stored value never being
read. While it is good to clear some other temporary variables, this
local variable i has no security private information (it has a fixed
value of 20 here) and trying to clear it to 0 does not add any value.
Remove that part of the "wipe variables" to avoid one useless static
analyzer complaint.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clear ignore_old_scan_res explicitly in test cases where it is used
Jouni Malinen [Mon, 28 Dec 2015 15:48:01 +0000 (17:48 +0200)]
tests: Clear ignore_old_scan_res explicitly in test cases where it is used

This parameter is used only in couple of test cases and there is no need
to maintain the code to reset it in WpaSupplicant::reset().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clear p2p_pref_chan explicitly in test cases where it is used
Jouni Malinen [Mon, 28 Dec 2015 15:43:46 +0000 (17:43 +0200)]
tests: Clear p2p_pref_chan explicitly in test cases where it is used

This parameter is used only in couple of test cases and there is no need
to maintain the code to reset it in WpaSupplicant::reset().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clear p2p_go_intent explicitly in test cases where it is used
Jouni Malinen [Mon, 28 Dec 2015 15:40:25 +0000 (17:40 +0200)]
tests: Clear p2p_go_intent explicitly in test cases where it is used

This parameter is used only in couple of test cases and there is no need
to maintain the code to reset it in WpaSupplicant::reset().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clear p2p_add_cli_chan explicitly in test cases where it is used
Jouni Malinen [Mon, 28 Dec 2015 15:31:16 +0000 (17:31 +0200)]
tests: Clear p2p_add_cli_chan explicitly in test cases where it is used

This parameter is used only in couple of test cases and there is no need
to maintain the code to reset it in WpaSupplicant::reset().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clear p2p_no_go_freq explicitly in test cases where it is used
Jouni Malinen [Mon, 28 Dec 2015 15:26:20 +0000 (17:26 +0200)]
tests: Clear p2p_no_go_freq explicitly in test cases where it is used

This parameter is used only in couple of test cases and there is no need
to maintain the code to reset it in WpaSupplicant::reset().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Don't call linux_iface_up() for a dedicated P2P Device
Ilan Peer [Sun, 27 Dec 2015 12:36:11 +0000 (14:36 +0200)]
nl80211: Don't call linux_iface_up() for a dedicated P2P Device

As a dedicated P2P Device interface does not have a network
interface associated with it, trying to call linux_iface_up()
on it would always fail so this call can be skipped for
such an interface.

Getting interface nlmode can be done only after bss->wdev_id is
set, so move this call to wpa_driver_nl80211_finish_drv_init(),
and do it only in case the nlmode != NL80211_IFTYPE_P2P_DEVICE.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agomesh: Document Mesh Peering Management element structure in more detail
Jouni Malinen [Mon, 28 Dec 2015 14:25:10 +0000 (16:25 +0200)]
mesh: Document Mesh Peering Management element structure in more detail

Provide details on the pointers to the subfields and rename "pmk" to
"chosen_pmk" and use SAE_PMKID_LEN macro with it to make the code more
readable.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agomesh: Check PMKID in AMPE Action frames
Bob Copeland [Sun, 27 Dec 2015 02:20:52 +0000 (21:20 -0500)]
mesh: Check PMKID in AMPE Action frames

From IEEE Std 802.11-2012 13.3.5:

   If the incoming Mesh Peering Management frame is for AMPE and the
   Chosen PMK from the received frame contains a PMKID that does not
   identify a valid mesh PMKSA, the frame shall be silently discarded.

We were not checking the PMKID previously, and we also weren't parsing
it correctly, so fix both.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>