From 8ea484e8627d3c0e234d1f7431a7c954a6e8ff94 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 24 Mar 2023 20:30:48 +0530 Subject: [PATCH] Inline code --- .../verification/SAS/stages/CalculateSASStage.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/matrix/verification/SAS/stages/CalculateSASStage.ts b/src/matrix/verification/SAS/stages/CalculateSASStage.ts index d602d18d..4a991897 100644 --- a/src/matrix/verification/SAS/stages/CalculateSASStage.ts +++ b/src/matrix/verification/SAS/stages/CalculateSASStage.ts @@ -63,7 +63,7 @@ export class CalculateSASStage extends BaseSASVerificationStage { async completeStage() { await this.log.wrap("CalculateSASStage.completeStage", async (log) => { // 1. Check the hash commitment - if (this.needsToVerifyHashCommitment && !await this.verifyHashCommitment(log)) { + if (this.channel.initiatedByUs && !await this.verifyHashCommitment(log)) { return; } // 2. Calculate the SAS @@ -96,15 +96,6 @@ export class CalculateSASStage extends BaseSASVerificationStage { }); } - private get needsToVerifyHashCommitment(): boolean { - if (this.channel.initiatedByUs) { - // If we sent the start message, we also received the accept message. - // The commitment is in the accept message, so we need to verify it. - return true; - } - return false; - } - private generateSASBytes(): Uint8Array { const keyAgreement = this.channel.acceptMessage.content.key_agreement_protocol; const otherUserDeviceId = this.otherUserDeviceId;