]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agoAdd TEST_FAIL() to aes_encrypt_init() with internal crypto
Jouni Malinen [Sat, 16 Mar 2019 16:45:51 +0000 (18:45 +0200)] 
Add TEST_FAIL() to aes_encrypt_init() with internal crypto

This is needed for the hwsim test cases ap_wpa2_eap_psk_oom and
ap_wpa2_eap_sim_oom.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoTLS: Add support for RFC 5705 TLS exporter context with internal TLS
Jouni Malinen [Sat, 16 Mar 2019 16:40:49 +0000 (18:40 +0200)] 
TLS: Add support for RFC 5705 TLS exporter context with internal TLS

Use the provided context, if any, to generate the seed for TLS PRF.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAdd support for an optional context parameter to TLS exporter
Ervin Oro [Mon, 11 Mar 2019 11:21:36 +0000 (13:21 +0200)] 
Add support for an optional context parameter to TLS exporter

Allow an additional context value to be passed to TLS exporter as
specified in RFC 5705 section 4.

This does not yet implement it for the internal TLS implementation.
However, as currently nothing uses context yet, this will not break
anything right now. WolfSSL maintainers also stated that they are not
going to add context support yet, but would look into it if/when this is
required by a published draft or a standard.

Signed-off-by: Ervin Oro <ervin.oro@aalto.fi>
5 years agotests: Python coding style cleanup (pylint3 bad-whitespace)
Jouni Malinen [Fri, 15 Mar 2019 10:10:37 +0000 (12:10 +0200)] 
tests: Python coding style cleanup (pylint3 bad-whitespace)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP and provisoning DPP and legacy AKMs
Jouni Malinen [Sat, 16 Mar 2019 15:27:09 +0000 (17:27 +0200)] 
tests: DPP and provisoning DPP and legacy AKMs

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Support new legacy+DPP config object credentials
Jouni Malinen [Sat, 16 Mar 2019 15:17:46 +0000 (17:17 +0200)] 
DPP2: Support new legacy+DPP config object credentials

This allows devices supporting DPP protocol version 2 or newer to
provision networks that enable both the legacy (PSK/SAE) and DPP
credentials.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Support DPP and SAE in the same network profile
Jouni Malinen [Sat, 16 Mar 2019 15:15:09 +0000 (17:15 +0200)] 
DPP: Support DPP and SAE in the same network profile

Make both DPP and SAE code aware of the cases where the same network
profile is configured to enable both DPP and SAE. Prefer DPP over SAE in
such cases and start DPP/SAE exchanges based on what both the station
and the AP support.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Clean up configuration parsing
Jouni Malinen [Sat, 16 Mar 2019 10:19:10 +0000 (12:19 +0200)] 
DPP: Clean up configuration parsing

Share a single parsing implementation for both hostapd and
wpa_supplicant to avoid code duplication. In addition, clean up the
implementation to be more easily extensible.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Use matching prefix for the ProxyARP IPv6 log files
Jouni Malinen [Fri, 15 Mar 2019 21:56:34 +0000 (23:56 +0200)] 
tests: Use matching prefix for the ProxyARP IPv6 log files

The "_ipv6" part of the file name was missing and this resulted in file
names that conflicted with the IPv4 test cases and could overwrite logs
for those.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Decode brctl showmacs output for the debug log
Jouni Malinen [Fri, 15 Mar 2019 21:53:27 +0000 (23:53 +0200)] 
tests: Decode brctl showmacs output for the debug log

This is needed with python3 to make the debug log more readable.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Remove unnecessary second wait from connect_cmd_reject_assoc
Jouni Malinen [Fri, 15 Mar 2019 20:42:18 +0000 (22:42 +0200)] 
tests: Remove unnecessary second wait from connect_cmd_reject_assoc

It does not look like there would be two CTRL-EVENT-ASSOC-REJECT events
here, so only check the first one instead of requiring both to be
received with status_code=27. This test case could fail based on the
second connection attempt (due to that extra event wait) timing out.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Make parallel-vm.py log easier to use for debugging failures
Jouni Malinen [Fri, 15 Mar 2019 19:08:10 +0000 (21:08 +0200)] 
tests: Make parallel-vm.py log easier to use for debugging failures

Print a list of full paths to log files from failed test cases both the
parallel.log and stdout so that they can be easily opened for analysis.
In addition, renumber the VM lines in the <timestamp>-parallel.log to
match the i+1 numbering used in the log directories and UI that is
tracking test execution.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Make ap_wpa2_eap_peap_params more robust
Jouni Malinen [Fri, 15 Mar 2019 11:49:25 +0000 (13:49 +0200)] 
tests: Make ap_wpa2_eap_peap_params more robust

One of the steps that expected failure due to PMKID mismatch did not
stop connection attempts. This could result in the following test step
failing due to the previous profile with peaplabel=1 getting used to
derive the MSK incorrectly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Clear pending monitor events before starting scan
Jouni Malinen [Fri, 15 Mar 2019 11:40:04 +0000 (13:40 +0200)] 
tests: Clear pending monitor events before starting scan

The wait_event() call for scan completion could have processed a
previously received event from a prior scan instead of the newly started
one. This could result in flush_scan_cache() assuming there are still
results in the cache even though the scan request to clear the cache had
not even be started yet.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: External radio work and DISCONNECT clearing connection attempt
Jouni Malinen [Fri, 15 Mar 2019 11:03:10 +0000 (13:03 +0200)] 
tests: External radio work and DISCONNECT clearing connection attempt

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRemove pending connect and sme-connect radio works on disconnect
Jouni Malinen [Fri, 15 Mar 2019 10:59:55 +0000 (12:59 +0200)] 
Remove pending connect and sme-connect radio works on disconnect

