Add attachment digests

// FREEBIE
This commit is contained in:
lilia 2017-03-07 16:54:15 -08:00
parent f1a1a819ba
commit 43de0cc2ec
5 changed files with 65 additions and 10 deletions

View file

@ -338,10 +338,12 @@ MessageReceiver.prototype.extend({
return textsecure.storage.get('blocked', []).indexOf(number) >= 0;
},
handleAttachment: function(attachment) {
var digest = attachment.digest ? attachment.digest.toArrayBuffer() : undefined;
function decryptAttachment(encrypted) {
return textsecure.crypto.decryptAttachment(
encrypted,
attachment.key.toArrayBuffer()
attachment.key.toArrayBuffer(),
digest
);
}