summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/login
diff options
context:
space:
mode:
authorglotov@chromium.org <glotov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 18:18:03 +0000
committerglotov@chromium.org <glotov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 18:18:03 +0000
commitf69fedc23cc248a5987ff1cd7dfe03c7cf2af0f9 (patch)
tree95e50b9094efb2598a3c9e9620e6a26d316829e8 /chrome/browser/chromeos/login
parente275537bf27ef209554afde9adf66bd04e367cbc (diff)
downloadchromium_src-f69fedc23cc248a5987ff1cd7dfe03c7cf2af0f9.zip
chromium_src-f69fedc23cc248a5987ff1cd7dfe03c7cf2af0f9.tar.gz
chromium_src-f69fedc23cc248a5987ff1cd7dfe03c7cf2af0f9.tar.bz2
TPM ownership code added to OOBE
BUG=chromium-os:3065 TEST=TPM password should appear in the "System security setting" of the EULA screen after TPM has been cleared and rebooted. Review URL: http://codereview.chromium.org/3516020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61985 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/login')
-rw-r--r--chrome/browser/chromeos/login/eula_view.cc25
-rw-r--r--chrome/browser/chromeos/login/eula_view.h5
2 files changed, 22 insertions, 8 deletions
diff --git a/chrome/browser/chromeos/login/eula_view.cc b/chrome/browser/chromeos/login/eula_view.cc
index 13738ea..d9c9b4d 100644
--- a/chrome/browser/chromeos/login/eula_view.cc
+++ b/chrome/browser/chromeos/login/eula_view.cc
@@ -221,6 +221,14 @@ static GURL GetOemEulaPagePath() {
}
void EulaView::Init() {
+ // First, command to own the TPM.
+ if (chromeos::CrosLibrary::Get()->EnsureLoaded()) {
+ chromeos::CryptohomeTpmCanAttemptOwnership();
+ } else {
+ LOG(ERROR) << "Cros library not loaded. "
+ << "We must have disabled the link that led here.";
+ }
+
// Use rounded rect background.
views::Painter* painter = CreateWizardPainter(
&BorderDefinition::kScreenBorder);
@@ -364,14 +372,15 @@ void EulaView::LinkActivated(views::Link* source, int event_flags) {
help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE);
} else if (source == system_security_settings_link_) {
// Pull the password from TPM.
- std::string password;
- if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) {
- LOG(ERROR) << "Cros library not loaded. "
- << "We must have disabled the link that led here.";
- return;
- } else if (chromeos::CryptohomeTpmIsReady() &&
- chromeos::CryptohomeTpmGetPassword(&password)) {
- TpmInfoView* view = new TpmInfoView(ASCIIToWide(password));
+ bool password_acquired = false;
+ if (tpm_password_.empty() && chromeos::CryptohomeTpmIsReady()) {
+ // TODO(glotov): Sanitize memory used to store password when
+ // it's destroyed.
+ password_acquired = chromeos::CryptohomeTpmGetPassword(&tpm_password_);
+ chromeos::CryptohomeTpmClearStoredPassword();
+ }
+ if (!tpm_password_.empty() || password_acquired) {
+ TpmInfoView* view = new TpmInfoView(ASCIIToWide(tpm_password_));
view->Init();
views::Window* window = browser::CreateViewsWindow(
GetNativeWindow(), gfx::Rect(), view);
diff --git a/chrome/browser/chromeos/login/eula_view.h b/chrome/browser/chromeos/login/eula_view.h
index 6487873..e7fc027 100644
--- a/chrome/browser/chromeos/login/eula_view.h
+++ b/chrome/browser/chromeos/login/eula_view.h
@@ -149,6 +149,11 @@ class EulaView
// it will be deleted on bubble closing.
MessageBubble* bubble_;
+ // TPM password local storage. By convention, we clear the password
+ // from TPM as soon as we read it. We store it here locally until
+ // EULA screen is closed.
+ std::string tpm_password_;
+
DISALLOW_COPY_AND_ASSIGN(EulaView);
};