mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Additional logging when we can't decrypt a user's profile (#1483)
Found a number of 'Illegal buffer' errors in an Electron log submitted today. As far as I can tell, these same profiles are succeedig for me, so it's time to collect more data. FREEBIE
This commit is contained in:
@@ -816,7 +816,12 @@
|
||||
// fail
|
||||
if (e.name === 'ProfileDecryptError') {
|
||||
// probably the profile key has changed.
|
||||
console.log('decryptProfile error:', e);
|
||||
console.log(
|
||||
'decryptProfile error:',
|
||||
id,
|
||||
profile,
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
}
|
||||
});
|
||||
}.bind(this));
|
||||
@@ -831,18 +836,23 @@
|
||||
var key = this.get('profileKey');
|
||||
if (!key) { return; }
|
||||
|
||||
// decode
|
||||
var data = dcodeIO.ByteBuffer.wrap(encryptedName, 'base64').toArrayBuffer();
|
||||
try {
|
||||
// decode
|
||||
var data = dcodeIO.ByteBuffer.wrap(encryptedName, 'base64').toArrayBuffer();
|
||||
|
||||
// decrypt
|
||||
return textsecure.crypto.decryptProfileName(data, key).then(function(decrypted) {
|
||||
// decrypt
|
||||
return textsecure.crypto.decryptProfileName(data, key).then(function(decrypted) {
|
||||
|
||||
// encode
|
||||
var name = dcodeIO.ByteBuffer.wrap(decrypted).toString('utf8');
|
||||
// encode
|
||||
var name = dcodeIO.ByteBuffer.wrap(decrypted).toString('utf8');
|
||||
|
||||
// set
|
||||
this.set({profileName: name});
|
||||
}.bind(this));
|
||||
// set
|
||||
this.set({profileName: name});
|
||||
}.bind(this));
|
||||
}
|
||||
catch (e) {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
},
|
||||
setProfileAvatar: function(avatarPath) {
|
||||
if (!avatarPath) { return; }
|
||||
|
||||
Reference in New Issue
Block a user