Copy getRandomBytes from libaxolotl to libtextsecure

This commit is contained in:
Matt Corallo 2015-01-15 21:57:48 -10:00 committed by lilia
parent 12844590f5
commit 7d2d2d92fc
4 changed files with 14 additions and 11 deletions

View file

@ -232,9 +232,9 @@ window.textsecure.messaging = function() {
makeAttachmentPointer = function(attachment) {
var proto = new textsecure.protobuf.PushMessageContent.AttachmentPointer();
proto.key = axolotl.crypto.getRandomBytes(64);
proto.key = textsecure.crypto.getRandomBytes(64);
var iv = axolotl.crypto.getRandomBytes(16);
var iv = textsecure.crypto.getRandomBytes(16);
return textsecure.crypto.encryptAttachment(attachment.data, proto.key, iv).then(function(encryptedBin) {
return textsecure.api.putAttachment(encryptedBin).then(function(id) {
proto.id = id;