diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-03 23:58:17 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-03 23:58:17 +0000 |
commit | d37a8b0880f41b301fc678c2d556315542bb045b (patch) | |
tree | 73de9acfebd81c95405195446147b7fe1c4389bd | |
parent | 410227eeb37616c0fd3351ccb23093db0aabfc0d (diff) | |
download | chromium_src-d37a8b0880f41b301fc678c2d556315542bb045b.zip chromium_src-d37a8b0880f41b301fc678c2d556315542bb045b.tar.gz chromium_src-d37a8b0880f41b301fc678c2d556315542bb045b.tar.bz2 |
Merge 64976 - Prevented access to WEP passphrase from UI. Fixed forget network button in settings.
TEST=make sure we don't show WEP passphrase in UI, make sure forget network button works again
BUG=chromium-os:8413, chomium-os:8441
Review URL: http://codereview.chromium.org/4162004
TBR=zelidrag@chromium.org
Review URL: http://codereview.chromium.org/4450001
git-svn-id: svn://svn.chromium.org/chrome/branches/552/src@64995 0039d316-1c4b-4281-b951-d872f2087c98
5 files changed, 32 insertions, 67 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 7701972..feef538 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -9107,6 +9107,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_BAD_PASSPHRASE" desc="In settings internet options, the label for the bad passphrase."> Incorrect password. </message> + <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NET_PROTECTED" desc="In settings internet options, the message in network details page for password protected networks."> + Access to this network is protected with a WEP key. + </message> <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_BAD_WEPKEY" desc="In settings internet options, the label for the bad WEP key."> Password format is incorrect. </message> diff --git a/chrome/browser/chromeos/dom_ui/internet_options_handler.cc b/chrome/browser/chromeos/dom_ui/internet_options_handler.cc index 47541a3..d3b1972 100644 --- a/chrome/browser/chromeos/dom_ui/internet_options_handler.cc +++ b/chrome/browser/chromeos/dom_ui/internet_options_handler.cc @@ -143,9 +143,9 @@ void InternetOptionsHandler::GetLocalizedValues( localized_strings->SetString("inetCertPass", l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PRIVATE_KEY_PASSWORD)); - localized_strings->SetString("inetPass", + localized_strings->SetString("inetPassProtected", l10n_util::GetStringUTF16( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE)); + IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NET_PROTECTED)); localized_strings->SetString("inetRememberNetwork", l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_AUTO_CONNECT)); @@ -505,19 +505,8 @@ void InternetOptionsHandler::SetDetailsCallback(const ListValue* args) { return; bool changed = false; if (network->encrypted()) { - std::string password; - - if (args->GetSize() != 5 || - !args->GetString(4, &password)) { - NOTREACHED(); - return; - } - if (password != network->passphrase()) { - network->set_passphrase(password); - changed = true; - } - - if (network->encryption() == chromeos::SECURITY_8021X) { + if (network->encrypted() && + network->encryption() == chromeos::SECURITY_8021X) { std::string ident; std::string certpath; @@ -613,7 +602,6 @@ void InternetOptionsHandler::PopulateDictionaryDetails( dictionary.SetString("certPass",wireless->passphrase()); } else { dictionary.SetBoolean("certNeeded", false); - dictionary.SetString("pass", wireless->passphrase()); } } else { dictionary.SetBoolean("encrypted", false); @@ -640,6 +628,8 @@ void InternetOptionsHandler::PopulateDictionaryDetails( l10n_util::GetStringUTF8(IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL) : l10n_util::GetStringUTF8(IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)); dictionary.SetString("errorState", cellular->GetErrorString()); + dictionary.SetString("supportUrl", + cellular->payment_url()); // Device settings. dictionary.SetString("manufacturer", cellular->manufacturer()); dictionary.SetString("modelId", cellular->model_id()); @@ -677,7 +667,6 @@ void InternetOptionsHandler::PopupWirelessPassword( dictionary.SetString("cert", network->cert_path()); } else { dictionary.SetBoolean("certNeeded", false); - dictionary.SetString("pass", network->passphrase()); } dom_ui_->CallJavascriptFunction( L"options.InternetOptions.showPasswordEntry", dictionary); @@ -713,26 +702,26 @@ void InternetOptionsHandler::LoginCertCallback(const ListValue* args) { std::string service_path; std::string identity; std::string certpath; - std::string password; - - if (args->GetSize() != 4 || + if (args->GetSize() < 3 || !args->GetString(0, &service_path) || !args->GetString(1, &certpath) || - !args->GetString(2, &identity) || - !args->GetString(3, &password)) { - NOTREACHED(); + !args->GetString(2, &identity)) { return; } chromeos::NetworkLibrary* cros = chromeos::CrosLibrary::Get()->GetNetworkLibrary(); chromeos::WifiNetwork* network = cros->FindWifiNetworkByPath(service_path); - if (network) { - cros->ConnectToWifiNetwork( - network, password, identity, certpath); - } else { - // TODO(dhg): Send error back to UI + if (!network) + return; + // If password does not come from the input, use one saved with the + // network details. + std::string password; + if (args->GetSize() != 4 || !args->GetString(3, &password)) { + password = network->passphrase(); } + cros->ConnectToWifiNetwork( + network, password, identity, certpath); } void InternetOptionsHandler::LoginToOtherCallback(const ListValue* args) { diff --git a/chrome/browser/resources/options/chromeos_internet_detail.html b/chrome/browser/resources/options/chromeos_internet_detail.html index 6386f95..de1dbf5 100644 --- a/chrome/browser/resources/options/chromeos_internet_detail.html +++ b/chrome/browser/resources/options/chromeos_internet_detail.html @@ -61,17 +61,7 @@ <section id="passwordNetwork" class="password-details"> <table class="option-control-table"> <tr> - <td class="option-name" i18n-content="inetPass"></td> - <td class="option-value"> - <div class="network-password"> - <input id="inetPass"> - <label style="display: inline;"> - <input id="inetShowPass" type="checkbox" - i18n-values="placeholder:inetPassPrompt"> - <span i18n-content="inetShowPass"></span> - </label> - </div> - </td> + <td class="option-name" i18n-content="inetPassProtected"></td> </tr> </table> </section> @@ -114,7 +104,7 @@ </div> </section> <section> - <div><a id="customerSupport" target="_blank" href="#" + <div><a id="customerSupport" target="_blank" i18n-content="customerSupport"></a></div> </section> </div> diff --git a/chrome/browser/resources/options/chromeos_internet_network_element.js b/chrome/browser/resources/options/chromeos_internet_network_element.js index 930a6be..6d8fdfe 100644 --- a/chrome/browser/resources/options/chromeos_internet_network_element.js +++ b/chrome/browser/resources/options/chromeos_internet_network_element.js @@ -226,7 +226,7 @@ cr.define('options.internet', function() { } } else { // Put "Forget this network" button. - var button = this.createButton_('forget_button', + var button = this.createButton_('forget_button', 'forget', function(e) { chrome.send('buttonClickCallback', [String(self.data.networkType), diff --git a/chrome/browser/resources/options/chromeos_internet_options.js b/chrome/browser/resources/options/chromeos_internet_options.js index eb74c68..1f0f82a 100644 --- a/chrome/browser/resources/options/chromeos_internet_options.js +++ b/chrome/browser/resources/options/chromeos_internet_options.js @@ -97,8 +97,7 @@ cr.define('options', function() { if (data.certinpkcs) { chrome.send('loginToCertNetwork',[String(servicePath), String(data.certPath), - String(data.ident), - String(data.certPass)]); + String(data.ident)]); } else { chrome.send('loginToCertNetwork',[String(servicePath), String($('inetCert').value), @@ -114,16 +113,10 @@ cr.define('options', function() { var newinfo = []; newinfo.push(data.servicePath); newinfo.push($('rememberNetwork').checked ? "true" : "false"); - if (data.encrypted) { - if (data.certneeded) { - newinfo.push($('inetIdent').value); - newinfo.push($('inetCert').value); - newinfo.push($('inetCertPass').value); - } else { - newinfo.push(''); - newinfo.push(''); - newinfo.push($('inetPass').value); - } + if (data.encrypted && data.certNeeded) { + newinfo.push($('inetIdent').value); + newinfo.push($('inetCert').value); + newinfo.push($('inetCertPass').value); } chrome.send('setDetails', newinfo); } @@ -243,32 +236,21 @@ cr.define('options', function() { page.removeAttribute('gsm'); $('inetSsid').textContent = data.ssid; $('rememberNetwork').checked = data.autoConnect; - page.removeAttribute('cert'); page.removeAttribute('password'); + page.removeAttribute('cert'); + page.removeAttribute('certPkcs'); if (data.encrypted) { if (data.certNeeded) { - page.setAttribute('cert', true); if (data.certInPkcs) { page.setAttribute('certPkcs', true); $('inetIdentPkcs').value = data.ident; } else { - page.removeAttribute('certPkcs'); + page.setAttribute('cert', true); $('inetIdent').value = data.ident; $('inetCert').value = data.certPath; - $('inetCertPass').value = data.certPass; } } else { page.setAttribute('password', true); - var passfield = $('inetPass'); - passfield.value = data.pass; - passfield.type = 'password'; - $('inetShowPass').addEventListener('change', function(e) { - if ($('inetShowPass').checked) { - passfield.type = 'text'; - } else { - passfield.type = 'password'; - } - }); } } } else if(data.type == 5) { @@ -284,6 +266,7 @@ cr.define('options', function() { $('roamingState').textContent = data.roamingState; $('restrictedPool').textContent = data.restrictedPool; $('errorState').textContent = data.errorState; + $('customerSupport').href = data.supportUrl; $('manufacturer').textContent = data.manufacturer; $('modelId').textContent = data.modelId; $('firmwareRevision').textContent = data.firmwareRevision; |