Changeset View
Changeset View
Standalone View
Standalone View
src/utils.cpp
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Line(s) | 328 | if (!apRsn.testFlag(NetworkManager::AccessPoint::KeyMgmt8021x)) { | |||
---|---|---|---|---|---|
329 | return false; | 329 | return false; | ||
330 | } | 330 | } | ||
331 | /* Ensure at least one WPA cipher is supported */ | 331 | /* Ensure at least one WPA cipher is supported */ | ||
332 | if (!deviceSupportsApCiphers(interfaceCaps, apRsn, Wpa2Eap)) { | 332 | if (!deviceSupportsApCiphers(interfaceCaps, apRsn, Wpa2Eap)) { | ||
333 | return false; | 333 | return false; | ||
334 | } | 334 | } | ||
335 | } | 335 | } | ||
336 | break; | 336 | break; | ||
337 | case SAE: | ||||
338 | if (!interfaceCaps.testFlag(NetworkManager::WirelessDevice::Rsn)) { | ||||
339 | return false; | ||||
340 | } | ||||
341 | if (haveAp) { | ||||
342 | if (!interfaceCaps.testFlag(NetworkManager::WirelessDevice::IBSSRsn)) { | ||||
343 | return false; | ||||
344 | } | ||||
345 | if (apRsn.testFlag(NetworkManager::AccessPoint::PairCcmp) && | ||||
346 | interfaceCaps.testFlag(NetworkManager::WirelessDevice::Ccmp)) { | ||||
347 | return true; | ||||
348 | } | ||||
349 | } else { | ||||
350 | if (apRsn.testFlag(NetworkManager::AccessPoint::KeyMgmtSAE)) { | ||||
351 | if (apRsn.testFlag(NetworkManager::AccessPoint::PairTkip) && | ||||
352 | interfaceCaps.testFlag(NetworkManager::WirelessDevice::Tkip)) { | ||||
353 | return true; | ||||
354 | } | ||||
355 | if (apRsn.testFlag(NetworkManager::AccessPoint::PairCcmp) && | ||||
meven: just a small indentation space error | |||||
356 | interfaceCaps.testFlag(NetworkManager::WirelessDevice::Ccmp)) { | ||||
357 | return true; | ||||
358 | } | ||||
359 | } | ||||
360 | return false; | ||||
361 | } | ||||
337 | default: | 362 | default: | ||
338 | good = false; | 363 | good = false; | ||
339 | break; | 364 | break; | ||
340 | } | 365 | } | ||
341 | 366 | | |||
342 | return good; | 367 | return good; | ||
343 | } | 368 | } | ||
344 | 369 | | |||
345 | NetworkManager::WirelessSecurityType NetworkManager::findBestWirelessSecurity(NetworkManager::WirelessDevice::Capabilities interfaceCaps, bool haveAp, bool adHoc, NetworkManager::AccessPoint::Capabilities apCaps, NetworkManager::AccessPoint::WpaFlags apWpa, NetworkManager::AccessPoint::WpaFlags apRsn) | 370 | NetworkManager::WirelessSecurityType NetworkManager::findBestWirelessSecurity(NetworkManager::WirelessDevice::Capabilities interfaceCaps, bool haveAp, bool adHoc, NetworkManager::AccessPoint::Capabilities apCaps, NetworkManager::AccessPoint::WpaFlags apWpa, NetworkManager::AccessPoint::WpaFlags apRsn) | ||
346 | { | 371 | { | ||
347 | QList<NetworkManager::WirelessSecurityType> types; | 372 | QList<NetworkManager::WirelessSecurityType> types; | ||
348 | 373 | | |||
349 | // The ordering of this list is a pragmatic combination of security level and popularity. | 374 | // The ordering of this list is a pragmatic combination of security level and popularity. | ||
350 | // Therefore static WEP is before LEAP and Dynamic WEP because there is no way to detect | 375 | // Therefore static WEP is before LEAP and Dynamic WEP because there is no way to detect | ||
351 | // if an AP is capable of Dynamic WEP and showing Dynamic WEP first would confuse | 376 | // if an AP is capable of Dynamic WEP and showing Dynamic WEP first would confuse | ||
352 | // Static WEP users. | 377 | // Static WEP users. | ||
353 | types << NetworkManager::Wpa2Eap << NetworkManager::Wpa2Psk << NetworkManager::WpaEap << NetworkManager::WpaPsk << NetworkManager::StaticWep << NetworkManager::DynamicWep << NetworkManager::Leap << NetworkManager::NoneSecurity; | 378 | types << NetworkManager::SAE << NetworkManager::Wpa2Eap << NetworkManager::Wpa2Psk << NetworkManager::WpaEap << NetworkManager::WpaPsk << NetworkManager::StaticWep << NetworkManager::DynamicWep << NetworkManager::Leap << NetworkManager::NoneSecurity; | ||
354 | 379 | | |||
355 | Q_FOREACH (NetworkManager::WirelessSecurityType type, types) { | 380 | Q_FOREACH (NetworkManager::WirelessSecurityType type, types) { | ||
356 | if (NetworkManager::securityIsValid(type, interfaceCaps, haveAp, adHoc, apCaps, apWpa, apRsn)) { | 381 | if (NetworkManager::securityIsValid(type, interfaceCaps, haveAp, adHoc, apCaps, apWpa, apRsn)) { | ||
357 | return type; | 382 | return type; | ||
358 | } | 383 | } | ||
359 | } | 384 | } | ||
360 | return NetworkManager::UnknownSecurity; | 385 | return NetworkManager::UnknownSecurity; | ||
361 | } | 386 | } | ||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |
just a small indentation space error