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

Unified Diff: chrome/browser/chromeos/platform_keys/platform_keys_service.cc

Issue 884073002: Implement chrome.platformKeys.getKeyPair(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_impl2
Patch Set: Rebased. Created 5 years, 11 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/platform_keys/platform_keys_service.cc
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys_service.cc b/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
index 07974de472282dbc5ac5757c0e79498c92638fdd..07f256ed495e0edcbcd502326a524a1ecae9802d 100644
--- a/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
+++ b/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
@@ -70,6 +70,7 @@ PlatformKeysService::PlatformKeysService(
extensions::StateStore* state_store)
: browser_context_(browser_context),
state_store_(state_store),
+ permission_check_disabled_(false),
weak_factory_(this) {
DCHECK(state_store);
}
@@ -77,6 +78,10 @@ PlatformKeysService::PlatformKeysService(
PlatformKeysService::~PlatformKeysService() {
}
+void PlatformKeysService::DisablePermissionCheckForTesting() {
+ permission_check_disabled_ = true;
+}
+
void PlatformKeysService::GenerateRSAKey(const std::string& token_id,
unsigned int modulus_length,
const std::string& extension_id,
@@ -213,7 +218,8 @@ void PlatformKeysService::InvalidateKey(
GetPublicKeyValue(public_key_spki_der));
size_t index = 0;
- if (!platform_keys->Remove(*key_value, &index)) {
+ if (!platform_keys->Remove(*key_value, &index) &&
+ !permission_check_disabled_) {
Ryan Sleevi 2015/02/03 01:44:50 I've read this code multiple times and I'm still c
pneubeck (no reviews) 2015/02/03 20:15:00 reordered to make it clearer.
// The key is not found, so it's not valid to use it for signing.
callback.Run(false);
return;

Powered by Google App Engine
This is Rietveld 408576698