Inline code

This commit is contained in:
RMidhunSuresh 2023-03-24 20:30:48 +05:30
parent ae60c30ab8
commit 8ea484e862

View File

@ -63,7 +63,7 @@ export class CalculateSASStage extends BaseSASVerificationStage {
async completeStage() { async completeStage() {
await this.log.wrap("CalculateSASStage.completeStage", async (log) => { await this.log.wrap("CalculateSASStage.completeStage", async (log) => {
// 1. Check the hash commitment // 1. Check the hash commitment
if (this.needsToVerifyHashCommitment && !await this.verifyHashCommitment(log)) { if (this.channel.initiatedByUs && !await this.verifyHashCommitment(log)) {
return; return;
} }
// 2. Calculate the SAS // 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 { private generateSASBytes(): Uint8Array {
const keyAgreement = this.channel.acceptMessage.content.key_agreement_protocol; const keyAgreement = this.channel.acceptMessage.content.key_agreement_protocol;
const otherUserDeviceId = this.otherUserDeviceId; const otherUserDeviceId = this.otherUserDeviceId;