Commit 51e44004 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

cros_network-config.mojo: Provide (fake) password properties to UI

This CL provides all password fields supported in the UI in mojo.
All such fields are already set to a fake value deep in the model
so that plaintext values will not be accidentally leaked, and the
UI already correctly identifies such values when provided.

Bug: 1014779
Change-Id: I9ba46c905722481b8ce4bc35bbd2534eb2ca2505
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865812
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708329}
parent 967acb2b
......@@ -992,6 +992,7 @@ mojom::ManagedEAPPropertiesPtr GetManagedEAPProperties(const base::Value* dict,
eap->identity = GetManagedString(eap_dict, ::onc::eap::kIdentity);
eap->inner = GetManagedString(eap_dict, ::onc::eap::kInner);
eap->outer = GetManagedString(eap_dict, ::onc::eap::kOuter);
eap->password = GetManagedString(eap_dict, ::onc::eap::kPassword);
eap->save_credentials =
GetManagedBoolean(eap_dict, ::onc::eap::kSaveCredentials);
eap->server_ca_pems =
......@@ -1096,6 +1097,7 @@ mojom::ManagedOpenVPNPropertiesPtr GetManagedOpenVPNProperties(
GetManagedString(openvpn_dict, ::onc::openvpn::kKeyDirection);
openvpn->ns_cert_type =
GetManagedString(openvpn_dict, ::onc::openvpn::kNsCertType);
openvpn->password = GetManagedString(openvpn_dict, ::onc::openvpn::kPassword);
openvpn->port = GetManagedInt32(openvpn_dict, ::onc::openvpn::kPort);
openvpn->proto = GetManagedString(openvpn_dict, ::onc::openvpn::kProto);
openvpn->push_peer_info =
......@@ -1397,6 +1399,7 @@ mojom::ManagedPropertiesPtr ManagedPropertiesToMojo(
wifi->hex_ssid = GetManagedString(wifi_dict, ::onc::wifi::kHexSSID);
wifi->hidden_ssid =
GetManagedBoolean(wifi_dict, ::onc::wifi::kHiddenSSID);
wifi->passphrase = GetManagedString(wifi_dict, ::onc::wifi::kPassphrase);
wifi->roam_threshold =
GetManagedInt32(wifi_dict, ::onc::wifi::kRoamThreshold);
wifi->ssid = GetRequiredManagedString(wifi_dict, ::onc::wifi::kSSID);
......
......@@ -436,6 +436,8 @@ struct ManagedEAPProperties {
ManagedString? identity;
ManagedString? inner;
ManagedString? outer;
// Note: |password| contains a placeholder if set to avoid leaking secrets.
ManagedString? password;
ManagedBoolean? save_credentials;
ManagedStringList? server_ca_pems;
ManagedStringList? server_ca_refs;
......@@ -464,6 +466,7 @@ struct ManagedIPSecProperties {
ManagedEAPProperties? eap;
ManagedString? group;
ManagedInt32? ike_version;
// Note: |psk| contains a placeholder if set to avoid leaking secrets.
ManagedString? psk;
ManagedBoolean? save_credentials;
ManagedStringList? server_ca_pems;
......@@ -472,6 +475,7 @@ struct ManagedIPSecProperties {
struct ManagedL2TPProperties {
ManagedBoolean? lcp_echo_disabled;
// Note: |password| contains a placeholder if set to avoid leaking secrets.
ManagedString? password;
ManagedBoolean? save_credentials;
ManagedString? username;
......@@ -516,6 +520,8 @@ struct ManagedOpenVPNProperties {
ManagedBoolean? ignore_default_route;
ManagedString? key_direction;
ManagedString? ns_cert_type;
// Note: |password| contains a placeholder if set to avoid leaking secrets.
ManagedString? password;
ManagedInt32? port;
ManagedString? proto;
ManagedBoolean? push_peer_info;
......@@ -600,6 +606,8 @@ struct ManagedWiFiProperties {
ManagedBoolean? ft_enabled;
ManagedString? hex_ssid;
ManagedBoolean? hidden_ssid;
// Note: |passphrase| contains a placeholder if set to avoid leaking secrets.
ManagedString? passphrase;
ManagedInt32? roam_threshold;
ManagedString ssid;
SecurityType security;
......
......@@ -663,7 +663,7 @@ Polymer({
identity: OncMojo.getActiveString(eap.identity),
inner: OncMojo.getActiveString(eap.inner),
outer: OncMojo.getActiveString(eap.outer) || 'LEAP',
password: '',
password: OncMojo.getActiveString(eap.password),
saveCredentials: this.getActiveBoolean_(eap.saveCredentials),
serverCaPems: this.getActiveStringList_(eap.serverCaPems),
subjectMatch: OncMojo.getActiveString(eap.subjectMatch),
......@@ -715,11 +715,11 @@ Polymer({
clientCertPkcs11Id: OncMojo.getActiveString(openVpn.clientCertPkcs11Id),
clientCertType: OncMojo.getActiveString(openVpn.clientCertType),
extraHosts: this.getActiveStringList_(openVpn.extraHosts),
otp: OncMojo.getActiveString(openVpn.otp),
password: OncMojo.getActiveString(openVpn.password),
saveCredentials: this.getActiveBoolean_(openVpn.saveCredentials),
serverCaPems: this.getActiveStringList_(openVpn.serverCaPems),
serverCaRefs: this.getActiveStringList_(openVpn.serverCaRefs),
otp: OncMojo.getActiveString(openVpn.otp),
password: OncMojo.getActiveString(openVpn.password),
userAuthenticationType:
OncMojo.getActiveString(openVpn.userAuthenticationType),
username: OncMojo.getActiveString(openVpn.username),
......@@ -752,7 +752,7 @@ Polymer({
const wifi = managedProperties.typeProperties.wifi;
const configWifi = configProperties.typeConfig.wifi;
autoConnect = this.getActiveBoolean_(wifi.autoConnect);
configWifi.passphrase = '';
configWifi.passphrase = OncMojo.getActiveString(wifi.passphrase);
configWifi.ssid = OncMojo.getActiveString(wifi.ssid);
if (wifi.eap) {
configWifi.eap = this.getEAPConfigProperties_(wifi.eap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment