diff --git a/src/SessionBuilder.js b/src/SessionBuilder.js index 721851f..9a57a25 100644 --- a/src/SessionBuilder.js +++ b/src/SessionBuilder.js @@ -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'); @@ -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'); diff --git a/src/SessionCipher.js b/src/SessionCipher.js index 5fc0e63..b13af8c 100644 --- a/src/SessionCipher.js +++ b/src/SessionCipher.js @@ -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'); @@ -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');