Skip to content

Commit 08418c1

Browse files
authored
Remove Features.RustCrypto (element-hq#28582)
1 parent 6798239 commit 08418c1

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

src/MatrixClientPeg.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,11 @@ import IdentityAuthClient from "./IdentityAuthClient";
3535
import { crossSigningCallbacks } from "./SecurityManager";
3636
import { SlidingSyncManager } from "./SlidingSyncManager";
3737
import { _t, UserFriendlyError } from "./languageHandler";
38-
import { SettingLevel } from "./settings/SettingLevel";
3938
import MatrixClientBackedController from "./settings/controllers/MatrixClientBackedController";
4039
import ErrorDialog from "./components/views/dialogs/ErrorDialog";
4140
import PlatformPeg from "./PlatformPeg";
4241
import { formatList } from "./utils/FormattingUtils";
4342
import SdkConfig from "./SdkConfig";
44-
import { Features } from "./settings/Settings";
4543
import { setDeviceIsolationMode } from "./settings/controllers/DeviceIsolationModeController.ts";
4644

4745
export interface IMatrixClientCreds {
@@ -333,11 +331,6 @@ class MatrixClientPegClass implements IMatrixClientPeg {
333331
logger.error("Warning! Not using an encryption key for rust crypto store.");
334332
}
335333

336-
// Record the fact that we used the Rust crypto stack with this client. This just guards against people
337-
// rolling back to versions of EW that did not default to Rust crypto (which would lead to an error, since
338-
// we cannot migrate from Rust to Legacy crypto).
339-
await SettingsStore.setValue(Features.RustCrypto, null, SettingLevel.DEVICE, true);
340-
341334
await this.matrixClient.initRustCrypto({
342335
storageKey: rustCryptoStoreKey,
343336
storagePassword: rustCryptoStorePassword,

src/settings/Settings.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,6 @@ export enum Features {
9090
NotificationSettings2 = "feature_notification_settings2",
9191
OidcNativeFlow = "feature_oidc_native_flow",
9292
ReleaseAnnouncement = "feature_release_announcement",
93-
94-
/** If true, use the Rust crypto implementation.
95-
*
96-
* This is no longer read, but we continue to populate it on all devices, to guard against people rolling back to
97-
* old versions of EW that do not use rust crypto by default.
98-
*/
99-
RustCrypto = "feature_rust_crypto",
10093
}
10194

10295
export const labGroupNames: Record<LabGroup, TranslationKey> = {
@@ -469,10 +462,6 @@ export const SETTINGS: { [setting: string]: ISetting } = {
469462
description: _td("labs|oidc_native_flow_description"),
470463
default: false,
471464
},
472-
[Features.RustCrypto]: {
473-
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
474-
default: true,
475-
},
476465
/**
477466
* @deprecated in favor of {@link fontSizeDelta}
478467
*/

test/unit-tests/MatrixClientPeg-test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import fetchMockJest from "fetch-mock-jest";
1111

1212
import { advanceDateAndTime, stubClient } from "../test-utils";
1313
import { IMatrixClientPeg, MatrixClientPeg as peg } from "../../src/MatrixClientPeg";
14-
import SettingsStore from "../../src/settings/SettingsStore";
15-
import { SettingLevel } from "../../src/settings/SettingLevel";
1614

1715
jest.useFakeTimers();
1816

@@ -81,27 +79,18 @@ describe("MatrixClientPeg", () => {
8179
});
8280

8381
it("should initialise the rust crypto library by default", async () => {
84-
const mockSetValue = jest.spyOn(SettingsStore, "setValue").mockResolvedValue(undefined);
85-
8682
const mockInitRustCrypto = jest.spyOn(testPeg.safeGet(), "initRustCrypto").mockResolvedValue(undefined);
8783

8884
const cryptoStoreKey = new Uint8Array([1, 2, 3, 4]);
8985
await testPeg.start({ rustCryptoStoreKey: cryptoStoreKey });
9086
expect(mockInitRustCrypto).toHaveBeenCalledWith({ storageKey: cryptoStoreKey });
91-
92-
// we should have stashed the setting in the settings store
93-
expect(mockSetValue).toHaveBeenCalledWith("feature_rust_crypto", null, SettingLevel.DEVICE, true);
9487
});
9588

9689
it("Should migrate existing login", async () => {
97-
const mockSetValue = jest.spyOn(SettingsStore, "setValue").mockResolvedValue(undefined);
9890
const mockInitRustCrypto = jest.spyOn(testPeg.safeGet(), "initRustCrypto").mockResolvedValue(undefined);
9991

10092
await testPeg.start();
10193
expect(mockInitRustCrypto).toHaveBeenCalledTimes(1);
102-
103-
// we should have stashed the setting in the settings store
104-
expect(mockSetValue).toHaveBeenCalledWith("feature_rust_crypto", null, SettingLevel.DEVICE, true);
10594
});
10695
});
10796
});

0 commit comments

Comments
 (0)