Remove decryptWhisperMessage from protocol_wrapper
// FREEBIE
This commit is contained in:
parent
891ddacd35
commit
8010a09045
3 changed files with 6 additions and 16 deletions
|
@ -35493,13 +35493,6 @@ Internal.SessionLock.queueJobForNumber = function queueJobForNumber(number, runJ
|
|||
|
||||
window.textsecure = window.textsecure || {};
|
||||
window.textsecure.protocol_wrapper = {
|
||||
decryptWhisperMessage: function(fromAddress, message) {
|
||||
return queueJobForNumber(fromAddress, function() {
|
||||
var address = libsignal.SignalProtocolAddress.fromString(fromAddress);
|
||||
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
|
||||
return sessionCipher.decryptWhisperMessage(message.toArrayBuffer());
|
||||
});
|
||||
},
|
||||
closeOpenSessionForDevice: function(encodedNumber) {
|
||||
return queueJobForNumber(encodedNumber, function() {
|
||||
return protocolInstance.closeOpenSessionForDevice(encodedNumber);
|
||||
|
@ -37134,9 +37127,11 @@ MessageReceiver.prototype.extend({
|
|||
decrypt: function(envelope, ciphertext) {
|
||||
var fromAddress = [envelope.source , (envelope.sourceDevice || 0)].join('.');
|
||||
var promise;
|
||||
var address = new libsignal.SignalProtocolAddress(envelope.source, envelope.sourceDevice);
|
||||
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
|
||||
switch(envelope.type) {
|
||||
case textsecure.protobuf.Envelope.Type.CIPHERTEXT:
|
||||
promise = textsecure.protocol_wrapper.decryptWhisperMessage(fromAddress, ciphertext);
|
||||
promise = sessionCipher.decryptWhisperMessage(ciphertext.toArrayBuffer());
|
||||
break;
|
||||
case textsecure.protobuf.Envelope.Type.PREKEY_BUNDLE:
|
||||
promise = textsecure.protocol_wrapper.handlePreKeyWhisperMessage(fromAddress, ciphertext);
|
||||
|
|
|
@ -111,9 +111,11 @@ MessageReceiver.prototype.extend({
|
|||
decrypt: function(envelope, ciphertext) {
|
||||
var fromAddress = [envelope.source , (envelope.sourceDevice || 0)].join('.');
|
||||
var promise;
|
||||
var address = new libsignal.SignalProtocolAddress(envelope.source, envelope.sourceDevice);
|
||||
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
|
||||
switch(envelope.type) {
|
||||
case textsecure.protobuf.Envelope.Type.CIPHERTEXT:
|
||||
promise = textsecure.protocol_wrapper.decryptWhisperMessage(fromAddress, ciphertext);
|
||||
promise = sessionCipher.decryptWhisperMessage(ciphertext.toArrayBuffer());
|
||||
break;
|
||||
case textsecure.protobuf.Envelope.Type.PREKEY_BUNDLE:
|
||||
promise = textsecure.protocol_wrapper.handlePreKeyWhisperMessage(fromAddress, ciphertext);
|
||||
|
|
|
@ -28,13 +28,6 @@
|
|||
|
||||
window.textsecure = window.textsecure || {};
|
||||
window.textsecure.protocol_wrapper = {
|
||||
decryptWhisperMessage: function(fromAddress, message) {
|
||||
return queueJobForNumber(fromAddress, function() {
|
||||
var address = libsignal.SignalProtocolAddress.fromString(fromAddress);
|
||||
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
|
||||
return sessionCipher.decryptWhisperMessage(message.toArrayBuffer());
|
||||
});
|
||||
},
|
||||
closeOpenSessionForDevice: function(encodedNumber) {
|
||||
return queueJobForNumber(encodedNumber, function() {
|
||||
return protocolInstance.closeOpenSessionForDevice(encodedNumber);
|
||||
|
|
Loading…
Reference in a new issue