Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of http://github.com/trueos/trueos-libqt5
Browse files Browse the repository at this point in the history
  • Loading branch information
q5sys committed Nov 25, 2017
2 parents 3808e13 + d2aae85 commit ac49ec4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src-qt5/libtrueos/utils/netif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,28 +370,28 @@ QString NetworkInterface::getWifiSecurity( QString SSID, QString deviceName ){

QString NetworkInterface::parseWifiSecurity( QString caps, QString etc ){
// INPUT: caps and etc are the last two fields output from "ifconfig (device) list scan"
QStringList secure = etc.split(" "); //put each security type in a different list element

QStringList secure = etc.simplified().split(" "); //put each security type in a different list element

//Examine the CAPS and Security data to determine the wifi encryption type
bool isDisabled = !caps.contains("P") && caps.contains("ES"); //CAPS = "ES" only -> no wifi encryption
bool isWEP = caps.contains("EP"); //CAPS = "EP" or "EPS" only (could also be RADIUS security type)
bool isWPA = secure.contains("WPA"); //both WPA personal and enterprise
bool isWPA2 = secure.contains("RSN"); //both WPA2 personal and enterprise

//qDebug() << "caps: "+caps+"\netc: "+etc;

//Output the security type
QString securityType;
if(isDisabled){
if(isDisabled){
securityType = "None";
}else if(isWPA2){
}else if(isWPA2){
securityType = "WPA2";
}else if(isWPA){
}else if(isWPA){
securityType = "WPA";
}else if(isWEP){
}else if(isWEP){
securityType = "WEP";
}else{
}else{
securityType = "ERROR";
}
return securityType;
Expand Down

0 comments on commit ac49ec4

Please sign in to comment.