Index: sources/wifi/WifiInterface.cpp =================================================================== diff -u -r83b9d737cd495b34a7b42f5409962a9442f3b8f4 -r55b1508dfe51d9232e9017e3a757b4cc2ee8af17 --- sources/wifi/WifiInterface.cpp (.../WifiInterface.cpp) (revision 83b9d737cd495b34a7b42f5409962a9442f3b8f4) +++ sources/wifi/WifiInterface.cpp (.../WifiInterface.cpp) (revision 55b1508dfe51d9232e9017e3a757b4cc2ee8af17) @@ -320,9 +320,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; @@ -342,6 +360,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); @@ -380,11 +399,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";