mirror of https://github.com/BTCPrivate/copay.git
fix references
This commit is contained in:
parent
7942048dd1
commit
5ca398a97a
|
@ -1,6 +1,7 @@
|
|||
var cryptoUtil = require('../util/crypto');
|
||||
var InsightStorage = require('./InsightStorage');
|
||||
var inherits = require('inherits');
|
||||
var log = require('../log');
|
||||
|
||||
function EncryptedInsightStorage(config) {
|
||||
InsightStorage.apply(this, [config]);
|
||||
|
@ -16,16 +17,17 @@ EncryptedInsightStorage.prototype._brokenDecrypt = function(body) {
|
|||
};
|
||||
|
||||
EncryptedInsightStorage.prototype.getItem = function(name, callback) {
|
||||
var self = this;
|
||||
InsightStorage.prototype.getItem.apply(this, [name,
|
||||
function(err, body) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
var decryptedJson = cryptoUtil.decrypt(this.password, body);
|
||||
log.debug('Could not decrypt value using current decryption schema');
|
||||
var decryptedJson = cryptoUtil.decrypt(self.password, body);
|
||||
|
||||
if (!decryptedJson) {
|
||||
decryptedJson = this._brokenDecrypt(body);
|
||||
log.debug('Could not decrypt value using current decryption schema');
|
||||
decryptedJson = self._brokenDecrypt(body);
|
||||
}
|
||||
|
||||
if (!decryptedJson) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
var cryptoUtil = require('../util/crypto');
|
||||
var log = require('../log');
|
||||
var LocalStorage = require('./LocalStorage');
|
||||
var inherits = require('inherits');
|
||||
|
||||
|
@ -17,13 +18,14 @@ EncryptedLocalStorage.prototype._brokenDecrypt = function(body) {
|
|||
|
||||
|
||||
EncryptedLocalStorage.prototype.getItem = function(name, callback) {
|
||||
var self = this;
|
||||
LocalStorage.prototype.getItem.apply(this, [name,
|
||||
function(err, body) {
|
||||
var decryptedJson = cryptoUtil.decrypt(this.password, body);
|
||||
log.debug('Could not decrypt value using current decryption schema');
|
||||
var decryptedJson = cryptoUtil.decrypt(self.password, body);
|
||||
|
||||
if (!decryptedJson) {
|
||||
decryptedJson = this._brokenDecrypt(body);
|
||||
log.debug('Could not decrypt value using current decryption schema');
|
||||
decryptedJson = self._brokenDecrypt(body);
|
||||
}
|
||||
|
||||
if (!decryptedJson) {
|
||||
|
|
Loading…
Reference in New Issue