mirror of https://github.com/BTCPrivate/copay.git
do not encrypt profiles in mobile
This commit is contained in:
parent
178efda594
commit
e78adf1bb8
|
@ -25,13 +25,17 @@ angular.module('copayApp.services')
|
||||||
};
|
};
|
||||||
|
|
||||||
var encryptOnMobile = function(text, cb) {
|
var encryptOnMobile = function(text, cb) {
|
||||||
getUUID(function(uuid) {
|
|
||||||
if (uuid) {
|
// UUID encryption is disabled.
|
||||||
$log.debug('Encrypting profile');
|
return cb(null, text);
|
||||||
text = sjcl.encrypt(uuid, text);
|
//
|
||||||
}
|
// getUUID(function(uuid) {
|
||||||
return cb(null, text);
|
// if (uuid) {
|
||||||
});
|
// $log.debug('Encrypting profile');
|
||||||
|
// text = sjcl.encrypt(uuid, text);
|
||||||
|
// }
|
||||||
|
// return cb(null, text);
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,8 +47,10 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
if (!json) return cb('Could not access storage')
|
if (!json) return cb('Could not access storage')
|
||||||
|
|
||||||
if (!json.iter || !json.ct)
|
if (!json.iter || !json.ct) {
|
||||||
|
$log.debug('Profile is not encrypted');
|
||||||
return cb(null, text);
|
return cb(null, text);
|
||||||
|
}
|
||||||
|
|
||||||
$log.debug('Profile is encrypted');
|
$log.debug('Profile is encrypted');
|
||||||
getUUID(function(uuid) {
|
getUUID(function(uuid) {
|
||||||
|
@ -111,7 +117,6 @@ angular.module('copayApp.services')
|
||||||
storage.get('profile', function(err, str) {
|
storage.get('profile', function(err, str) {
|
||||||
|
|
||||||
if (err || !str)
|
if (err || !str)
|
||||||
// Migrate ?
|
|
||||||
return cb(err);
|
return cb(err);
|
||||||
|
|
||||||
decryptOnMobile(str, function(err, str) {
|
decryptOnMobile(str, function(err, str) {
|
||||||
|
@ -120,6 +125,7 @@ angular.module('copayApp.services')
|
||||||
try {
|
try {
|
||||||
p = Profile.fromString(str);
|
p = Profile.fromString(str);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
$log.debug('Could not read profile:', e);
|
||||||
err = new Error('Could not read profile:' + p);
|
err = new Error('Could not read profile:' + p);
|
||||||
}
|
}
|
||||||
return cb(err, p);
|
return cb(err, p);
|
||||||
|
|
Loading…
Reference in New Issue