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

Unified Diff: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc

Issue 323093003: Add the Sign-At-Most-Once restriction the enterprise.platformKeys API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 6 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/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
index d9cd9b2e6ef076474a5063c82178a0d03fa09b1c..7ee7fb077350060d3f9f9e51fdc9f6065db8875a 100644
--- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
+++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
@@ -7,6 +7,8 @@
#include "base/bind.h"
#include "base/values.h"
#include "chrome/browser/chromeos/platform_keys/platform_keys.h"
+#include "chrome/browser/chromeos/platform_keys/platform_keys_service.h"
+#include "chrome/browser/chromeos/platform_keys/platform_keys_service_factory.h"
#include "chrome/common/extensions/api/enterprise_platform_keys.h"
#include "chrome/common/extensions/api/enterprise_platform_keys_internal.h"
#include "content/public/browser/browser_thread.h"
@@ -48,13 +50,18 @@ EnterprisePlatformKeysInternalGenerateKeyFunction::Run() {
if (!ValidateToken(params->token_id))
return RespondNow(Error(kErrorInvalidToken));
- chromeos::platform_keys::GenerateRSAKey(
+ chromeos::PlatformKeysService* service =
+ chromeos::PlatformKeysServiceFactory::GetForBrowserContext(
+ browser_context());
+ DCHECK(service);
+
+ service->GenerateRSAKey(
params->token_id,
params->modulus_length,
+ extension_id(),
base::Bind(
&EnterprisePlatformKeysInternalGenerateKeyFunction::OnGeneratedKey,
- this),
- browser_context());
+ this));
return RespondLater();
}
@@ -82,12 +89,17 @@ EnterprisePlatformKeysInternalSignFunction::Run() {
if (!ValidateToken(params->token_id))
return RespondNow(Error(kErrorInvalidToken));
- chromeos::platform_keys::Sign(
+ chromeos::PlatformKeysService* service =
+ chromeos::PlatformKeysServiceFactory::GetForBrowserContext(
+ browser_context());
+ DCHECK(service);
+
+ service->Sign(
params->token_id,
params->public_key,
params->data,
- base::Bind(&EnterprisePlatformKeysInternalSignFunction::OnSigned, this),
- browser_context());
+ extension_id(),
+ base::Bind(&EnterprisePlatformKeysInternalSignFunction::OnSigned, this));
return RespondLater();
}
« no previous file with comments | « chrome/browser/chromeos/platform_keys/platform_keys_service_factory.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698