eap_example: Get rid of a compiler warning

Signed-off-by: Jouni Malinen <j@w1.fi>
ERP: Avoid a static analyzer warning on uninitialized emsk_len

This was not really a real issue since bin_clear_free() would not use
the emsk_len argument when emsk is NULL as it would be on the path where
emsk_len has not been initilized. Anyway, it is better to get rid of the
warning.

Signed-off-by: Jouni Malinen <j@w1.fi>
HS 2.0: Clarify OSU Provider list length validation

The previous version was somewhat too complex for some static analyzers.
Use local variables for the extracted length fields and explicitly
compare these against the remaining buffer length. (CID 68121)

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd: Fix HT40 determination for ACS offload

Commit 16689c7cfc99c66aecbf16eb2f4a8bc941cb5d0f ('hostapd: Allow ACS to
be offloaded to the driver') used incorrect operator to determine
whether HT40 was configured. Fix that to mask the ht_capab bit
correctly. (CID 77286)

Signed-off-by: Jouni Malinen <j@w1.fi>
WMM-AC: Use DEBUG verbosity for ignoring Action frame messages

There is no point in flooding the log with WARNING or ERROR level
messages if WMM-AC related Action frames are ignored in cases where they
were not expected. In addition, WARNING/ERROR should not really be used
in cases an invalid frame is dropped especially if this is not related
to a security setup since external devices could otherwise generate log
entries.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: More coverage for WMM-AC

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
WFD: Allow WFD_SUBELEM_SET/GET all to be used with full IE buffer

This extends the previously used WFD_SUBELEM_SET/GET <subelem id> design
to allow special "all" value to be used as an id to indicate that all
WFD subelements are to be set/get. This uses similar interface as was
previously added over D-Bus.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: WFD_SUBELEM_SET/GET with all parameter

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Optimize WFD connect_cli() calls

There is no need to run full scan in these test cases, so use single
channel scan to save time.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: SET disallow_aps in P2P GO mode

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: wpa_supplicant ctrl_iface SET operations

This adds more test coverage for wpa_supplicant SET ctrl_iface command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Disabling WNM keep-alive and hostapd doing client poll

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: TDLS teardown using wildcard address

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: FT_DS with unknown target

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Optimize FT test cases

Use single channel scan instead of full scan to save time. In addition,
use EAP-GPSK which takes significantly less CPU that EAP-EKE with
default parameters.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
P2P: Split p2p_channels_union() into two functions

The separate p2p_channels_union_inplace() makes the function easier for
static analyzers to see that the result buffer is always initialized.
(CID 74494)

Signed-off-by: Jouni Malinen <j@w1.fi>
FT: Make aes_unwrap() calls easier to analyze

Using aes_unwrap() to initialize a data structure seemed to be too much
for some static analyzers to understand. Make it obvious that the target
is initialized and that the target is not just the single struct member.
In addition, clean up the design to avoid removal of const with a
typecast. (CID 68112, CID 68134, CID 68135, CID 68136)

Signed-off-by: Jouni Malinen <j@w1.fi>
FT: Make aes_wrap() call easier to analyze

Using aes_wrap() to initialize a data structure seemed to be too much
for some static analyzers to understand. Make it obvious that the target
is not just the single struct member. (CID 68111)

Signed-off-by: Jouni Malinen <j@w1.fi>
Make GTK length validation easier to analyze

Bounds checking for gd->gtk_len in wpa_supplicant_check_group_cipher()
was apparently too complex for some static analyzers. Use a local
variable and a more explicit validation step to avoid false report.
(CID 62864)

Signed-off-by: Jouni Malinen <j@w1.fi>
PCSC: Make AID copying easier for static analyzers

Use a separate pointer and length field instead of trying to copy from a
struct field that has only part of the full buffer available.
(CID 68115)

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