Update libsignal-protocol v0.11.0
* Changes return type from decryption functions * Update components // FREEBIE
This commit is contained in:
parent
148bd32671
commit
f16803018c
3 changed files with 10968 additions and 8536 deletions
4678
js/libtextsecure.js
4678
js/libtextsecure.js
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -192,15 +192,13 @@ MessageReceiver.prototype.extend({
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
handleLegacyMessage: function (envelope) {
|
handleLegacyMessage: function (envelope) {
|
||||||
return this.decrypt(envelope, envelope.legacyMessage).then(function(result) {
|
return this.decrypt(envelope, envelope.legacyMessage).then(function(plaintext) {
|
||||||
var plaintext = result[0]; // array buffer
|
|
||||||
var message = textsecure.protobuf.DataMessage.decode(plaintext);
|
var message = textsecure.protobuf.DataMessage.decode(plaintext);
|
||||||
return this.handleDataMessage(envelope, message);
|
return this.handleDataMessage(envelope, message);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
handleContentMessage: function (envelope) {
|
handleContentMessage: function (envelope) {
|
||||||
return this.decrypt(envelope, envelope.content).then(function(result) {
|
return this.decrypt(envelope, envelope.content).then(function(plaintext) {
|
||||||
var plaintext = result[0]; // array buffer
|
|
||||||
var content = textsecure.protobuf.Content.decode(plaintext);
|
var content = textsecure.protobuf.Content.decode(plaintext);
|
||||||
if (content.syncMessage) {
|
if (content.syncMessage) {
|
||||||
return this.handleSyncMessage(envelope, content.syncMessage);
|
return this.handleSyncMessage(envelope, content.syncMessage);
|
||||||
|
@ -331,8 +329,8 @@ MessageReceiver.prototype.extend({
|
||||||
var address = libsignal.SignalProtocolAddress.fromString(from);
|
var address = libsignal.SignalProtocolAddress.fromString(from);
|
||||||
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
|
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
|
||||||
console.log('retrying prekey whisper message');
|
console.log('retrying prekey whisper message');
|
||||||
return this.decryptPreKeyWhisperMessage(ciphertext, sessionCipher, address).then(function(res) {
|
return this.decryptPreKeyWhisperMessage(ciphertext, sessionCipher, address).then(function(plaintext) {
|
||||||
var finalMessage = textsecure.protobuf.DataMessage.decode(res[0]);
|
var finalMessage = textsecure.protobuf.DataMessage.decode(plaintext);
|
||||||
|
|
||||||
var p = Promise.resolve();
|
var p = Promise.resolve();
|
||||||
if ((finalMessage.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION)
|
if ((finalMessage.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION)
|
||||||
|
|
Loading…
Reference in a new issue