tests: Wait for AP-ENABLED

It takes some time for hostapd to complete AP startup. In some cases,
this could potentially result in station starting a scan before the AP
is beaconing or ready to reply to probes. To avoid such race conditions,
wait for AP-ENABLED before going ahead with the test cases.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Collect code coverage separately from each component in vm

Use a more robust design for collecting the gcov logs from the case
where test cases are run within a virtual machine. This generates a
writable-from-vm build tree for each component separately so that the
lcov and gcov can easily find the matching source code and data files.
In addition, prepare the reports automatically at the end of the
vm-run.sh --codecov execution.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Mark kernel issues more clearly in the log file

It was previously not obvious from the <test case>.log file that a test
case was marked failed based on kernel issues. Make this very clear to
avoid wasting time on figuring out what caused the failure.

Signed-hostap: Jouni Malinen <j@w1.fi>
WNM: Use nonzero dialog token in BSS Transition Management Query

Signed-hostap: Jouni Malinen <j@w1.fi>
WNM: Add Target BSSID into BSS Transition Management Response

P802.11-REVmc clarifies that the Target BSSID field is always present
hen status code is zero, so match that requirement.

Signed-hostap: Jouni Malinen <j@w1.fi>
WNM: Minimal processing of BSS Transition Management Query/Response

This adds first steps at processing a BSS Transition Management Query on
the AP side. Mainly, the message is parsed and printed out in the debug
log and a minimal BSS Transition Management Request frame is sent as a
response. BSS Transition Management Response frame is also parsed and
details printed out in the debug log.

Signed-hostap: Jouni Malinen <j@w1.fi>
WNM: Move ESS Disassoc Imminent sending to a helper function

This makes it easier to trigger the ESS Disassociation Imminent
operation from different sources.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
WNM: Fix AP processing without wnm_oper driver callback

hostapd_drv_wnm_oper() needs to indicate an error if the driver callback
function is not implemented. Without this, the buf_len argument could
have been left uninitialized which could result in crashing the process.

Signed-hostap: Jouni Malinen <j@w1.fi>
WNM: Add STA flag to indicate the current WNM-Sleep-Mode state

This can be useful for displaying the current STA state and also for
determining whether some operations are likely to fail or need
additional delay.

Signed-hostap: Jouni Malinen <j@w1.fi>
Remove unused STA flags

These three flags were only displayed, but never set or used for
anything else.

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

This is not really needed for anything and the standard does not require
such validation step to be made for Authentication frame transmission.

Signed-hostap: Jouni Malinen <j@w1.fi>
hostapd: Make STA flags available through ctrl_iface STA command

Signed-hostap: Jouni Malinen <j@w1.fi>
WNM: Move disassociation imminent sending to wnm_ap.c

This gets all WNM BSS Transition Management frame building and sending
within hostapd into the same location.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Add WNM test cases

These are not yet complete, but at least some frame exchanges can
be verified for WNM operations.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Verify PEAPv0 Crypto-Binding

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Verify EAP fast reauthentication

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Generate a combined code coverage report

This combines coverage from all three separate reports into a single
report.

Signed-hostap: Jouni Malinen <j@w1.fi>
Fix PeerKey deinit behavior

PeerKey entries need to be removed on disassociation and this needs to
be done in a way that cancels the possibly pending eloop timeout.

Signed-hostap: Jouni Malinen <j@w1.fi>
Fix PeerKey 4-way handshake

The earlier changes to buffer EAPOL frames when not associated to avoid
race conditions (especially commit
3ab35a660364dc68eaebfc0df6130071bbee6be5 but maybe something even before
that) broke PeerKey 4-way handshake. Fix this by using a separate check
before the race condition workaround to process PeerKey 4-way handshake
EAPOL-Key messages differently.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Verify PeerKey handshake

NOTE: Actual use of the direct link (DLS) is not supported in
mac80211_hwsim, so this operation fails at setting the keys after
successfully completed 4-way handshake. This test case does allow the
key negotiation part to be tested for coverage, though.

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