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