1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Fix verification of the master key

This commit is contained in:
Travis Ralston
2020-01-29 18:06:25 +00:00
parent 007508ba12
commit 5fbaa9cfa7

View File

@@ -71,10 +71,16 @@ export class ReciprocateQRCode extends Base {
}
// If we've gotten this far, verify the user's master cross signing key
const xsignInfo = this._baseApis.getStoredCrossSigningInfo(this.userId);
const xsignInfo = this._baseApis.getStoredCrossSigningForUser(this.userId);
if (!xsignInfo) throw new Error("Missing cross signing info");
const masterKey = xsignInfo.getId("master");
await this._verifyKeys(this.userId, [masterKey, masterKey]);
const masterKeyId = `ed25519:${masterKey}`;
await this._verifyKeys(this.userId, {[masterKeyId]:masterKey}, (keyId, device, keyInfo) => {
console.log({keyId, device, keyInfo});
if (keyId !== masterKeyId) {
throw newKeyMismatchError();
}
});
}
}