There was a race condition in a case where a new connection attempt was
scheduled as a pending radio work and that was followed by a DISCONNECT
command before the pending radio work is started. The pending radio work
would not have been deleted in that sequence and instead, it was
executed when the radio became available next. This could result in an
unexpected connection after an explicit request to disconnect.

Fix this by removing pending connect and sme-connect radio works on
disconnection request.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Python coding style cleanup (pylint3 unneeded-not)
Jouni Malinen [Fri, 15 Mar 2019 09:34:32 +0000 (11:34 +0200)] 
tests: Python coding style cleanup (pylint3 unneeded-not)

Use more readable "foo not in bar" construction for the couple of places
that did "not foo in bar".

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix run-tests.py module file (-l) handling
Jouni Malinen [Fri, 15 Mar 2019 09:18:20 +0000 (11:18 +0200)] 
tests: Fix run-tests.py module file (-l) handling

Prior cleanup broke the indentation here and made the addition of test
cases unreachable.

Fixes: 0663ae22ffc7 ("tests: Do not use tabs for indentation")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Fix build with OpenSSL 1.0.2
Jouni Malinen [Thu, 14 Mar 2019 22:33:33 +0000 (00:33 +0200)] 
OpenSSL: Fix build with OpenSSL 1.0.2

X509_get_subject_name() in OpenSSL 1.0.2 does not mark its argument as a
const pointer, so need to type cast this to avoid a build warning.

Fixes: 841205a1ceb1 ("OpenSSL: Add 'check_cert_subject' support for TLS server")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE anti-clogging request with mesh BSS
Jouni Malinen [Thu, 14 Mar 2019 22:12:05 +0000 (00:12 +0200)] 
tests: SAE anti-clogging request with mesh BSS

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Reduce queue wait time for pending Authentication frames
Jouni Malinen [Thu, 14 Mar 2019 22:08:37 +0000 (00:08 +0200)] 
SAE: Reduce queue wait time for pending Authentication frames

The queue_len * 50 ms wait time was too large with the retransmission
timeouts used in the mesh case for SAE. The maximum wait of 750 ms was
enough to prevent successful completion of authentication after having
hit the maximum queue length. While the previous commit is enough to
allow this to complete successfully in couple of retries, it looks like
a smaller wait time should be used here even if it means potentially
using more CPU.

Drop the processing wait time to queue_len * 10 ms so that the maximum
wait time is 150 ms if the queue is full.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Improved queuing policy for pending authentication frames
Jouni Malinen [Thu, 14 Mar 2019 22:03:29 +0000 (00:03 +0200)] 
SAE: Improved queuing policy for pending authentication frames

The previous design of simply queuing all SAE commit messages was not
exactly good at allowing recovery from a flooding state if the valid
peer used frequent retransmissions of the SAE message. This could
happen, e.g., with mesh BSSs using SAE. The frequent retransmissions and
restarts of SAE authentication combined with SAE confirm messages
bypassing the queue ended up in not being able to finish SAE exchange
successfully.

Fix this by modifying the queuing policy to queue SAE confirm messages
if there is a queued SAE commit message from the same peer so that the
messages within the same exchange do not get reordered. In addition,
replace queued SAE commit/confirm message if a new matching message is
received from the same peer STA. This is useful for the case where the
peer restarts SAE more quickly than the local end has time to process
the queued messages.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP and Enrollee rejecting Config Object
Jouni Malinen [Thu, 14 Mar 2019 15:26:09 +0000 (17:26 +0200)] 
tests: DPP and Enrollee rejecting Config Object

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Testing option for Config Object rejction
Jouni Malinen [Thu, 14 Mar 2019 15:08:44 +0000 (17:08 +0200)] 
DPP2: Testing option for Config Object rejction

Add a new testing option to force Enrollee to reject the receive Config
Object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Configuration Result message generation and processing
Jouni Malinen [Thu, 14 Mar 2019 15:05:02 +0000 (17:05 +0200)] 
DPP2: Configuration Result message generation and processing

Use this new message from Enrollee to Configurator to indicate result of
the config object provisioning if both devices support protocol version
2 or newer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP test cases to handle new behavior due to config result
Jouni Malinen [Thu, 14 Mar 2019 18:46:37 +0000 (20:46 +0200)] 
tests: DPP test cases to handle new behavior due to config result

The new DPP Configuration Result message can result in a bit different
behavior at the end of the configuration exchange and some of the test
cases need more flexibility to work with that DPP2 behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Make DPP version number support available over control interface
Jouni Malinen [Thu, 14 Mar 2019 18:45:36 +0000 (20:45 +0200)] 
DPP2: Make DPP version number support available over control interface

"GET_CAPABILITY dpp" can now be used to determine which version number
of DPP is supported in the build.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix dpp_qr_code_auth_initiator_enrollee to clear gas_address3
Jouni Malinen [Wed, 13 Mar 2019 22:13:35 +0000 (00:13 +0200)] 
tests: Fix dpp_qr_code_auth_initiator_enrollee to clear gas_address3

gas_address3 was set to 1 in this test case, but it was never cleared.
That can result in unexpected behavior in other test cases that dpeends
on gas_address3 being in its default value 0. Clear the parameter
explicitly to avoid this.

This resulted in an error in the following test sequence:
dpp_qr_code_auth_initiator_enrollee gas_anqp_address3_ap_forced

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Make WNM test case scan clearing more robust
Jouni Malinen [Wed, 13 Mar 2019 21:32:31 +0000 (23:32 +0200)] 
tests: Make WNM test case scan clearing more robust

