mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-02 07:31:38 +01:00
Inline code
This commit is contained in:
parent
ae60c30ab8
commit
8ea484e862
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user