Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 1f3d99c

Browse files
authored
Improve comments on key-setup dialogs (#11339)
* Remove outdated (I think) TODO * Improve comments on key-setup dialogs
1 parent 0647aaf commit 1f3d99c

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx

+15-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ interface IState {
4545
error?: boolean;
4646
}
4747

48-
/*
49-
* Walks the user through the process of creating an e2e key backup
50-
* on the server.
48+
/**
49+
* Walks the user through the process of setting up e2e key backups to a new backup, and storing the decryption key in
50+
* SSSS.
51+
*
52+
* Uses {@link accessSecretStorage}, which means that if 4S is not already configured, it will be bootstrapped (which
53+
* involves displaying an {@link CreateSecretStorageDialog} so the user can enter a passphrase and/or download the 4S
54+
* key).
5155
*/
5256
export default class CreateKeyBackupDialog extends React.PureComponent<IProps, IState> {
5357
public constructor(props: IProps) {
@@ -75,6 +79,14 @@ export default class CreateKeyBackupDialog extends React.PureComponent<IProps, I
7579
const cli = MatrixClientPeg.safeGet();
7680
try {
7781
await accessSecretStorage(async (): Promise<void> => {
82+
// `accessSecretStorage` will have bootstrapped secret storage if necessary, so we can now
83+
// set up key backup.
84+
//
85+
// XXX: `bootstrapSecretStorage` also sets up key backup as a side effect, so there is a 90% chance
86+
// this is actually redundant.
87+
//
88+
// The only time it would *not* be redundant would be if, for some reason, we had working 4S but no
89+
// working key backup. (For example, if the user clicked "Delete Backup".)
7890
info = await cli.prepareKeyBackupVersion(null /* random key */, {
7991
secureSecretStorage: true,
8092
});

src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx

+6-9
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,12 @@ interface IState {
9494
error?: boolean;
9595
}
9696

97-
/*
98-
* Walks the user through the process of creating a passphrase to guard Secure
99-
* Secret Storage in account data.
97+
/**
98+
* Walks the user through the process of creating a 4S passphrase and bootstrapping secret storage.
99+
*
100+
* If the user already has a key backup, follows a "migration" flow (aka "Upgrade your encryption") which
101+
* prompts the user to enter their backup decryption password (a Curve25519 private key, possibly derived
102+
* from a passphrase), and uses that as the (AES) 4S encryption key.
100103
*/
101104
export default class CreateSecretStorageDialog extends React.PureComponent<IProps, IState> {
102105
public static defaultProps: Partial<IProps> = {
@@ -576,12 +579,6 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
576579
}
577580

578581
private renderPhaseMigrate(): JSX.Element {
579-
// TODO: This is a temporary screen so people who have the labs flag turned on and
580-
// click the button are aware they're making a change to their account.
581-
// Once we're confident enough in this (and it's supported enough) we can do
582-
// it automatically.
583-
// https://github.com/vector-im/element-web/issues/11696
584-
585582
let authPrompt;
586583
let nextCaption = _t("Next");
587584
if (this.state.canUploadKeysWithPasswordOnly) {

0 commit comments

Comments
 (0)