-
-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for e2e key backups #736
Conversation
…nto uhoreg-e2e_backups
…nto uhoreg-e2e_backups
Continues from uhoreg's branch
Add method to check if a given string is a valid recovery key
It's exported in snake case
this._baseApis.enableKeyBackup(backupInfo); | ||
} else if (!trustInfo.usable && this.backupInfo) { | ||
console.log("No usable key backup: disabling key backup"); | ||
this._baseApis.disableKeyBackup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not managing the case (trustInfo.usable && this.backupInfo
) ?
If I understand the logic right, it would be:
else if (trustInfo.usable && this.backupInfo) {
console.log("Found usable key backup: use the new key backup version");
this._baseApis.disableKeyBackup();
this._baseApis.enableKeyBackup(backupInfo);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, we should do nothing if the backup version we got from the hs is the same as in this.backupInfo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry - replied to this on matrix but should do so here for completeness: we probably ought to but there's nothing that would actually trigger us to look for this case since we don't get told about new backup version in the sync stream.
lgtm. (turning the 43 and 44 magic numbers into a const is nice-to-have) |
to force base-x to version 3.0.4 because 3.0.5 breaks the build by exporting ES6.
} | ||
} | ||
|
||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Length could be checked first to avoid out of bounds error in the for loop before this piece of code.
(Credits to Benoit at matrix-org/matrix-ios-sdk#591 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. I don't think it matters much for JavaScript, but it would matter for lower-level languages.
so versions are consistent
Also fix test & remove debug logging from test
Passphrase Support for e2e backups
Adds support for backing up e2e keys to the homeserver and restoring with a secret recovery key.
element-hq/element-web#3661