Fixed bug where key reset didn't always return the right key

pull/21833/head
Zoe 2020-02-11 15:56:32 +00:00
parent 7a026eb15d
commit 5382a52519
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; const { force } = this.props;
try { try {
await cli.bootstrapSecretStorage({ if (!force) {
setupNewSecretStorage: force, await cli.bootstrapSecretStorage({
authUploadDeviceSigningKeys: this._doBootstrapUIAuth, authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
createSecretStorageKey: async () => this._keyInfo, createSecretStorageKey: async () => this._keyInfo,
keyBackupInfo: this.state.backupInfo, keyBackupInfo: this.state.backupInfo,
setupNewKeyBackup: force || !this.state.backupInfo && this.state.useKeyBackup, setupNewKeyBackup: !this.state.backupInfo && this.state.useKeyBackup,
}); });
} else {
await cli.bootstrapSecretStorage({
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
createSecretStorageKey: async () => this._keyInfo,
setupNewKeyBackup: true,
setupNewSecretStorage: true,
});
}
this.setState({ this.setState({
phase: PHASE_DONE, phase: PHASE_DONE,
}); });

View File

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