eap_proxy: EAP-SIM feature for single SIM.

EAP-SIM, EAP-AKA and EAP-AKA_PRIME feature request for
single SIM

Change-Id: I037827b485bc9acd6f01a6a5ea4053548713cda9
CRs-fixed: 585456
eap_proxy: enhance the proxy layer to support DSDS and SS feature

Mainline the DSDS feature support on host side and also
enhance the proxy layer to support both single SIM and
multi SIM (DSDS) feature.

Change-Id: If8087763db7bfa18232ce526c783521dc1bb9cdd
CRs-Fixed: 631880
Revert "TDLS: Move AID=1 workaround into driver_nl80211.c"

Some drivers shall send a valid AID in TDLS Setup Request
which exceeds IEEE80211_MAX_AID and thus the ADD_STA
fails on the TDLS responder.Thus,revert the commit
f11b72c3e9ffa28cd7ba8ced160e43f8f6bf9fca to ensure that
AID as part of ADD_STA for TDLS is 1.

CRs-fixed: 705882
Change-Id: Ia18afe6cc9d03b72c565351e806c3d1d9b6c66eb
Signed-off-by: Sunil Dutt <usdutt@qti.qualcomm.com>
wpa_supplicant: Changes to support key managment offload

These changes add support for key managment offload.

Key management offload is a mechanism where a station's device driver
or firmware/hardware does the exchange with the AP to establish the
temporal keys to be used for communications protection, rather than
having the supplicant do it.  This exchange takes place in a Robust
Security Network during initial connection or after a roam between
APs occurs.  It might also happen during after the device handles a
PTK rekeying operation.

CRs-Fixed: 694280
Change-Id: Icf5c40274dfba8eed0d0f1a830129b9d25da58c3
Revert "TDLS: Move AID=1 workaround into driver_nl80211.c" correctly

Commit cc788dcb4810f61a986f2a05a348d15921c405de had a small
typo which did not revert the commit
f11b72c3e9ffa28cd7ba8ced160e43f8f6bf9fca properly which is being
fixed as part of this commit

Change-Id: I70239468cfe41eab36452b8f3becaaa320c410ec
CRs-fixed: 710541
wpa_supplicant: Key management offload support for SHA-256 and FT/8021.X

Changes to add key management offload support for SHA-256 key
derivation.  Also changes to support connections that are both FT
(802.11r) and 802.1X.

Also a change to enable key management offload by default in the
supplicant

CRs-Fixed: 707223
Change-Id: Iada4f099b370c2253bbec8c19047fa324be381ca
wpa_supplicant: Key management offload for LEAP and proactive_key_caching

Changes to add key management offload support for 802.1X
LEAP connections.  Also changed so that if user disables
proactive_key_caching in the network block, or okc if
the global setting is used, then key management offload
will not be requested for the connection.

CRs-Fixed: 708769
Change-Id: I1859014aec51d352b70125c58e62a52edda7b89e
eap_proxy: Add baseband property information for MSM8994 target

For MSM8994 targets, the ro.baseband property is different than
other MSM targets. Due to which the eap_proxy layer in the
supplicant was failing to open a socket connection with the QMI
interface.
To mitigate this, added a right ro.baseband property in the proxy
layer.

Change-Id: I4e105c12c29cc25cf4e0c7ea0b19bd975372fdbb
CRs-Fixed: 712960
hostapd: Check that EVENT_ASSOC data is present before using it

While hostapd should not really receive the EVENT_ASSOC message for
IBSS, driver_nl80211.c could potentially generate that if something
external forces the interface into IBSS mode and the IBSS case does not
provide the struct assoc_info data. Avoid the potential NULL pointer
dereference by explicitly verifying for the event data to be present.

CRs-Fixed: 714797
Git-commit: 04a258e7c56202ca285dd4d9459fdb45754401fe
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>

Change-Id: I1f5bec8244e686359a997acdda0099fc83f2114b
Add printf NULL checks to silence static analyzer

Add NULL checks to take care of issues reported by static analyzer tool
on potentially using NULL with printf format %s (which has undefined
behavior even though many compilers end up printing "(null)").

Git-commit: db9418bb1b8054b54d9b299e0334850d5e2b77ad
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>

Change-Id: Iccf18c97617aa3ec4b5b59cbe75ce08aeb37d152
CRs-Fixed: 716166
P2P: Do not add P2P IEs on P2P disabled interface

While building Association Request frame IEs we should consider adding
P2P IEs only on interface where P2P functionality is enabled. Consider
per interface p2p_disabled parameter before adding P2P IEs to complete
the checks for this.

Git-commit: 1c2aa04c96626f5b000d167bb5274a8c39b7dac2
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
CRs-Fixed: 714491

Change-Id: Ib95ecdf3bdf51b38f377378c5a5f4ef47e06836f
wpa_supplicant: Not passing down PMK in 802.1X key managment offload

When the supplicant determines the PMK in the case of a 802.1X
connection, it needs to inform the device of the PMK if key management
offload is enabled.  It does this by calling cfg80211_key_mgmt_set_pmk.
There is a bug in the code so that this routine is not being called
when it should be.  This change fixes the bug.

