Skip to content

Commit

Permalink
Always pass the full address to saveIdentity
Browse files Browse the repository at this point in the history
For consistency, and so the storage interface implementation can make descisions
about archiving sibling sessions.
  • Loading branch information
liliakai committed Jun 27, 2017
1 parent b65f69a commit 1fe18c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/libsignal-protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -35857,7 +35857,7 @@ SessionBuilder.prototype = {
record.updateSessionState(session);
return Promise.all([
this.storage.storeSession(address, record.serialize()),
this.storage.saveIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey)
this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey)
]);
}.bind(this));
}.bind(this));
Expand Down Expand Up @@ -35914,7 +35914,7 @@ SessionBuilder.prototype = {
// end of decryptWhisperMessage ... to ensure that the sender
// actually holds the private keys for all reported pubkeys
record.updateSessionState(new_session);
return this.storage.saveIdentity(this.remoteAddress.getName(), message.identityKey.toArrayBuffer()).then(function() {
return this.storage.saveIdentity(this.remoteAddress.toString(), message.identityKey.toArrayBuffer()).then(function() {
return message.preKeyId;
});
}.bind(this));
Expand Down Expand Up @@ -36117,7 +36117,7 @@ SessionCipher.prototype = {
throw new Error('Identity key changed');
}
}).then(function() {
return this.storage.saveIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey);
return this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey);
}.bind(this)).then(function() {
record.updateSessionState(session);
return this.storage.storeSession(address, record.serialize()).then(function() {
Expand Down Expand Up @@ -36199,7 +36199,7 @@ SessionCipher.prototype = {
throw new Error('Identity key changed');
}
}).then(function() {
return this.storage.saveIdentity(this.remoteAddress.getName(), result.session.indexInfo.remoteIdentityKey);
return this.storage.saveIdentity(this.remoteAddress.toString(), result.session.indexInfo.remoteIdentityKey);
}.bind(this)).then(function() {
record.updateSessionState(result.session);
return this.storage.storeSession(address, record.serialize()).then(function() {
Expand Down
4 changes: 2 additions & 2 deletions src/SessionBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SessionBuilder.prototype = {
record.updateSessionState(session);
return Promise.all([
this.storage.storeSession(address, record.serialize()),
this.storage.saveIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey)
this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey)
]);
}.bind(this));
}.bind(this));
Expand Down Expand Up @@ -108,7 +108,7 @@ SessionBuilder.prototype = {
// end of decryptWhisperMessage ... to ensure that the sender
// actually holds the private keys for all reported pubkeys
record.updateSessionState(new_session);
return this.storage.saveIdentity(this.remoteAddress.getName(), message.identityKey.toArrayBuffer()).then(function() {
return this.storage.saveIdentity(this.remoteAddress.toString(), message.identityKey.toArrayBuffer()).then(function() {
return message.preKeyId;
});
}.bind(this));
Expand Down
4 changes: 2 additions & 2 deletions src/SessionCipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ SessionCipher.prototype = {
throw new Error('Identity key changed');
}
}).then(function() {
return this.storage.saveIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey);
return this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey);
}.bind(this)).then(function() {
record.updateSessionState(session);
return this.storage.storeSession(address, record.serialize()).then(function() {
Expand Down Expand Up @@ -165,7 +165,7 @@ SessionCipher.prototype = {
throw new Error('Identity key changed');
}
}).then(function() {
return this.storage.saveIdentity(this.remoteAddress.getName(), result.session.indexInfo.remoteIdentityKey);
return this.storage.saveIdentity(this.remoteAddress.toString(), result.session.indexInfo.remoteIdentityKey);
}.bind(this)).then(function() {
record.updateSessionState(result.session);
return this.storage.storeSession(address, record.serialize()).then(function() {
Expand Down

0 comments on commit 1fe18c3

Please sign in to comment.