Signed-off-by: xionglei <xionglei3@huawei.com>
This commit is contained in:
xionglei 2024-09-13 07:59:08 +00:00 committed by Gitee
parent 15f5da84bc
commit 9f237dfeee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -79,21 +79,6 @@ int32_t OnEventDisconnected(struct IWpaCallback *self,
LOGI("OnEventDisconnected, wrong password");
cbk.onWpaSsidWrongKey();
}
OHOS::Wifi::WifiConfigCenter::GetInstance().GetScanInfoList(scanResults);
for (OHOS::Wifi::WifiScanInfo &item : scanResults) {
if (strcasecmp(item.bssid.c_str(), szBssid) == 0 &&
(item.capabilities.find("PSK") != std::string::npos ||
item.capabilities.find("WAPI-PSK") != std::string::npos)) {
isPsk = true;
break;
}
}
if (cbk.onWpaSsidWrongKey && isPsk &&
g_currentWpaStatus == static_cast<int>(OHOS::Wifi::SupplicantState::FOUR_WAY_HANDSHAKE) &&
(reasonCode != Wifi80211ReasonCode::WLAN_REASON_IE_IN_4WAY_DIFFERS || !locallyGenerated)) {
LOGI("OnEventDisconnected, wrong password");
cbk.onWpaSsidWrongKey();
}
if (cbk.onConnectChanged) {
cbk.onConnectChanged(HAL_WPA_CB_DISCONNECTED, reasonCode, std::string(szBssid));
}