Change-Id: Ibc6e71ea46b952e29a3d5b9753df968f0d959b2b
CRs-Fixed: 721932
p2p: Add p2p_no_group_iface flag to p2p conf file

Avoid to create new interface for p2p connection, As an extra
new interface will consume one HW index

Change-Id: Id0fac3d30dc33797c93a72466ef3a839254b1117
CRs-fixed: 520439
Conflicts:
wpa_supplicant/wpa_supplicant_template.conf
WPS: Merge mixed-WPA/WPA2 credentials if received in same session

Some deployed APs send two credentials when in mixed-WPA/WPA2
configuration; one for the WPA-Personal/TKIP and the other for
WPA2-Personal/CCMP. Previously, this would result in two network blocks
getting added for the single AP. This can be somewhat confusing and
unnecessary, so merge such credentials into a single one that allows
both WPA and WPA2 to be used.

CRs-Fixed: 703145
Git-commit: e5a4b85b2fa416efb516825f884a0eda5b3f1c40
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>

Change-Id: I92b38dce31b3f17ea762de70781f7ff9a6dda583
P2P: Overwrite pending interface only after verifying BSS entry

Previously, the P2P Interface Address of the peer gets updated in the
peer table every time based on the scan results.

For example, in a two port concurrency scenario, where the peer device
has two interfaces with unique P2P Interface Addresses and with same P2P
Device Address, based on the Probe Response/Beacon frames from these two
interfaces, their peer table gets updated, but each of these updates
happens in the peer table only based on the P2P Device Address. So, the
same peer's P2P Interface address is updated every time and hence, at
any instant, only one P2P Device Address to P2P Interface Address
mapping entry exist in the peer table for the peer which has two
interfaces.

When we try to join a group operated by the peer, lookup happens in the
peer table and when an interface entry is not available, the pending
interface address gets overwritten with the P2P Device Address and hence
the P2P connection can fail. Since the BSS table is the one that is
up-to-date, this fix will ensure that the interface overwriting will
happen only when there is no BSS entry for the pending P2P Interface
Address as well.

Git-commit: 4e5367516b80d599c7ae269842eddf9eefea0115
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: I8fd42a8214a1b3c67ac9e6d38a4cbec023215075
CRs-Fixed: 690463
TDLS: Add RSN and Timeout interval IEs in TDLS Discovery Response frame

If RSN is enabled, add RSN and Timeout interval elements in TDLS
Discovery Response frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Git-repo : git://w1.fi/srv/git/hostap.git
Git-commit: ce2002accad2e7bafba6ac84faa8a29c32261f57
Change-Id: I3803047d95829bc02b105a25c91802284e5b4c54
CRs-Fixed: 718902
Check for driver's DFS offload capability before handling DFS

This fixes couple of code paths where the WPA_DRIVER_FLAGS_DFS_OFFLOAD
flag was not checked properly and unexpected DFS operations were
initiated (and failed) in case the driver handles all these steps.

Git-commit: c53a9bf8180819c2e67be51c1e44b5d942cdc6f9
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: I995057d46b0af920e563f739d67d4537e9dad7cb
CRs-fixed: 728321
eap_proxy: Check for modem support at the run time

Some of the targets do not support modem. But EAP-SIM feature
requires modem support. The modem initialization will fail on
these targets leading to supplicant initialization failure.
To mitigate this, check for modem presence at the run time and
avoid the proxy initialization if modem support is not present

Change-Id: Ib2814d0031a79aee36cc6eef9e9ea04a17f1ac4b
CRs-Fixed: 694518
eap_proxy: Check for Modem's compatibility for EAP SIM functionality

Some platforms , do have the (internal) modem functionality but shall
not be compatible for EAP SIM authentication, rather the external
modem on such platforms are EAP SIM compatible.Hence, check for the
external modem support on such platforms before proceeding with the
further initialization

Change-Id: I2e6727bf9f110b4812510d28dc0b6346ee082d1d
CRs-Fixed: 723765
P2P: Fix radio work issue with wait-for-peer GO Negotiation

If a TX status event and RX event for a GO Negotiation frame gets
delayed long enough to miss the initial wait, it was possible for
reception of a GO Negotiation Response frame with status 1 to try to
initiate a new p2p-listen work item to wait for the peer to become ready
while a previous p2p-listen was already in progress due to that earlier
timeout while waiting for peer. This would result in the new
start_listen request getting rejected ("P2P: Reject start_listen since
p2p_listen_work already exists") and the negotiation not proceeding.

Work around this by using P2P_WAIT_PEER_CONNECT state instead of
P2P_WAIT_PEER_IDLE if P2P_CONNECT_LISTEN state has already been entered
when processing this special GO Negotiation Response status=1 case. This
can avoid double-scheduling of p2p-listen and as such, completion of the
GO negotiation even if the driver event or peer response are not
received in time (the response is supposed to be there within 100 ms per
spec, but there are number of deployed devices that do not really meet
this requirement).

CRs-Fixed: 710967
Git-commit: 17e20912790a2cca616ddd2856e60e871a377726
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: I7a8a395f2df3769b4cc67a0d8ba6759ddc99562d