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); |