There was a race condition on starting the flush_scan_cache() operations
if a scan happened to be in progress when the test case ended since the
ABORT_SCAN success case did not wait for the pending scan operation to
be completed. Wait for the scan completion event in addition to the
disconnection event if the ABORT_SCAN command is accepted.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoMore robust timer_tick_enabled tracking
Jouni Malinen [Wed, 13 Mar 2019 21:25:21 +0000 (23:25 +0200)] 
More robust timer_tick_enabled tracking

Do not set sm->timer_tick_enabled if the eloop_register_timeout() call
fails so that the next attempt to enable the timer in
eapol_enable_timer_tick() can try to recover from unexpected eloop
failures. This should not really be needed in practical use cases, but
certain out-of-memory test cases can trigger allocation failure in
eloop_register_timeout() and if that happens, the previous EAPOL
supplicant state machine implementation got pretty much completely stuck
for any operation needing the timer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Make TDLS test case scan clearing more robust
Jouni Malinen [Wed, 13 Mar 2019 19:05:15 +0000 (21:05 +0200)] 
tests: Make TDLS test case scan clearing more robust

There was a race condition on starting the flush_scan_cache() operations
if a scan happened to be in progress when the test case ended since the
ABORT_SCAN success case did not wait for the pending scan operation to
be completed. Wait for the scan completion event in addition to the
disconnection event if the ABORT_SCAN command is accepted.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Decode station dump output to restore pre-python3 behavior
Jouni Malinen [Wed, 13 Mar 2019 18:40:31 +0000 (20:40 +0200)] 
tests: Decode station dump output to restore pre-python3 behavior

These TDLS test cases missed Popen() result decode() calls in the
earlier python3 compatibility changes. Add those to make debug log more
readable.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Make DPP protocol failure testing more robust
Jouni Malinen [Wed, 13 Mar 2019 17:40:50 +0000 (19:40 +0200)] 
tests: Make DPP protocol failure testing more robust

Wait explicitly for the DPP-NOT-COMPATIBLE event when going through
protocol testing with local failures instead of just waiting for a fixed
0.1 second duration. This prevents a test failure at least in
dppauth_resp_status_failure in a case where the failing operation may be
delayed under heavy CPU load.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Clear scan results from dev5 in WPS testing
Jouni Malinen [Wed, 13 Mar 2019 17:27:21 +0000 (19:27 +0200)] 
tests: Clear scan results from dev5 in WPS testing

Test case sequence "ap_wps_ap_scan_2 ap_wps_pbc_2ap" resulted in a
failure due to a scan entry being left behind from the first test case
and the second one ending up using that obsolete result during WPS_PBC
processing. Fix this by clearing the scan results explicitly on dev5.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFILS+FT: STA mode validation of PMKR1Name in initial MD association
Jouni Malinen [Wed, 13 Mar 2019 17:13:49 +0000 (19:13 +0200)] 
FILS+FT: STA mode validation of PMKR1Name in initial MD association

Verify that the AP uses matching PMKR1Name in (Re)Association Response
frame when going through FT initial mobility domain association using
FILS. Thise step was missing from the initial implementation, but is
needed to match the IEEE 802.11ai requirements for explicit confirmation
of the FT key hierarchy (similarly to what is done in FT 4-way handshake
when FILS is not used).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFILS+FT: AP mode processing of PMKR1Name in initial MD association
Jouni Malinen [Wed, 13 Mar 2019 15:24:29 +0000 (17:24 +0200)] 
FILS+FT: AP mode processing of PMKR1Name in initial MD association

Derive PMKR1Name during the FILS authentication step, verify that the
station uses matching PMKR1Name in (Re)Association Request frame, and
add RSNE[PMKR1Name] into (Re)Association Response frame when going
through FT initial mobility domain association using FILS. These steps
were missed from the initial implementation, but are needed to match the
IEEE 802.11ai requirements for explicit confirmation of the FT key
hierarchy (similarly to what is done in FT 4-way handshake when FILS is
not used).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFILS: Do not try to add PMKSA cache entry if caching is disabled
Jouni Malinen [Wed, 13 Mar 2019 14:34:48 +0000 (16:34 +0200)] 
FILS: Do not try to add PMKSA cache entry if caching is disabled

This gets rid of a confusing error message "FILS: Failed to add PMKSA
cache entry based on ERP" for cases where PMKSA caching is disabled in
hostapd (disable_pmksa_caching=1). Functionality remains unchanged,
i.e., no cache entry was added before this change either.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to enable or disable TWT request support
Arif Hussain [Tue, 12 Mar 2019 21:59:48 +0000 (14:59 -0700)] 
Vendor attribute to enable or disable TWT request support

Add a new QCA vendor attribute for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Clear keys from heap memory before freeing it for get_seqnum
vamsi krishna [Wed, 13 Mar 2019 07:03:17 +0000 (12:33 +0530)] 
nl80211: Clear keys from heap memory before freeing it for get_seqnum

NL80211_CMD_GET_KEY response may return the actual key in addition to
the last used sequence number that we need. That might result in a key
being left in unused heap memory after the buffer is freed.

Explicitly clear the message payload with the possibly included key
material from heap memory before returning from the handler function
(and having libnl free the nlmsg) when key information is obtained from
the driver using the NL80211_CMD_GET_KEY command.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoP2P: Fix ACS offloading behavior with p2p_no_group_iface=1
Jayachandran Sreekumaran [Fri, 8 Mar 2019 10:30:56 +0000 (16:00 +0530)] 
P2P: Fix ACS offloading behavior with p2p_no_group_iface=1

