1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-24 16:49:26 +01:00

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;
};
CryptoService.prototype.clearEncKey = function () {
CryptoService.prototype.clearEncKey = function (memoryOnly) {
var deferred = Q.defer();
_encKey = null;
chrome.storage.local.remove('encKey', function () {
if (memoryOnly) {
deferred.resolve();
});
}
else {
chrome.storage.local.remove('encKey', function () {
deferred.resolve();
});
}
return deferred.promise;
};

View File

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