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

Unified Diff: chrome/browser/chromeos/attestation/platform_verification_flow.cc

Issue 27044004: Added multi-profile support for attestation on chromeos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added OWNERS Created 7 years, 2 months 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
Index: chrome/browser/chromeos/attestation/platform_verification_flow.cc
diff --git a/chrome/browser/chromeos/attestation/platform_verification_flow.cc b/chrome/browser/chromeos/attestation/platform_verification_flow.cc
index ab2a53b151bb88ad5a57cc0d2b57cf27548b28af..0ac2df63a8217d9b88b1296a8d5949c0efb2d3a5 100644
--- a/chrome/browser/chromeos/attestation/platform_verification_flow.cc
+++ b/chrome/browser/chromeos/attestation/platform_verification_flow.cc
@@ -238,21 +238,30 @@ void PlatformVerificationFlow::OnConsentResponse(
// At this point all user interaction is complete and we can proceed with the
// certificate request.
+ chromeos::User* user = user_manager_->GetUserByProfile(
bartfab (slow) 2013/10/13 16:31:35 #include "chrome/browser/chromeos/login/user.h"
Darren Krahn 2013/10/15 16:49:06 Done.
+ Profile::FromBrowserContext(web_contents->GetBrowserContext()));
bartfab (slow) 2013/10/13 16:31:35 #include "content/public/browser/browser_context.h
Darren Krahn 2013/10/15 16:49:06 Done.
+ if (!user) {
+ ReportError(callback, INTERNAL_ERROR);
+ LOG(ERROR) << "Profile does not map to a valid user.";
+ return;
+ }
AttestationFlow::CertificateCallback certificate_callback = base::Bind(
&PlatformVerificationFlow::OnCertificateReady,
weak_factory_.GetWeakPtr(),
+ user->email(),
service_id,
challenge,
callback);
attestation_flow_->GetCertificate(
PROFILE_CONTENT_PROTECTION_CERTIFICATE,
- user_manager_->GetActiveUser()->email(),
+ user->email(),
service_id,
false, // Don't force a new key.
certificate_callback);
}
void PlatformVerificationFlow::OnCertificateReady(
+ const std::string& user_email,
const std::string& service_id,
const std::string& challenge,
const ChallengeCallback& callback,
@@ -272,6 +281,7 @@ void PlatformVerificationFlow::OnCertificateReady(
std::string key_name = kContentProtectionKeyPrefix;
key_name += service_id;
async_caller_->TpmAttestationSignSimpleChallenge(KEY_USER,
+ user_email,
key_name,
challenge,
cryptohome_callback);

Powered by Google App Engine
This is Rietveld 408576698