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

Revert "Use recovery keys over passphrases" #4793

Merged
merged 1 commit into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions res/css/structures/auth/_CompleteSecurity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,3 @@ limitations under the License.
}
}
}

.mx_CompleteSecurity_resetText {
padding-top: 20px;
}
33 changes: 12 additions & 21 deletions res/css/views/dialogs/secretstorage/_CreateSecretStorageDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,42 +73,33 @@ limitations under the License.
margin-left: 20px;
}

.mx_CreateSecretStorageDialog_recoveryKeyHeader {
margin-bottom: 1em;
}

.mx_CreateSecretStorageDialog_recoveryKeyContainer {
width: 380px;
margin-left: auto;
margin-right: auto;
display: flex;
}

.mx_CreateSecretStorageDialog_recoveryKey {
font-weight: bold;
text-align: center;
width: 262px;
padding: 20px;
color: $info-plinth-fg-color;
background-color: $info-plinth-bg-color;
border-radius: 6px;
word-spacing: 1em;
margin-bottom: 20px;
margin-right: 12px;
}

.mx_CreateSecretStorageDialog_recoveryKeyButtons {
flex: 1;
display: flex;
justify-content: space-between;
align-items: center;
}

.mx_CreateSecretStorageDialog_recoveryKeyButtons .mx_AccessibleButton {
width: 160px;
padding-left: 0px;
padding-right: 0px;
white-space: nowrap;
}

.mx_CreateSecretStorageDialog_continueSpinner {
margin-top: 33px;
text-align: right;
margin-right: 10px;
}

.mx_CreateSecretStorageDialog_continueSpinner img {
width: 20px;
height: 20px;
.mx_CreateSecretStorageDialog_recoveryKeyButtons button {
flex: 1;
white-space: nowrap;
}
20 changes: 4 additions & 16 deletions src/CrossSigningManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import {encodeBase64} from "matrix-js-sdk/src/crypto/olmlib";
// operation ends.
let secretStorageKeys = {};
let secretStorageBeingAccessed = false;
// Stores the 'passphraseOnly' option for the active storage access operation
let passphraseOnlyOption = null;

function isCachingAllowed() {
return (
Expand Down Expand Up @@ -101,7 +99,6 @@ async function getSecretStorageKey({ keys: keyInfos }, ssssItemName) {
const key = await inputToKey(input);
return await MatrixClientPeg.get().checkSecretStorageKey(key, info);
},
passphraseOnly: passphraseOnlyOption,
},
/* className= */ null,
/* isPriorityModal= */ false,
Expand Down Expand Up @@ -216,27 +213,19 @@ export async function promptForBackupPassphrase() {
*
* @param {Function} [func] An operation to perform once secret storage has been
* bootstrapped. Optional.
* @param {object} [opts] Named options
* @param {bool} [opts.forceReset] Reset secret storage even if it's already set up
* @param {object} [opts.withKeys] Map of key ID to key for SSSS keys that the client
* already has available. If a key is not supplied here, the user will be prompted.
* @param {bool} [opts.passphraseOnly] If true, do not prompt for recovery key or to reset keys
* @param {bool} [forceReset] Reset secret storage even if it's already set up
*/
export async function accessSecretStorage(
func = async () => { }, opts = {},
) {
export async function accessSecretStorage(func = async () => { }, forceReset = false) {
const cli = MatrixClientPeg.get();
secretStorageBeingAccessed = true;
passphraseOnlyOption = opts.passphraseOnly;
secretStorageKeys = Object.assign({}, opts.withKeys || {});
try {
if (!await cli.hasSecretStorageKey() || opts.forceReset) {
if (!await cli.hasSecretStorageKey() || forceReset) {
// This dialog calls bootstrap itself after guiding the user through
// passphrase creation.
const { finished } = Modal.createTrackedDialogAsync('Create Secret Storage dialog', '',
import("./async-components/views/dialogs/secretstorage/CreateSecretStorageDialog"),
{
force: opts.forceReset,
force: forceReset,
},
null, /* priority = */ false, /* static = */ true,
);
Expand Down Expand Up @@ -274,6 +263,5 @@ export async function accessSecretStorage(
if (!isCachingAllowed()) {
secretStorageKeys = {};
}
passphraseOnlyOption = null;
}
}
Loading