This repository was archived by the owner on Aug 5, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -35813,7 +35813,7 @@ SessionBuilder.prototype = {
3581335813 processPreKey: function(device) {
3581435814 return Internal.SessionLock.queueJobForNumber(this.remoteAddress.toString(), function() {
3581535815 return this.storage.isTrustedIdentity(
35816- this.remoteAddress.getName(), device.identityKey
35816+ this.remoteAddress.getName(), device.identityKey, this.storage.Direction.SENDING
3581735817 ).then(function(trusted) {
3581835818 if (!trusted) {
3581935819 throw new Error('Identity key changed');
@@ -35866,7 +35866,7 @@ SessionBuilder.prototype = {
3586635866 processV3: function(record, message) {
3586735867 var preKeyPair, signedPreKeyPair, session;
3586835868 return this.storage.isTrustedIdentity(
35869- this.remoteAddress.getName(), message.identityKey.toArrayBuffer()
35869+ this.remoteAddress.getName(), message.identityKey.toArrayBuffer(), this.storage.Direction.RECEIVING
3587035870 ).then(function(trusted) {
3587135871 if (!trusted) {
3587235872 var e = new Error('Unknown identity key');
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ SessionBuilder.prototype = {
77 processPreKey : function ( device ) {
88 return Internal . SessionLock . queueJobForNumber ( this . remoteAddress . toString ( ) , function ( ) {
99 return this . storage . isTrustedIdentity (
10- this . remoteAddress . getName ( ) , device . identityKey
10+ this . remoteAddress . getName ( ) , device . identityKey , this . storage . Direction . SENDING
1111 ) . then ( function ( trusted ) {
1212 if ( ! trusted ) {
1313 throw new Error ( 'Identity key changed' ) ;
@@ -60,7 +60,7 @@ SessionBuilder.prototype = {
6060 processV3 : function ( record , message ) {
6161 var preKeyPair , signedPreKeyPair , session ;
6262 return this . storage . isTrustedIdentity (
63- this . remoteAddress . getName ( ) , message . identityKey . toArrayBuffer ( )
63+ this . remoteAddress . getName ( ) , message . identityKey . toArrayBuffer ( ) , this . storage . Direction . RECEIVING
6464 ) . then ( function ( trusted ) {
6565 if ( ! trusted ) {
6666 var e = new Error ( 'Unknown identity key' ) ;
Original file line number Diff line number Diff line change 1- function SignalProtocolStore ( ) {
1+ function SignalProtocolStore ( ) {
22 this . store = { } ;
33}
44
55SignalProtocolStore . prototype = {
6+ Direction : {
7+ SENDING : 1 ,
8+ RECEIVING : 2 ,
9+ } ,
10+
611 getIdentityKeyPair : function ( ) {
712 return Promise . resolve ( this . get ( 'identityKey' ) ) ;
813 } ,
@@ -29,7 +34,7 @@ SignalProtocolStore.prototype = {
2934 delete this . store [ key ] ;
3035 } ,
3136
32- isTrustedIdentity : function ( identifier , identityKey ) {
37+ isTrustedIdentity : function ( identifier , identityKey , direction ) {
3338 if ( identifier === null || identifier === undefined ) {
3439 throw new Error ( "tried to check identity key for undefined/null key" ) ;
3540 }
You can’t perform that action at this time.
0 commit comments