clear private key from memory only when locked
This commit is contained in:
parent
96be646641
commit
5b6c8c3480
|
@ -285,13 +285,18 @@ function initCryptoService(constantsService) {
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
CryptoService.prototype.clearPrivateKey = function () {
|
CryptoService.prototype.clearPrivateKey = function (memoryOnly) {
|
||||||
var deferred = Q.defer();
|
var deferred = Q.defer();
|
||||||
|
|
||||||
_privateKey = null;
|
_privateKey = null;
|
||||||
chrome.storage.local.remove('encPrivateKey', function () {
|
if (memoryOnly) {
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
});
|
}
|
||||||
|
else {
|
||||||
|
chrome.storage.local.remove('encPrivateKey', function () {
|
||||||
|
deferred.resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,8 +68,11 @@ function initLockService(self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LockService.prototype.lock = function () {
|
LockService.prototype.lock = function () {
|
||||||
Q.all([self.cryptoService.clearKey(), self.cryptoService.clearOrgKeys(true)]).then(function () {
|
Q.all([
|
||||||
self.cryptoService.clearPrivateKey();
|
self.cryptoService.clearKey(),
|
||||||
|
self.cryptoService.clearOrgKeys(true),
|
||||||
|
self.cryptoService.clearPrivateKey(true)
|
||||||
|
]).then(function () {
|
||||||
self.setIcon();
|
self.setIcon();
|
||||||
self.folderService.clearCache();
|
self.folderService.clearCache();
|
||||||
self.loginService.clearCache();
|
self.loginService.clearCache();
|
||||||
|
|
Loading…
Reference in New Issue