Add attachment digests
// FREEBIE
This commit is contained in:
parent
f1a1a819ba
commit
43de0cc2ec
5 changed files with 65 additions and 10 deletions
|
@ -119,10 +119,11 @@ MessageSender.prototype = {
|
|||
proto.key = libsignal.crypto.getRandomBytes(64);
|
||||
|
||||
var iv = libsignal.crypto.getRandomBytes(16);
|
||||
return textsecure.crypto.encryptAttachment(attachment.data, proto.key, iv).then(function(encryptedBin) {
|
||||
return this.server.putAttachment(encryptedBin).then(function(id) {
|
||||
return textsecure.crypto.encryptAttachment(attachment.data, proto.key, iv).then(function(result) {
|
||||
return this.server.putAttachment(result.ciphertext).then(function(id) {
|
||||
proto.id = id;
|
||||
proto.contentType = attachment.contentType;
|
||||
proto.digest = result.digest;
|
||||
return proto;
|
||||
});
|
||||
}.bind(this));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue