Disable network temporarily on repeated connection failures

Previously, only explicit indications of authentication failures were
used to disable a network block temporarily. Extend this to use multiple
failed connection attempts as a sign of a possible authentication or
authorization failure to reduce the frequency of connection attempts
with a network that does not seem to allow connection.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
EAP peer: Add check before calling getSessionId method

We should not call getSessionID method if it's not provided. This fixes
a regression from commit 950c5630768285e460aa336c78a18162fb3e0434 where
EAP methods that did not implement getSessionId resulted in NULL pointer
dereference when deriving the key.

Signed-off-by: Shijie Zhang <shijiez@qca.qualcomm.com>
tests: Capture hwsim0 packet dump during test run

Signed-hostap: Jouni Malinen <j@w1.fi>
P2P: Set P2P_DEV_PEER_WAITING_RESPONSE from TX status callback

Commit fb8984fd6f4b49d9178dd87a880dd7add514b7d1 added a mechanism to
skip the Listen state when the peer is expected to be waiting for us to
initiate a new GO Negotiation. However, this flag was set when building
the GO Negotiation Response frame with status 1 regardless of whether we
managed to send that frame or peer receive it. This could result in GO
Negotiation failures in cases where the peer did not receive the
response and Listen channels of the devices were different. Fix this by
setting the flag only after TX status indicating success has been
received.

This fixes frequent failures shown for the test_grpform_pbc hwsim test
case.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Generate a tarball of test results if a test fails

This makes it easier to collect failure data from test servers for
further analysis.

Signed-hostap: Jouni Malinen <j@w1.fi>
FT: Reset FT flag upon STA deauthentication

Reset ft_completed if STA receives deauthentication
between FT reassoc success and the subsequent initial
mobility authentication and association.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Use a common frequency to channel conversion function

Signed-hostap: Jouni Malinen <j@w1.fi>
P2P: Clean up channel--frequency conversion functions

All P2P use cases are required to use the global operating table and
there is no need to need to try to maintain some backwards compatibility
with country code -specific values. Clean up the implementation by
removing the unnecessary country parameter.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Use ignore_old_scan_res with some more WPS tests

The scan results from old test cases showing different SSID on the AP
can result in false failures, so avoid those by ignoring old scan
results from cfg80211.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
WPS: Use generic MAC Address attribute builder

Signed-hostap: Jouni Malinen <j@w1.fi>
WPS NFC: Allow Device Password ID override for selected registrar

When a specific out-of-band Device Password is enabled, it can be useful
to be able to advertise that in the selected registrar information.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
NFC: Increase wpa_cli command buffer size

NFC connection handover messages may be longer than 100 octets, so
increase wpa_cli buffer size to allow longer messages to be reported.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
WPS: Fix AP auto configuration on config token generation

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Add a test case for AP auto configuration on config token build

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
NFC: Add no waiting and no multiple operations options for scripts

The nfcpy script used to be run in a way that left them running for
multiple operations. This is not desired for some use cases, so provide
options to request only a single operation to be performed.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Add bitfield routines

Signed-hostap: Jouni Malinen <j@w1.fi>
Make vlan_file optional if dynamic_vlan is used

My APs generate their configuration on their own using a different
number of (vlan-enabled) bss. Currently, all my vlan_file files consist
of a single line: the wildcard line. Configuration file generation would
be easier, if the hostapd configuration file would not depend on those
simple vlan_file files.

This patch removes the need for those one-line files by using the
<device>.<vlan> naming scheme if no vlan_file is given (or that file is
empty). This should not break any existing setup, as using dynamic_vlan
with no vlan configured does not make sense anyway.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>
FT RRB: Validate os_malloc() return value before using it

Signed-hostap: Jouni Malinen <j@w1.fi>
Use os_zalloc() instead of os_malloc() + os_memset()

Signed-hostap: Jouni Malinen <j@w1.fi>
Add dup_binstr() to help common binary string tasks

There are quite a few places in the current implementation where a nul
terminated string is generated from binary data. Add a helper function
to simplify the code a bit.

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