Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit 1fe18c3

Browse files
committed
Always pass the full address to saveIdentity
For consistency, and so the storage interface implementation can make descisions about archiving sibling sessions.
1 parent b65f69a commit 1fe18c3

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

dist/libsignal-protocol.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35857,7 +35857,7 @@ SessionBuilder.prototype = {
3585735857
record.updateSessionState(session);
3585835858
return Promise.all([
3585935859
this.storage.storeSession(address, record.serialize()),
35860-
this.storage.saveIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey)
35860+
this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey)
3586135861
]);
3586235862
}.bind(this));
3586335863
}.bind(this));
@@ -35914,7 +35914,7 @@ SessionBuilder.prototype = {
3591435914
// end of decryptWhisperMessage ... to ensure that the sender
3591535915
// actually holds the private keys for all reported pubkeys
3591635916
record.updateSessionState(new_session);
35917-
return this.storage.saveIdentity(this.remoteAddress.getName(), message.identityKey.toArrayBuffer()).then(function() {
35917+
return this.storage.saveIdentity(this.remoteAddress.toString(), message.identityKey.toArrayBuffer()).then(function() {
3591835918
return message.preKeyId;
3591935919
});
3592035920
}.bind(this));
@@ -36117,7 +36117,7 @@ SessionCipher.prototype = {
3611736117
throw new Error('Identity key changed');
3611836118
}
3611936119
}).then(function() {
36120-
return this.storage.saveIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey);
36120+
return this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey);
3612136121
}.bind(this)).then(function() {
3612236122
record.updateSessionState(session);
3612336123
return this.storage.storeSession(address, record.serialize()).then(function() {
@@ -36199,7 +36199,7 @@ SessionCipher.prototype = {
3619936199
throw new Error('Identity key changed');
3620036200
}
3620136201
}).then(function() {
36202-
return this.storage.saveIdentity(this.remoteAddress.getName(), result.session.indexInfo.remoteIdentityKey);
36202+
return this.storage.saveIdentity(this.remoteAddress.toString(), result.session.indexInfo.remoteIdentityKey);
3620336203
}.bind(this)).then(function() {
3620436204
record.updateSessionState(result.session);
3620536205
return this.storage.storeSession(address, record.serialize()).then(function() {

src/SessionBuilder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ SessionBuilder.prototype = {
5151
record.updateSessionState(session);
5252
return Promise.all([
5353
this.storage.storeSession(address, record.serialize()),
54-
this.storage.saveIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey)
54+
this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey)
5555
]);
5656
}.bind(this));
5757
}.bind(this));
@@ -108,7 +108,7 @@ SessionBuilder.prototype = {
108108
// end of decryptWhisperMessage ... to ensure that the sender
109109
// actually holds the private keys for all reported pubkeys
110110
record.updateSessionState(new_session);
111-
return this.storage.saveIdentity(this.remoteAddress.getName(), message.identityKey.toArrayBuffer()).then(function() {
111+
return this.storage.saveIdentity(this.remoteAddress.toString(), message.identityKey.toArrayBuffer()).then(function() {
112112
return message.preKeyId;
113113
});
114114
}.bind(this));

src/SessionCipher.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ SessionCipher.prototype = {
8383
throw new Error('Identity key changed');
8484
}
8585
}).then(function() {
86-
return this.storage.saveIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey);
86+
return this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey);
8787
}.bind(this)).then(function() {
8888
record.updateSessionState(session);
8989
return this.storage.storeSession(address, record.serialize()).then(function() {
@@ -165,7 +165,7 @@ SessionCipher.prototype = {
165165
throw new Error('Identity key changed');
166166
}
167167
}).then(function() {
168-
return this.storage.saveIdentity(this.remoteAddress.getName(), result.session.indexInfo.remoteIdentityKey);
168+
return this.storage.saveIdentity(this.remoteAddress.toString(), result.session.indexInfo.remoteIdentityKey);
169169
}.bind(this)).then(function() {
170170
record.updateSessionState(result.session);
171171
return this.storage.storeSession(address, record.serialize()).then(function() {

0 commit comments

Comments
 (0)