clear enc key from memory on lock as well

This commit is contained in:
Kyle Spearrin 2017-06-13 11:59:26 -04:00
parent e079b70e6a
commit 6e9d4e8d6e
2 changed files with 10 additions and 4 deletions

View File

@ -284,13 +284,18 @@ function initCryptoService(constantsService) {
return deferred.promise; return deferred.promise;
}; };
CryptoService.prototype.clearEncKey = function () { CryptoService.prototype.clearEncKey = function (memoryOnly) {
var deferred = Q.defer(); var deferred = Q.defer();
_encKey = null; _encKey = null;
if (memoryOnly) {
deferred.resolve();
}
else {
chrome.storage.local.remove('encKey', function () { chrome.storage.local.remove('encKey', function () {
deferred.resolve(); deferred.resolve();
}); });
}
return deferred.promise; return deferred.promise;
}; };

View File

@ -73,7 +73,8 @@ function initLockService(self) {
return Q.all([ return Q.all([
self.cryptoService.clearKey(), self.cryptoService.clearKey(),
self.cryptoService.clearOrgKeys(true), self.cryptoService.clearOrgKeys(true),
self.cryptoService.clearPrivateKey(true) self.cryptoService.clearPrivateKey(true),
self.cryptoService.clearEncKey(true)
]).then(function () { ]).then(function () {
self.setIcon(); self.setIcon();
self.folderService.clearCache(); self.folderService.clearCache();