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

always pass the full address to isTrustedIdentity #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/SessionBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SessionBuilder.prototype = {
processPreKey: function(device) {
return Internal.SessionLock.queueJobForNumber(this.remoteAddress.toString(), function() {
return this.storage.isTrustedIdentity(
this.remoteAddress.getName(), device.identityKey, this.storage.Direction.SENDING
this.remoteAddress.toString(), device.identityKey, this.storage.Direction.SENDING
).then(function(trusted) {
if (!trusted) {
throw new Error('Identity key changed');
Expand Down Expand Up @@ -60,7 +60,7 @@ SessionBuilder.prototype = {
processV3: function(record, message) {
var preKeyPair, signedPreKeyPair, session;
return this.storage.isTrustedIdentity(
this.remoteAddress.getName(), message.identityKey.toArrayBuffer(), this.storage.Direction.RECEIVING
this.remoteAddress.toString(), message.identityKey.toArrayBuffer(), this.storage.Direction.RECEIVING
).then(function(trusted) {
if (!trusted) {
var e = new Error('Unknown identity key');
Expand Down
4 changes: 2 additions & 2 deletions src/SessionCipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SessionCipher.prototype = {
result.set(new Uint8Array(mac, 0, 8), encodedMsg.byteLength + 1);

return this.storage.isTrustedIdentity(
this.remoteAddress.getName(), util.toArrayBuffer(session.indexInfo.remoteIdentityKey), this.storage.Direction.SENDING
this.remoteAddress.toString(), util.toArrayBuffer(session.indexInfo.remoteIdentityKey), this.storage.Direction.SENDING
).then(function(trusted) {
if (!trusted) {
throw new Error('Identity key changed');
Expand Down Expand Up @@ -159,7 +159,7 @@ SessionCipher.prototype = {
}

return this.storage.isTrustedIdentity(
this.remoteAddress.getName(), util.toArrayBuffer(result.session.indexInfo.remoteIdentityKey), this.storage.Direction.RECEIVING
this.remoteAddress.toString(), util.toArrayBuffer(result.session.indexInfo.remoteIdentityKey), this.storage.Direction.RECEIVING
).then(function(trusted) {
if (!trusted) {
throw new Error('Identity key changed');
Expand Down