diff --git a/src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx b/src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx index c188319b3a..2a02945621 100644 --- a/src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx @@ -45,9 +45,13 @@ interface IState { error?: boolean; } -/* - * Walks the user through the process of creating an e2e key backup - * on the server. +/** + * Walks the user through the process of setting up e2e key backups to a new backup, and storing the decryption key in + * SSSS. + * + * Uses {@link accessSecretStorage}, which means that if 4S is not already configured, it will be bootstrapped (which + * involves displaying an {@link CreateSecretStorageDialog} so the user can enter a passphrase and/or download the 4S + * key). */ export default class CreateKeyBackupDialog extends React.PureComponent { public constructor(props: IProps) { @@ -75,6 +79,14 @@ export default class CreateKeyBackupDialog extends React.PureComponent => { + // `accessSecretStorage` will have bootstrapped secret storage if necessary, so we can now + // set up key backup. + // + // XXX: `bootstrapSecretStorage` also sets up key backup as a side effect, so there is a 90% chance + // this is actually redundant. + // + // The only time it would *not* be redundant would be if, for some reason, we had working 4S but no + // working key backup. (For example, if the user clicked "Delete Backup".) info = await cli.prepareKeyBackupVersion(null /* random key */, { secureSecretStorage: true, }); diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index 62b4502cef..ba53b615a3 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -94,9 +94,12 @@ interface IState { error?: boolean; } -/* - * Walks the user through the process of creating a passphrase to guard Secure - * Secret Storage in account data. +/** + * Walks the user through the process of creating a 4S passphrase and bootstrapping secret storage. + * + * If the user already has a key backup, follows a "migration" flow (aka "Upgrade your encryption") which + * prompts the user to enter their backup decryption password (a Curve25519 private key, possibly derived + * from a passphrase), and uses that as the (AES) 4S encryption key. */ export default class CreateSecretStorageDialog extends React.PureComponent { public static defaultProps: Partial = { @@ -576,12 +579,6 @@ export default class CreateSecretStorageDialog extends React.PureComponent