Skip to content

Commit 5a310cf

Browse files
authored
Merge pull request matrix-org#4793 from matrix-org/revert-4686-rel-2
Revert "Use recovery keys over passphrases"
2 parents b5aa660 + e4d8248 commit 5a310cf

File tree

12 files changed

+396
-423
lines changed

12 files changed

+396
-423
lines changed

res/css/structures/auth/_CompleteSecurity.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,3 @@ limitations under the License.
9898
}
9999
}
100100
}
101-
102-
.mx_CompleteSecurity_resetText {
103-
padding-top: 20px;
104-
}

res/css/views/dialogs/secretstorage/_CreateSecretStorageDialog.scss

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,42 +73,33 @@ limitations under the License.
7373
margin-left: 20px;
7474
}
7575

76+
.mx_CreateSecretStorageDialog_recoveryKeyHeader {
77+
margin-bottom: 1em;
78+
}
79+
7680
.mx_CreateSecretStorageDialog_recoveryKeyContainer {
77-
width: 380px;
78-
margin-left: auto;
79-
margin-right: auto;
81+
display: flex;
8082
}
8183

8284
.mx_CreateSecretStorageDialog_recoveryKey {
83-
font-weight: bold;
84-
text-align: center;
85+
width: 262px;
8586
padding: 20px;
8687
color: $info-plinth-fg-color;
8788
background-color: $info-plinth-bg-color;
88-
border-radius: 6px;
89-
word-spacing: 1em;
90-
margin-bottom: 20px;
89+
margin-right: 12px;
9190
}
9291

9392
.mx_CreateSecretStorageDialog_recoveryKeyButtons {
93+
flex: 1;
9494
display: flex;
95-
justify-content: space-between;
9695
align-items: center;
9796
}
9897

9998
.mx_CreateSecretStorageDialog_recoveryKeyButtons .mx_AccessibleButton {
100-
width: 160px;
101-
padding-left: 0px;
102-
padding-right: 0px;
103-
white-space: nowrap;
104-
}
105-
106-
.mx_CreateSecretStorageDialog_continueSpinner {
107-
margin-top: 33px;
108-
text-align: right;
99+
margin-right: 10px;
109100
}
110101

111-
.mx_CreateSecretStorageDialog_continueSpinner img {
112-
width: 20px;
113-
height: 20px;
102+
.mx_CreateSecretStorageDialog_recoveryKeyButtons button {
103+
flex: 1;
104+
white-space: nowrap;
114105
}

src/CrossSigningManager.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import {encodeBase64} from "matrix-js-sdk/src/crypto/olmlib";
3030
// operation ends.
3131
let secretStorageKeys = {};
3232
let secretStorageBeingAccessed = false;
33-
// Stores the 'passphraseOnly' option for the active storage access operation
34-
let passphraseOnlyOption = null;
3533

3634
function isCachingAllowed() {
3735
return (
@@ -101,7 +99,6 @@ async function getSecretStorageKey({ keys: keyInfos }, ssssItemName) {
10199
const key = await inputToKey(input);
102100
return await MatrixClientPeg.get().checkSecretStorageKey(key, info);
103101
},
104-
passphraseOnly: passphraseOnlyOption,
105102
},
106103
/* className= */ null,
107104
/* isPriorityModal= */ false,
@@ -216,27 +213,19 @@ export async function promptForBackupPassphrase() {
216213
*
217214
* @param {Function} [func] An operation to perform once secret storage has been
218215
* bootstrapped. Optional.
219-
* @param {object} [opts] Named options
220-
* @param {bool} [opts.forceReset] Reset secret storage even if it's already set up
221-
* @param {object} [opts.withKeys] Map of key ID to key for SSSS keys that the client
222-
* already has available. If a key is not supplied here, the user will be prompted.
223-
* @param {bool} [opts.passphraseOnly] If true, do not prompt for recovery key or to reset keys
216+
* @param {bool} [forceReset] Reset secret storage even if it's already set up
224217
*/
225-
export async function accessSecretStorage(
226-
func = async () => { }, opts = {},
227-
) {
218+
export async function accessSecretStorage(func = async () => { }, forceReset = false) {
228219
const cli = MatrixClientPeg.get();
229220
secretStorageBeingAccessed = true;
230-
passphraseOnlyOption = opts.passphraseOnly;
231-
secretStorageKeys = Object.assign({}, opts.withKeys || {});
232221
try {
233-
if (!await cli.hasSecretStorageKey() || opts.forceReset) {
222+
if (!await cli.hasSecretStorageKey() || forceReset) {
234223
// This dialog calls bootstrap itself after guiding the user through
235224
// passphrase creation.
236225
const { finished } = Modal.createTrackedDialogAsync('Create Secret Storage dialog', '',
237226
import("./async-components/views/dialogs/secretstorage/CreateSecretStorageDialog"),
238227
{
239-
force: opts.forceReset,
228+
force: forceReset,
240229
},
241230
null, /* priority = */ false, /* static = */ true,
242231
);
@@ -274,6 +263,5 @@ export async function accessSecretStorage(
274263
if (!isCachingAllowed()) {
275264
secretStorageKeys = {};
276265
}
277-
passphraseOnlyOption = null;
278266
}
279267
}

0 commit comments

Comments
 (0)