mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
clear private key from memory only when locked
This commit is contained in:
@@ -285,13 +285,18 @@ function initCryptoService(constantsService) {
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
CryptoService.prototype.clearPrivateKey = function () {
|
||||
CryptoService.prototype.clearPrivateKey = function (memoryOnly) {
|
||||
var deferred = Q.defer();
|
||||
|
||||
_privateKey = null;
|
||||
chrome.storage.local.remove('encPrivateKey', function () {
|
||||
if (memoryOnly) {
|
||||
deferred.resolve();
|
||||
});
|
||||
}
|
||||
else {
|
||||
chrome.storage.local.remove('encPrivateKey', function () {
|
||||
deferred.resolve();
|
||||
});
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user