wpa_s->p2p_go_do_acs was not cleared during P2P group deletion and that
resulted in the case of no separate group interface continuing to assume
ACS was to be used for consecutive GO starts even if they tried to
specify a frequency. Fix this by explicitly clearing
wpa_s->p2p_go_do_acs during P2P group deletion and also clear this when
processing the P2P_GROUP_ADD if the parameters do not request ACS to be
used.

Fixes: 37ed3254de22 ("P2P: ACS offload for the autonomous GO")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Exclude PMK when sending NL80211_CMD_DEL_PMKSA explicitly
vamsi krishna [Wed, 13 Mar 2019 07:43:38 +0000 (13:13 +0530)] 
nl80211: Exclude PMK when sending NL80211_CMD_DEL_PMKSA explicitly

Add a check in nl80211 driver layer to not include PMK while sending
NL80211_CMD_DEL_PMKSA explicitly. Though it is taken care already in
supplicant layer by setting the pmk_len to zero, it would be good
to have a check in nl80211 layer in order to avoid future accidental
inclusions of keying material in commands that do not need them.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP and duplicated Authentication Response
Jouni Malinen [Wed, 13 Mar 2019 11:00:33 +0000 (13:00 +0200)] 
tests: DPP and duplicated Authentication Response

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Protocol version indication
Jouni Malinen [Wed, 13 Mar 2019 10:18:01 +0000 (12:18 +0200)] 
DPP2: Protocol version indication

Send out the new Protocol Version attribute in Authentication
Request/Response messages and determine the peer version based on this
attribute.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Build configuration flags for DPP version 2 support
Jouni Malinen [Wed, 13 Mar 2019 10:00:09 +0000 (12:00 +0200)] 
DPP2: Build configuration flags for DPP version 2 support

The new CONFIG_DPP2=y build option for hostapd and wpa_supplicant is
used to control whether new functionality defined after the DPP
specification v1.0 is included. All such functionality are considered
experimental and subject to change without notice and as such, not
suitable for production use.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Make sae_anti_clogging_during_attack more robust
Jouni Malinen [Tue, 12 Mar 2019 15:31:40 +0000 (17:31 +0200)] 
tests: Make sae_anti_clogging_during_attack more robust

Accept a smaller number of token responses in second round to avoid
failing this test case as frequently.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Disable fragm/rts_threshold after testing it
Jouni Malinen [Tue, 12 Mar 2019 15:18:38 +0000 (17:18 +0200)] 
tests: Disable fragm/rts_threshold after testing it

The configurated fragmentation/RTS threshold value survives AP mode
interface restarts, so these values need to be explicitly cleared back
to default (disabled). This fixes an issue where some test cases could
not work correctly if fragmentation on the interface was enabled. For
example, this combination used to fail:
ap_fragmentation_open ap_hs20_fetch_osu

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAllow fragmentation/RTS threshold to be disabled explicitly
Jouni Malinen [Tue, 12 Mar 2019 15:15:08 +0000 (17:15 +0200)] 
Allow fragmentation/RTS threshold to be disabled explicitly

hostapd configuration parameters fragm_threshold and rts_threshold were
documented to disable the threshold with value -1 and not change driver
configuration if the parameter is not included. However, -1 was mapped
into not changing the driver value, so the explicit disabling part did
not work.

Replace the default values for these to be -2 so that explicitly set
configuration value -1 can be distinguished from the case of not
including the parameter. Map the -1 value to a driver request to disable
the threshold. Ignore any error from this operation just in case to
avoid breaking functionality should some drivers not accept the (u32) -1
value as a threshold value request to disable the mechanism.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix scan_specific_bssid in case Beacon frame is seen
Jouni Malinen [Tue, 12 Mar 2019 14:36:46 +0000 (16:36 +0200)] 
tests: Fix scan_specific_bssid in case Beacon frame is seen

The first scan for the unknown BSSID could have been timed in a manner
that allows passive scanning to find the real AP even if that AP's
beacon interval was 1000 (e.g., heavy CPU load changed timing so that
the AP beaconing started at suitable time). The check for BSS result
entry not including Probe Response frame was comparing incorrect BSS
entries (bss2 vs. bss1) which resulted in the test case claiming failure
even when there was no unexpected Probe Response frame.

Fix this by comparing the beacon_ie and ie parameters from the same BSS
entry (bss1).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Make AP discovery more robust in eap_proto test cases
Jouni Malinen [Tue, 12 Mar 2019 14:24:15 +0000 (16:24 +0200)] 
tests: Make AP discovery more robust in eap_proto test cases

Number of these test cases start connection attempt in wpa_supplicant
and then expected a specific failure to happen relatively quickly. This
could result in timeouts if the first scanning round missed to find the
AP (e.g., due to CPU load pushing out the Probe Response frame long
enough for the station having left the channel) and wpa_supplicant then
waiting five seconds before starting a new scan.

Make this more robust by scanning explicitly for the specific BSSID
before starting the connection attempt.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd a vendor subcommand QCA_NL80211_VENDOR_SUBCMD_MPTA_HELPER_CONFIG
stonez [Wed, 6 Mar 2019 06:17:53 +0000 (14:17 +0800)] 
Add a vendor subcommand QCA_NL80211_VENDOR_SUBCMD_MPTA_HELPER_CONFIG

This subcommand is used to update Zigbee state and specified WLAN
durations to enhance success ratio of Zigbee joining network. The
attributes defined in enum qca_mpta_helper_vendor_attr are used to
deliver these parameters to the driver.

Signed-off-by: stonez <stonez@codeaurora.org>
5 years agoAdd QCA vendor command/event and attributes for peer rate statistics
Amir Patel [Fri, 1 Mar 2019 11:13:35 +0000 (16:43 +0530)] 
Add QCA vendor command/event and attributes for peer rate statistics

