Fix buffer concatenation

TypedArray.prototype.set doesn't handle ArrayBuffers correctly (it
writes all zeros). Instead, wrap each ArrayBuffer in a typed array
for concatenation.
This commit is contained in:
lilia 2014-10-25 23:07:14 -07:00
parent e07759a93c
commit b69db59ad4
2 changed files with 5 additions and 5 deletions

View file

@ -594,7 +594,7 @@ window.textsecure.subscribeToPush = function(message_callback) {
var handleAttachment = function(attachment) {
return textsecure.api.getAttachment(attachment.id.toString()).then(function(encryptedBin) {
return textsecure.crypto.decryptAttachment(encryptedBin, toArrayBuffer(attachment.key)).then(function(decryptedBin) {
return textsecure.crypto.decryptAttachment(encryptedBin, attachment.key.toArrayBuffer()).then(function(decryptedBin) {
attachment.decrypted = decryptedBin;
});
});