Interworking: Allow cred blocks not to be saved to a file

The new cred block parameter 'temporary' can be used to indicate that a
cred block is not to be saved to wpa_supplicant configuration file
(e.g., "SET_CRED 0 temporary 1"). This is similar to the concept of
temporary network blocks and allows cred blocks to be managed outside
the wpa_supplicant config file when other parameters are still saved to
the file written by wpa_supplicant.

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Print frame registration match on same debug line

This makes debug log a bit more readable.

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Clean up regulatory rule debug prints

Combine maximum bandwidth and EIRP into a single debug print.

Signed-hostap: Jouni Malinen <j@w1.fi>
WPS: Clean up UUID debug print

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Set control port for NL80211_CMD_COMMAND

NL80211_ATTR_CONTROL_PORT was previously set only for
NL80211_CMD_ASSOCIATE, but it should also be set when using
NL80211_CMD_COMMAND (driver-based SME) even though none of the current
non-mac80211 drivers use this.

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Use helper functions for cipher suite mapping

Signed-hostap: Jouni Malinen <j@w1.fi>
Get rid of duplicated cipher suite and AKM definitions

WPA_CIPHER_* and CIPHER_* are used for the exact same set of cipher
suites with the main difference being that the WPA_CIPHER_* version is
suitable to be used as a bitfield. Similarly, WPA_KEY_MGMT_* and
KEY_MGMT_* have similar design for AKMs. There is no need to maintain
two separate copies of the definitions since the bitfield compatible
version can be used for both needs. Get rid of the CIPHER_* and
KEY_MGMT_* versions to clean up the implementation by getting rid of
unnecessary mapping functions.

Signed-hostap: Jouni Malinen <j@w1.fi>
Remove unnecessary build #ifdef from definitions

This type of definition by itself does not change the binary at all.

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Share a helper function for connect and associate commands

Most of the attributes to these commands are identical and there is no
need to maintain two copies of the same functionality.

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Report set_supp_port failures in debug log

Signed-hostap: Jouni Malinen <j@w1.fi>
wpaspy: Fix tracking of attached status

The attached variable was initialized and checked, but never updated.
Fix that by updating it on successful ATTACH/DETACH command.

Signed-hostap: Jouni Malinen <j@w1.fi>
wpaspy: Do not leave socket files behind if connection fails

Ctrl::__init__ needs to handle socket.connect() exceptions and unlink
the client socket file on failures.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Verify dynamic wpa_supplicant interface addition/removal

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Prefer newer scan result over older during duplicate removal

Previously, it was possible for bss_info_handler() to end up dropping a
newer scan result entry if there were two entries with the same BSSID
and SSID (i.e., only frequency was different) and we were not associated
with either. This could happen, e.g., in some P2P use cases where device
discovery may happen on different channels. Fix this by checking the age
of the scan entries as well to prefer the most recent response.

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Fix nl_mgmt handling in partial error case

If Action frame registration in nl80211_mgmt_subscribe_non_ap() failed
for any frame type, the previous implementation skipped
nl80211_mgmt_handle_register_eloop() call. This is not desirable since
none of the Action frame types could be received and even worse, the
following nl80211_destroy_eloop_handle() call for nl_mgmt would likely
result in crashing the process due to the ELOOP_SOCKET_INVALID XOR
operation. This could be triggered at least in a P2P group interface
startup failure case.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Verify cfg80211 P2P Device use

Signed-hostap: Jouni Malinen <j@w1.fi>
nl80211: Add driver param for forcing monitor and connect APIs

use_monitor=1 and force_connect_cmd=1 driver parameters can now be used
to force older monitor interface design and the connect API (SME in
driver) to increase hwsim testing coverage.

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Increase nl80211 test coverage with monitor/connect

Add test cases to use connect command instead of auth+assoc commands and
AP mode operations using the old monitor interface design.

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

It did not look like open mode association completed with WEXT.. I'm
commenting that test case out for now since WPA2-PSK worked. If you care
about WEXT, feel free to fix it and submit a patch to remove the
"REMOVED_" prefix here..

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Verify WMM AC configuration and ACM=1 downgrade VO/VI->BE

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