Peer rate statistics is per-peer cached data in the driver. These
statistics needs to be flushed to a user space application on
synchronous/asynchronous events. This command is used as an event from
the driver to flush per-peer cached statistics to the application.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE group negotiation (no match)
Jouni Malinen [Mon, 11 Mar 2019 13:41:27 +0000 (15:41 +0200)] 
tests: SAE group negotiation (no match)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Mon, 11 Mar 2019 22:23:45 +0000 (00:23 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2019-01-25.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: check_cert_subject
Jouni Malinen [Mon, 11 Mar 2019 11:54:30 +0000 (13:54 +0200)] 
tests: check_cert_subject

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Add 'check_cert_subject' support for TLS server
Jared Bents [Thu, 28 Feb 2019 19:39:50 +0000 (13:39 -0600)] 
OpenSSL: Add 'check_cert_subject' support for TLS server

This patch added 'check_cert_subject' support to match the value of
every field against the DN of the subject in the client certificate. If
the values do not match, the certificate verification will fail and will
reject the user.

This option allows hostapd to match every individual field in the right
order, also allow '*' character as a wildcard (e.g OU=Development*).

Note: hostapd will match string up to 'wildcard' against the DN of the
subject in the client certificate for every individual field.

Signed-off-by: Paresh Chaudhary <paresh.chaudhary@rockwellcollins.com>
Signed-off-by: Jared Bents <jared.bents@rockwellcollins.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUse char pointers for EAP configuration parameters without length
Jouni Malinen [Mon, 11 Mar 2019 11:17:29 +0000 (13:17 +0200)] 
Use char pointers for EAP configuration parameters without length

These parameters were using the u8*/len style types even though they
were used as char* strings without an explicit length field. Make this
char* instead of u8* to avoid confusion and unnecessary type casting.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRemove forgotten os_strncpy() implementations
Jouni Malinen [Sun, 10 Mar 2019 13:55:46 +0000 (15:55 +0200)] 
Remove forgotten os_strncpy() implementations

This was replaced with os_strlcpy() long time ago.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoroboswitch: Check some read operation results
Jouni Malinen [Sat, 9 Mar 2019 16:56:48 +0000 (18:56 +0200)] 
roboswitch: Check some read operation results

This gets rid of some static analyzer warnings about uninitialized
variables being used in comparisons or write operations.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomesh: Check that SAE state initialization succeeded for PMKID check
Jouni Malinen [Sat, 9 Mar 2019 16:55:58 +0000 (18:55 +0200)] 
mesh: Check that SAE state initialization succeeded for PMKID check

mesh_rsn_auth_sae_sta() might fail, so verify that sta->sae got
allocated before dereferencing it for a PMKID check.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodefconfig: Enable DBus
Lubomir Rintel [Tue, 19 Feb 2019 13:44:08 +0000 (14:44 +0100)] 
defconfig: Enable DBus

Acquire the new name, along with introspection. This is generally useful
for other daemons to integrate with wpa_supplicant, notably
NetworkManager.

Debian and Fedora (and likely any other distro that configured wireless
via NetworkManager) enable this.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agowpa_supplicant: Drop the old D-Bus interface support
Lubomir Rintel [Tue, 26 Feb 2019 11:04:36 +0000 (12:04 +0100)] 
wpa_supplicant: Drop the old D-Bus interface support

This drops support for the fi.epitest.hostap.WPASupplicant D-Bus name
along with the associated CONFIG_CTRL_IFACE_DBUS option. Nothing should
really be using this since 2010.

This is a just a straightforward removal. Perhaps the dbus_common.c and
dbus_new.c can be merged now. Also, the "_NEW" suffix of the config
option seems to make even less sense than it used to.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agotests: Drop testing of the old D-Bus interface
Lubomir Rintel [Tue, 26 Feb 2019 11:04:36 +0000 (12:04 +0100)] 
tests: Drop testing of the old D-Bus interface

This old interface has been obsoleted and should not have been used
since 2010, so remove testing for it in preparation to dropping the
interface completely from wpa_supplicant.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agotests: Use a helper function for DPP_BOOTSTRAP_GEN commands
Jouni Malinen [Sat, 9 Mar 2019 16:13:10 +0000 (18:13 +0200)] 
tests: Use a helper function for DPP_BOOTSTRAP_GEN commands

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Use a helper function for DPP_QR_CODE commands
Jouni Malinen [Sat, 9 Mar 2019 14:50:48 +0000 (16:50 +0200)] 
tests: Use a helper function for DPP_QR_CODE commands

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: DPP provisioning updating wpa_supplicant configuration file
Jouni Malinen [Sat, 9 Mar 2019 14:23:04 +0000 (16:23 +0200)] 
tests: DPP provisioning updating wpa_supplicant configuration file

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDPP: Update wpa_supplicant configuration file after provisioning
Jouni Malinen [Sat, 9 Mar 2019 14:21:54 +0000 (16:21 +0200)] 
DPP: Update wpa_supplicant configuration file after provisioning

WPS was already doing this if update_config=1 was set and DPP should be
consistent with that behavior. Update the configuration file if
update_config=1 and dpp_config_processing is set to 1 or 2.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoClarify AP mode Action frame handling
Jouni Malinen [Sat, 9 Mar 2019 10:51:34 +0000 (12:51 +0200)] 
Clarify AP mode Action frame handling

Include only one of hostapd_mgmt_rx() and hostapd_action_rx() functions
in the build. Previously, NEED_AP_MLME builds (i.e., cases where hostapd
AP MLME implementation is included) included both of these functions and
both were tried in sequence. In addition to being difficult to
understand, that could result in unexpected behavior if
hostapd_mgmt_rx() rejected a frame and return 0 to allow
hostapd_action_rx() to attempt to process the frame.

All the operations included in hostapd_action_rx() are supposed to be
available through the hostapd_mgmt_rx() call in handle_action() and
those should result in the exact same Category/Action-based handler
function to be called in the end. As such, this should not result in
different behavior. And if there is a difference, that would be pointing
at a hidden bug that would need to be fixed anyway. Furthermore, builds
without NEED_AP_MLME would not have any difference in behavior or
contents of the binary either.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoMinor cleanup to return after WNM Action frame handling
Jouni Malinen [Sat, 9 Mar 2019 10:43:20 +0000 (12:43 +0200)] 
Minor cleanup to return after WNM Action frame handling

There is no need to go through the following handler calls in
hostapd_action_rx() after having found the matching WLAN_ACTION_WNM
handler.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoMove SA Query frame length check to the shared handler function
Jouni Malinen [Sat, 9 Mar 2019 10:40:05 +0000 (12:40 +0200)] 
Move SA Query frame length check to the shared handler function

Check the length in the common handler functions instead of both
callers.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFix AP MLME in driver handling of FT and SA Query Action frames
Jouni Malinen [Sat, 9 Mar 2019 10:21:27 +0000 (12:21 +0200)] 
Fix AP MLME in driver handling of FT and SA Query Action frames

hostapd_action_rx() was pointing at incorrect field (Action vs.
Category) for the wpa_ft_action_rx() call and the length check for SA
Query Action frames. This resulted in those frames getting dropped as
invalid (FT) or ignored as truncated (SA Query). Fix this by pointing to
the correct place at the beginning of the frame body.

This issue had a long history. These were broken during cleanup in
commit dbfb8e82ff69 ("Remove unnecessary EVENT_RX_ACTION") which
actually fixed the initial reason for the error accidentally. It was
just that that error was needed to cancel out another earlier error..

One of the errors came from misuse of the EVENT_RX_ACTION API in commit
deca6eff7441 ("atheros: Add new IEEE 802.11r driver_ops"). That pointed
struct rx_action data/len to cover the Action frame from the Category
field to the end of the frame body while the API was documented to cover
Action field to the end of the frame body. This error was cancelled by
another error in commit 88b32a99d308 ("FT: Add FT AP support for drivers
that manage MLME internally") that called wpa_ft_action_rx() with the
struct rx_action::data field as the second argument. That argument needs
to point to the Category field, but that struct rx_action field was
supposed to point to the Action field.

Number of the Action frame handlers added into hostapd_action_rx() had
been fixed more or less accidentally after this in various other
commits, but the FT and SA Query handlers had ended up maintaining the
incorrect operations. This is now fixing those.

This seems to fix at least some cases of FT-over-DS with drivers that
use driver-based AP MLME. Such drivers might use internal SA Query
processing, so it is not clear whether that part actually fixes any real
issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Add wlantest description for ap_ft_pmf_*_over_ds
Jouni Malinen [Sat, 9 Mar 2019 09:37:02 +0000 (11:37 +0200)] 
tests: Add wlantest description for ap_ft_pmf_*_over_ds

This is convenient to allow easier examination of the FT Action frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Use run_ap_ft_pmf_bip_over_ds() for ap_ft_pmf_over_ds
Jouni Malinen [Sat, 9 Mar 2019 09:33:49 +0000 (11:33 +0200)] 
tests: Use run_ap_ft_pmf_bip_over_ds() for ap_ft_pmf_over_ds

No need to duplicate this functionality when all the ap_ft_pmf_*_over_ds
test cases are doing practically the same thing and the
no-specific-cipher-configuration case can be addressed easily with the
same helper function.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Fix ap_ft_pmf_over_ds
Jouni Malinen [Sat, 9 Mar 2019 09:26:38 +0000 (11:26 +0200)] 
tests: Fix ap_ft_pmf_over_ds

The main step of the test case was accidentally removed when adding the
cipher specific versions.

Fixes: ffcaca68d3ed ("tests: FT with different BIP algorithms")
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-pwd server: Fix memory leak with salted passwords
Masashi Honma [Sun, 3 Mar 2019 00:52:22 +0000 (09:52 +0900)] 
EAP-pwd server: Fix memory leak with salted passwords

The struct hostapd_eap_user changes with a new allocated variable were
not covered in the RADIUS server code. Fix this by using eap_user_free()
instead of custom memory freeing operation in radius_server.c.

The hwsim tests with salted password (ap_wpa2_eap_pwd_salt_sha1,
ap_wpa2_eap_pwd_salt_sha256, ap_wpa2_eap_pwd_salt_sha512) triggered
these memory leaks.

Fixes: d52ead3db7b2 ("EAP-pwd server: Add support for salted password databases")
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Report authentication server memory leaks more visible
Jouni Malinen [Fri, 8 Mar 2019 14:52:52 +0000 (16:52 +0200)] 
tests: Report authentication server memory leaks more visible

It was too easy to miss memory leaks in the hostapd-as-AS log.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Add Finite Cyclic Group field in status code 77 response
Jouni Malinen [Fri, 8 Mar 2019 14:21:03 +0000 (16:21 +0200)] 
SAE: Add Finite Cyclic Group field in status code 77 response

Copy the Finite Cyclic Group field value from the request to the
response Authentication frame if we end up rejecting the request due to
unsupported group.

IEEE Std 802.11-2016 has conflicting statements about this behavior.
Table 9-36 (Presence of fields and elements in Authentication frames)
indicates that the Finite Cyclic Group field is only included with
status code values 0 (success) and 76 (anti-clogging token request)
while SAE protocol description implying that the Finite Cyclic Group
field is set to the rejected group (12.4.8.6.3 and 12.4.8.6.4).

The standard language needs to cleaned up to describe this
unambiguously, but since it looks safe to add the field into the
rejection case and since there is desire to have the field present to be
able to implement what exactly is stated in 12.4.8.6.4, it looks
reasonable to move ahead with the AP mode implementation change. There
is no change in wpa_supplicant for now to modify its behavior based on
whether this field is present, i.e., wpa_supplicant will continue to
work with both the old and new hostapd behavior for SAE group
negotiation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAP-pwd: Fix a memory leak in hunting-and-pecking loop
Jouni Malinen [Wed, 6 Mar 2019 22:27:12 +0000 (00:27 +0200)] 
EAP-pwd: Fix a memory leak in hunting-and-pecking loop

tmp2 (y^2) was derived once in each iteration of the loop and only freed
after all the loop iterations. Fix this by freeing the temporary value
during each iteration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: WPS with PSK+SAE
Jouni Malinen [Wed, 6 Mar 2019 19:45:19 +0000 (21:45 +0200)] 
tests: WPS with PSK+SAE

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS: Allow SAE configuration to be added automatically for PSK
Jouni Malinen [Wed, 6 Mar 2019 19:44:06 +0000 (21:44 +0200)] 
WPS: Allow SAE configuration to be added automatically for PSK

The new wpa_supplicant configuration parameter wps_cred_add_sae=1 can be
used to request wpa_supplicant to add SAE configuration whenever WPS is
used to provision WPA2-PSK credentials and the credential includes a
passphrase (instead of PSK). This can be used to enable WPA3-Personal
transition mode with both SAE and PSK enabled and also with PMF enabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS: Allow AP SAE configuration to be added automatically for PSK
Jouni Malinen [Wed, 6 Mar 2019 19:41:44 +0000 (21:41 +0200)] 
WPS: Allow AP SAE configuration to be added automatically for PSK

The new hostapd configuration parameter wps_cred_add_sae=1 can be used
to request hostapd to add SAE configuration whenever WPS is used to
configure the AP to use WPA2-PSK and the credential includes a
passphrase (instead of PSK). This can be used to enable WPA3-Personal
transition mode with both SAE and PSK enabled and PMF enabled for PSK
and required for SAE associations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor feature capability for TWT (Target Wake Time)
Sunil Dutt [Thu, 28 Feb 2019 09:04:04 +0000 (14:34 +0530)] 
Vendor feature capability for TWT (Target Wake Time)

Add a new QCA vendor specific feature capability indication for the
device to indicate the support of TWT.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to indicate a set_blacklist of BSSID only as a hint
Sunil Dutt [Thu, 28 Feb 2019 09:39:29 +0000 (15:09 +0530)] 
Vendor attribute to indicate a set_blacklist of BSSID only as a hint

The current/default behavior of set blacklist BSSID QCA vendor command
is a mandate to the driver - do not consider this BSSID for connect/roam
till reset.

There are use cases where this need not be a mandate and thus could
provide the flexibility for the driver to consider this BSSID if there
are no better ones. Such use cases can use this new flag attribute to
only hint the blacklist of a BSSID to the driver.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to configure HE testbed default capabilities
Kiran Kumar Lokere [Thu, 28 Feb 2019 01:40:51 +0000 (17:40 -0800)] 
Vendor attribute to configure HE testbed default capabilities

Add a new QCA vendor attribute for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to configure support to enable VHT in 2.4G band
Kiran Kumar Lokere [Wed, 6 Feb 2019 01:04:24 +0000 (17:04 -0800)] 
Vendor attribute to configure support to enable VHT in 2.4G band

Add a new QCA vendor attribute for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to configure HE OMI UL MU data disable
Kiran Kumar Lokere [Wed, 6 Feb 2019 00:59:27 +0000 (16:59 -0800)] 
Vendor attribute to configure HE OMI UL MU data disable

Add a new QCA vendor attribute for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE anti clogging during an attack
Jouni Malinen [Sun, 3 Mar 2019 15:10:40 +0000 (17:10 +0200)] 
tests: SAE anti clogging during an attack

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Reuse previously generated PWE on a retry with the same STA
Jouni Malinen [Sun, 3 Mar 2019 14:56:14 +0000 (16:56 +0200)] 
SAE: Reuse previously generated PWE on a retry with the same STA

Do not start SAE authentication from scratch if a STA starts a new
attempt for the same group while we still have previously generated PWE
available. Instead, use the previously generated PWE as-is and skip
anti-clogging token exchange since the heavy processing is already
completed. This saves unnecessary processing on the AP side in case the
STA failed to complete authentication on the first attempt (e.g., due to
heavy SAE load on the AP causing a timeout) and makes it more likely for
a valid STA to be able to complete SAE authentication during a DoS
attack.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Reuse previously generated PWE on a retry with the same AP
Jouni Malinen [Sun, 3 Mar 2019 14:23:19 +0000 (16:23 +0200)] 
SAE: Reuse previously generated PWE on a retry with the same AP

Do not start SAE authentication from scratch when the AP requests
anti-clogging token to be used. Instead, use the previously generated
PWE as-is if the retry is for the same AP and the same group. This saves
unnecessary processing on the station side in case the AP is under heavy
SAE authentiation load.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Enforce single use for anti-clogging tokens
Jouni Malinen [Fri, 1 Mar 2019 20:05:52 +0000 (22:05 +0200)] 
SAE: Enforce single use for anti-clogging tokens

Add a 16-bit token index into the anti-clogging token. This can be used
to enforce only a single use of each issued anti-clogging token request.
The token value is now token-index |
last-30-octets-of(HMAC-SHA256(sae_token_key, STA-MAC-address |
token-index)), i.e., the first two octets of the SHA256 hash value are
replaced with the token-index and token-index itself is protected as
part of the HMAC context data.

Track the used 16-bit token index values and accept received tokens only
if they use an index value that has been requested, but has not yet been
used. This makes it a bit more difficult for an attacker to perform DoS
attacks against the heavy CPU operations needed for processing SAE
commit since the attacker cannot simply replay the same frame multiple
times and instead, needs to request each token separately.

While this does not add significant extra processing/CPU need for the
attacker, this can be helpful in combination with the queued processing
of SAE commit messages in enforcing more delay during flooding of SAE
commit messages since the new anti-clogging token values are not
returned before the new message goes through the processing queue.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Process received commit message through a queue
Jouni Malinen [Fri, 1 Mar 2019 17:54:51 +0000 (19:54 +0200)] 
SAE: Process received commit message through a queue

This allows better control of processing new SAE sessions so that other
operations can be given higher priority during bursts of SAE requests,
e.g., during a potential DoS attack. The receive commit messages are
queued (up to maximum of 15 entries) and processed from eloop callback.
If the queue has multiple pending entries, more wait time is used to go
through the each new entry to reduce heavy CPU load from SAE processing.

Enable anti-clogging token use also based on the pending commit message
queue and not only based on the already started sessions.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: More complete group list for sae_groups
Jouni Malinen [Wed, 6 Mar 2019 11:05:23 +0000 (13:05 +0200)] 
tests: More complete group list for sae_groups

Add group 1 for completeness sake and also and Brainpool groups with
OpenSSL 1.1.*.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Enable only groups 19, 20, and 21 in station mode
Jouni Malinen [Tue, 5 Mar 2019 15:23:58 +0000 (17:23 +0200)] 
SAE: Enable only groups 19, 20, and 21 in station mode

Remove groups 25 (192-bit Random ECP Group) and 26 (224-bit Random ECP
Group) from the default SAE groups in station mode since those groups
are not as strong as the mandatory group 19 (NIST P-256).

In addition, add a warning about MODP groups 1, 2, 5, 22, 23, and 24
based on "MUST NOT" or "SHOULD NOT" categorization in RFC 8247. All the
MODP groups were already disabled by default and would have needed
explicit configuration to be allowed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Enable only group 19 by default in AP mode
Jouni Malinen [Tue, 5 Mar 2019 15:18:11 +0000 (17:18 +0200)] 
SAE: Enable only group 19 by default in AP mode

Change the AP mode default for SAE to enable only the group 19 instead
of enabling all ECC groups that are supported by the used crypto library
and the SAE implementations. The main reason for this is to avoid
enabling groups that are not as strong as the mandatory-to-support group
19 (i.e., groups 25 and 26). In addition, this disables heavier groups
by default.

In addition, add a warning about MODP groups 1, 2, 5, 22, 23, and 24
based on "MUST NOT" or "SHOULD NOT" categorization in RFC 8247. All the
MODP groups were already disabled by default and would have needed
explicit configuration to be allowed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Enable needed SAE groups explicitly in sae_oom_wpas
Jouni Malinen [Tue, 5 Mar 2019 15:13:35 +0000 (17:13 +0200)] 
tests: Enable needed SAE groups explicitly in sae_oom_wpas

Configure the sae_groups parameter for hostapd explicitly in preparation
for the default value change in the implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Enable needed SAE groups explicitly in sigma_dut_sae
Jouni Malinen [Tue, 5 Mar 2019 15:12:44 +0000 (17:12 +0200)] 
tests: Enable needed SAE groups explicitly in sigma_dut_sae

Configure the sae_groups parameter for hostapd explicitly in preparation
for the default value change in the implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd explicit checks for peer's DH public key
Jouni Malinen [Tue, 5 Mar 2019 15:05:03 +0000 (17:05 +0200)] 
Add explicit checks for peer's DH public key

Pass the group order (if known/specified) to crypto_dh_derive_secret()
(and also to OpenSSL DH_generate_key() in case of Group 5) and verify
that the public key received from the peer meets 1 < pubkey < p and
pubkey^q == 1 mod p conditions.

While all these use cases were using only ephemeral DH keys, it is
better to use more explicit checks while deriving the shared secret to
avoid unexpected behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agobignum: Fix documentation for bignum_cmp_d()
Jouni Malinen [Tue, 5 Mar 2019 14:10:33 +0000 (16:10 +0200)] 
bignum: Fix documentation for bignum_cmp_d()

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: FT-SAE with Password Identifier
Jouni Malinen [Tue, 26 Feb 2019 18:39:54 +0000 (20:39 +0200)] 
tests: FT-SAE with Password Identifier

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: More robust connect command testing
Jouni Malinen [Mon, 25 Feb 2019 19:58:28 +0000 (21:58 +0200)] 
tests: More robust connect command testing

Avoid an invalid failure case due to scan results being left behind from
connect_cmd_bssid_hint when executing connect_cmd_reject_assoc by
explicitly clearing the scan results from dev5. This fixes an error case
that happened with the following test case sequence:
connect_cmd_bssid_hint connect_cmd_reject_assoc

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Make MACsec test cases clear monitor socket more thoroughly
Jouni Malinen [Mon, 25 Feb 2019 19:40:23 +0000 (21:40 +0200)] 
tests: Make MACsec test cases clear monitor socket more thoroughly

The wpas (dev5) control interface socket did not always get cleared in
the MACsec test cases and this could result in issues with following
test cases if the dev5 message queue hit the maximum limit.

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