Index: sources/wifi/WifiInterface.cpp =================================================================== diff -u -r710816dfce521fce66e2b86e9982ba4d47e0753e -ra27bbe9d61de6cee49a33bad778aed8ae1f52cb7 --- sources/wifi/WifiInterface.cpp (.../WifiInterface.cpp) (revision 710816dfce521fce66e2b86e9982ba4d47e0753e) +++ sources/wifi/WifiInterface.cpp (.../WifiInterface.cpp) (revision a27bbe9d61de6cee49a33bad778aed8ae1f52cb7) @@ -336,9 +336,27 @@ bool requiresPSK = QRegularExpression("Authentication Suites.*PSK").match(element).hasMatch(); bool supportsTKIP = QRegularExpression("Pairwise Ciphers.*TKIP").match(element).hasMatch(); + // NOTE: the iwlist command does not have the SAE and displayes it as unknown but the (8) is the SAE which comes from the driver. + bool isWPA3Only = false; + bool supportsSAE = QRegularExpression("Authentication Suites.*unknown \\(8\\)").match(element).hasMatch(); + // NOTE: if it only supports SAE it means that is the WPA3-only + // NOTE: iwlist is not reporting the WPA3 SSID as WPA3 so the only indication is the SAE which belongs only to WPA3. + // IMPORTANT: ******************************************************************* + // NOTE: we do not support the OWE and ENTERPRISE yet and it is personal for now. + // ****************************************************************************** + if ( supportsSAE ) { + isWPA3Only = QRegularExpression("Authentication Suites \\(1\\) : unknown \\(8\\)").match(element).hasMatch(); + } + qDebug() << element << supportsSAE; + MWifiNetwork::SECURITY_TYPE securityType = MWifiNetwork::SECURITY_TYPE::UNSUPPORTED; - if (isWPA2 && requiresPSK && supportsAES && !supportsTKIP) + + // NOTE: order of the if is very IMPORTANT + if ( supportsSAE ) // the wpa3 has the highest priority, and if supported we connect with wpa3 + securityType = isWPA3Only ? MWifiNetwork::SECURITY_TYPE::WPA3_SAE_ONLY: + MWifiNetwork::SECURITY_TYPE::WPA3_WPA2_TRNS; + else if (isWPA2 && requiresPSK && supportsAES && !supportsTKIP) securityType = MWifiNetwork::SECURITY_TYPE::WPA2_AES; else if (isWPA && requiresPSK && supportsAES && supportsTKIP) securityType = MWifiNetwork::SECURITY_TYPE::WPA_TKIP_AES; @@ -358,6 +376,7 @@ securityTypes.append(MWifiNetwork::SECURITY_TYPE::WEP); } + qDebug() << macAddress << ssid << securityTypes << signalLevel << requiresKey; WifiNetworkData network(macAddress, ssid, securityTypes, MWifiNetwork::STATUS::NOT_CONNECTED, signalLevel, requiresKey); networks.append(network); emit didAddNetwork(network); @@ -396,11 +415,14 @@ return; } QString securityType; - if (vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA2_AES)) + if (vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA3_WPA2_TRNS) + || vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA3_SAE_ONLY)) + securityType = "wpa3"; + else if (vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA2_AES)) securityType = "wpa2"; else if (vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA_TKIP_AES) - || vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA_AES) - || vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA_TKIP)) + || vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA_AES) + || vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WPA_TKIP)) securityType = "wpa"; else if (vNetwork.securityTypes().contains(MWifiNetwork::SECURITY_TYPE::WEP)) securityType = "wep";