Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: chrome/browser/extensions/api/networking_private/networking_private_linux.cc

Issue 779053002: Support checking RsnFlags as well as WpaFlags so that security type is reported correctly for all n… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add blank line after comment Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/networking_private/network_config_dbus_constants_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/networking_private/networking_private_linux.cc
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_linux.cc b/chrome/browser/extensions/api/networking_private/networking_private_linux.cc
index 5eace1fffc78106c5a7c23c67ed6b58409ecebb2..1bb58cf7ae7a8370422f267eb4983e5f46d74b63 100644
--- a/chrome/browser/extensions/api/networking_private/networking_private_linux.cc
+++ b/chrome/browser/extensions/api/networking_private/networking_private_linux.cc
@@ -580,7 +580,11 @@ bool NetworkingPrivateLinux::GetAccessPointInfo(
strength);
}
- // Read the security type.
+ // Read the security type. This is from the WpaFlags and RsnFlags property
+ // which are of the same type and can be OR'd together to find all supported
+ // security modes.
+
+ uint32 wpa_security_flags = 0;
{
scoped_ptr<dbus::Response> response(GetAccessPointProperty(
access_point_proxy,
@@ -590,18 +594,35 @@ bool NetworkingPrivateLinux::GetAccessPointInfo(
}
dbus::MessageReader reader(response.get());
- uint32 security_flags = 0;
- if (!reader.PopVariantOfUint32(&security_flags)) {
+
+ if (!reader.PopVariantOfUint32(&wpa_security_flags)) {
LOG(ERROR) << "Unexpected response for " << access_point_path.value()
<< ": " << response->ToString();
return false;
}
+ }
+
+ uint32 rsn_security_flags = 0;
+ {
+ scoped_ptr<dbus::Response> response(GetAccessPointProperty(
+ access_point_proxy,
+ networking_private::kNetworkManagerRsnFlagsProperty));
+ if (!response) {
+ return false;
+ }
+
+ dbus::MessageReader reader(response.get());
- std::string security;
- MapSecurityFlagsToString(security_flags, &security);
- access_point_info->SetString(kAccessPointInfoWifiSecurityDotted, security);
+ if (!reader.PopVariantOfUint32(&rsn_security_flags)) {
+ LOG(ERROR) << "Unexpected response for " << access_point_path.value()
+ << ": " << response->ToString();
+ return false;
+ }
}
+ std::string security;
+ MapSecurityFlagsToString(rsn_security_flags | wpa_security_flags, &security);
+ access_point_info->SetString(kAccessPointInfoWifiSecurityDotted, security);
access_point_info->SetString(kAccessPointInfoType, kAccessPointInfoTypeWifi);
access_point_info->SetBoolean(kAccessPointInfoConnectable, true);
return true;
@@ -717,9 +738,6 @@ void NetworkingPrivateLinux::AddOrUpdateAccessPoint(
void NetworkingPrivateLinux::MapSecurityFlagsToString(uint32 security_flags,
std::string* security) {
- // TODO(zentaro): Correct mapping - this may not be correct but the underlying
- // API appears not to work on Trusty so I can't verify yet.
- // Everything returns 0.
// Valid values are None, WEP-PSK, WEP-8021X, WPA-PSK, WPA-EAP
if (security_flags == NetworkingPrivateLinux::NM_802_11_AP_SEC_NONE) {
*security = kAccessPointSecurityNone;
« no previous file with comments | « chrome/browser/extensions/api/networking_private/network_config_dbus_constants_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698