tests: Make ap_wps_er_add_enrollee less likely to fail

WPS-ER-AP-REMOVE event from the ER is sent before HTTP UNSUBSCRIBE has
been completed. As such, it was possible for the following scan
validation step to be started before the AP has had a chance to react to
the ER status change. Makes this less likely to fail by waiting 200 ms
before starting the last scan.

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Document how to configure for libnl 2.0 and 3.2

Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>

Signed-hostap: Ben Greear <greearb@candelatech.com>
bsd: Prepare event buffer on init process

Currently these three steps runs for each event.
1. get buffer size via system
2. allocate a memory for event
3. free the memory

The wpa_supplicant receives 4 events from boot to be connected.
So this patch prepare the event buffer at the init process.

I have tested wpa_supplicant on NetBSD 6.1.2.
But I could not tested hostapd because I do not have AP enabled device.

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>
bsd: Fix NULL pointer dereference on error path

The error path in bsd_init() on struct bsd_driver_data allocation was
jumping to location where drv is dereferenced. That will crash and it is
easier to just return from the function since no cleanup steps are
needed in this case.

Signed-hostap: Jouni Malinen <j@w1.fi>
P2P: Cancel action frame offchan wait after recv GO Neg Conf

The missing call to scan_action_done() may keep us off-channel for 250
ms following sending GO Negotiation Response. In case the operating
channel is different from this channel and we're GO, a race could lead
to start beaconing while off-channel. This could potentially cause the
Beacon frames to go out on incorrect channel with some drivers.

Signed-hostap: Eyal Shapira <eyal@wizery.com>
P2P: Wait on GO Negotiation Confirm transmit

This reverts commit 792c8877c3e9558a6def558c6d35833a00571683
('P2P: Send GO Negotiation Confirm without wait').

Some drivers rely on the wait period for sending packets on the
off-channel. If the wait value is small, there's a race condition where
the driver ROC might complete before the packet was sent out. This
doesn't impede other drivers, as the wait is cancelled when a
Tx-completion arrives from the remote peer.

Signed-hostap: Arik Nemtsov <arik@wizery.com>
tests: Hidden SSID

In addition, add the earlier tests in the new test_ssid.py file that was
forgotten from the previous commit
d78f33030d9b3ecc7ad73ba3f544fc84b08d06ea.

Signed-hostap: Jouni Malinen <j@w1.fi>
hostapd: Skip full AP configuration validation on SET command

It is possible for the configuration to be temporarily invalid when
adding a new AP through SET commands followed by ENABLE. Avoid this
issue by using less strict validation on SET commands and perform full
configuration validation only on ENABLE. Use cases with configuration
file maintain their previous behavior, i.e., full validation after the
file has been read.

Signed-hostap: Jouni Malinen <j@w1.fi>
EXT PW: Fix hash return in password fetching

The hash return buffer was previously left uninitialized in case
externally stored password ("password=ext:...") was used. This could
result in MSCHAPv2 failure if that uninitialized memory happened to be
something else than zero.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: External password storage

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: WPS 2.0 AP rejecting WEP configuration

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: WPS AP using fragmented WPS IE

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Include vendor extension in WPS M1

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Verify all implemented EAP-pwd groups

Signed-hostap: Jouni Malinen <j@w1.fi>
EAP-FAST peer: Make debug clearer on missing pac_file configuration

EAP-FAST requires pac_file to be configured, so make it clearer from the
debug output if missing configuration parameter was the reason for
EAP-FAST initialization failing.

Signed-hostap: Jouni Malinen <j@w1.fi>
Skip network disabling on expected EAP failure

Some EAP methods can go through a step that is expected to fail and as
such, should not trigger temporary network disabling when processing
EAP-Failure or deauthentication. EAP-WSC for WPS was already handled as
a special case, but similar behavior is needed for EAP-FAST with
unauthenticated provisioning.

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

Signed-hostap: Jouni Malinen <j@w1.fi>
Clear configuration blobs on FLUSH command

All te network blocks and credentials were already cleared, but
configurations blobs should also be cleared here, e.g., to get
more consistent behavior test cases using EAP-FAST PACs.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: subject_match and altsubject_match

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Server certificate trust based on hash value

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