Merge pull request #4057 from matrix-org/foldleft/12221-secret-storage

Fixed bug where key reset didn't always return the right key
This commit is contained in:
Zoe 2020-02-12 11:18:32 +00:00 committed by GitHub
commit 466d4a3e51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 10 deletions

View file

@ -225,13 +225,21 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
const { force } = this.props;
try {
await cli.bootstrapSecretStorage({
setupNewSecretStorage: force,
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
createSecretStorageKey: async () => this._keyInfo,
keyBackupInfo: this.state.backupInfo,
setupNewKeyBackup: force || !this.state.backupInfo && this.state.useKeyBackup,
});
if (force) {
await cli.bootstrapSecretStorage({
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
createSecretStorageKey: async () => this._keyInfo,
setupNewKeyBackup: true,
setupNewSecretStorage: true,
});
} else {
await cli.bootstrapSecretStorage({
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
createSecretStorageKey: async () => this._keyInfo,
keyBackupInfo: this.state.backupInfo,
setupNewKeyBackup: !this.state.backupInfo && this.state.useKeyBackup,
});
}
this.setState({
phase: PHASE_DONE,
});

View file

@ -103,7 +103,6 @@ export default class CrossSigningPanel extends React.PureComponent {
onDestroyStorage = (act) => {
if (!act) return;
console.log("Destroy secret storage:", act);
this._bootstrapSecureSecretStorage(true);
}
@ -157,13 +156,13 @@ export default class CrossSigningPanel extends React.PureComponent {
{_t("Bootstrap cross-signing and secret storage")}
</AccessibleButton>
</div>;
} /*else { // TODO https://github.com/vector-im/riot-web/issues/12221
} else {
bootstrapButton = <div className="mx_CrossSigningPanel_buttonRow">
<AccessibleButton kind="danger" onClick={this._destroySecureSecretStorage}>
{_t("Reset cross-signing and secret storage")}
</AccessibleButton>
</div>;
}*/
}
return (
<div>

View file

@ -565,6 +565,7 @@
"Your account has a cross-signing identity in secret storage, but it is not yet trusted by this session.": "Your account has a cross-signing identity in secret storage, but it is not yet trusted by this session.",
"Cross-signing and secret storage are not yet set up.": "Cross-signing and secret storage are not yet set up.",
"Bootstrap cross-signing and secret storage": "Bootstrap cross-signing and secret storage",
"Reset cross-signing and secret storage": "Reset cross-signing and secret storage",
"Cross-signing public keys:": "Cross-signing public keys:",
"in memory": "in memory",
"not found": "not found",