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

Unified Diff: components/ownership/owner_settings_service.cc

Issue 2828593003: Fix crash on login. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ownership/owner_settings_service.cc
diff --git a/components/ownership/owner_settings_service.cc b/components/ownership/owner_settings_service.cc
index ca969d2a45d86bbb4912c7db073b9fd31176c06c..49b0b3aab6c20fa83ce9d00b24591ac7119ff8db 100644
--- a/components/ownership/owner_settings_service.cc
+++ b/components/ownership/owner_settings_service.cc
@@ -32,7 +32,9 @@ using ScopedSGNContext = std::unique_ptr<
std::unique_ptr<em::PolicyFetchResponse> AssembleAndSignPolicy(
std::unique_ptr<em::PolicyData> policy,
- SECKEYPrivateKey* private_key) {
+ scoped_refptr<ownership::PrivateKey> private_key) {
+ DCHECK(private_key->key());
+
// Assemble the policy.
std::unique_ptr<em::PolicyFetchResponse> policy_response(
new em::PolicyFetchResponse());
@@ -41,8 +43,8 @@ std::unique_ptr<em::PolicyFetchResponse> AssembleAndSignPolicy(
return nullptr;
}
- ScopedSGNContext sign_context(
- SGN_NewContext(SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION, private_key));
+ ScopedSGNContext sign_context(SGN_NewContext(
+ SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION, private_key->key()));
if (!sign_context) {
NOTREACHED();
return nullptr;
@@ -109,10 +111,8 @@ bool OwnerSettingsService::AssembleAndSignPolicyAsync(
if (!task_runner || !IsOwner())
return false;
return base::PostTaskAndReplyWithResult(
- task_runner,
- FROM_HERE,
- base::Bind(
- &AssembleAndSignPolicy, base::Passed(&policy), private_key_->key()),
+ task_runner, FROM_HERE,
+ base::Bind(&AssembleAndSignPolicy, base::Passed(&policy), private_key_),
callback);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698