Skip to content

Commit

Permalink
Désactiver le partage legacy de clefs avec les appareils mobiles pre-…
Browse files Browse the repository at this point in the history
…xsss (#615)

* Change forceLegacyIncomingRoomKeyVerification to false
* Add meaningfull log message

---------

Co-authored-by: Olivier D <[email protected]>
  • Loading branch information
aulamber and odelcroi committed Jun 13, 2023
1 parent c42e0eb commit a7436a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/matrix-react-sdk/src/components/structures/MatrixChat.tsx b/node_modules/matrix-react-sdk/src/components/structures/MatrixChat.tsx
index 575ff07..3424e04 100644
index 575ff07..ec8c98b 100644
--- a/node_modules/matrix-react-sdk/src/components/structures/MatrixChat.tsx
+++ b/node_modules/matrix-react-sdk/src/components/structures/MatrixChat.tsx
@@ -32,6 +32,8 @@ import { throttle } from "lodash";
Expand All @@ -19,7 +19,7 @@ index 575ff07..3424e04 100644

// legacy export
export { default as Views } from "../../Views";
@@ -1587,6 +1590,23 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
@@ -1587,6 +1590,26 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
cli.on(HttpApiEvent.SessionLoggedOut, () => dft.stop());
cli.on(MatrixEventEvent.Decrypted, (e, err) => dft.eventDecrypted(e, err as DecryptionError));

Expand All @@ -29,6 +29,9 @@ index 575ff07..3424e04 100644
+ //or is added only if the xs is not active
+ if(TchapUIFeature.forceLegacyIncomingRoomKeyVerification ||
+ !TchapUIFeature.isCrossSigningAndSecureStorageActive()){
+ /* :TCHAP: Désactiver le partage legacy de clefs avec les appareils mobiles */
+ console.log(':tchap: activate the legacy incoming key verification')
+ /* end :TCHAP: */
+ const krh = new KeyRequestHandler(cli);
+ cli.on(CryptoEvent.RoomKeyRequest, (req) => {
+ krh.handleKeyRequest(req);
Expand All @@ -43,7 +46,7 @@ index 575ff07..3424e04 100644
cli.on(ClientEvent.Room, (room) => {
if (MatrixClientPeg.get().isCryptoEnabled()) {
const blacklistEnabled = SettingsStore.getValueAt(
@@ -1716,6 +1736,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
@@ -1716,6 +1739,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
return;
}

Expand All @@ -60,7 +63,7 @@ index 575ff07..3424e04 100644
dis.dispatch({
action: "start_registration",
diff --git a/node_modules/matrix-react-sdk/src/components/views/settings/CrossSigningPanel.tsx b/node_modules/matrix-react-sdk/src/components/views/settings/CrossSigningPanel.tsx
index e3f62d4..d3967a0 100644
index e3f62d4..24c7f46 100644
--- a/node_modules/matrix-react-sdk/src/components/views/settings/CrossSigningPanel.tsx
+++ b/node_modules/matrix-react-sdk/src/components/views/settings/CrossSigningPanel.tsx
@@ -28,6 +28,7 @@ import ConfirmDestroyCrossSigningDialog from "../dialogs/security/ConfirmDestroy
Expand Down Expand Up @@ -135,7 +138,7 @@ index e3f62d4..d3967a0 100644
{errorSection}
{actionRow}
diff --git a/node_modules/matrix-react-sdk/src/components/views/settings/DevicesPanel.tsx b/node_modules/matrix-react-sdk/src/components/views/settings/DevicesPanel.tsx
index 603438e..2766f19 100644
index 603438e..ea4d47c 100644
--- a/node_modules/matrix-react-sdk/src/components/views/settings/DevicesPanel.tsx
+++ b/node_modules/matrix-react-sdk/src/components/views/settings/DevicesPanel.tsx
@@ -27,6 +27,7 @@ import AccessibleButton from "../elements/AccessibleButton";
Expand Down Expand Up @@ -182,7 +185,7 @@ index 603438e..2766f19 100644
}

diff --git a/node_modules/matrix-react-sdk/src/components/views/settings/SecureBackupPanel.tsx b/node_modules/matrix-react-sdk/src/components/views/settings/SecureBackupPanel.tsx
index 7473786..293ab8e 100644
index 7473786..af8b424 100644
--- a/node_modules/matrix-react-sdk/src/components/views/settings/SecureBackupPanel.tsx
+++ b/node_modules/matrix-react-sdk/src/components/views/settings/SecureBackupPanel.tsx
@@ -31,6 +31,7 @@ import AccessibleButton from "../elements/AccessibleButton";
Expand Down
2 changes: 1 addition & 1 deletion src/tchap/util/TchapUIFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ export default class TchapUIFeature {
/**
* This flag controls whether to force incoming key legacy verification (usefull for older mobile device than android 2.6, ios 2.2.3)
*/
public static forceLegacyIncomingRoomKeyVerification = true;
public static forceLegacyIncomingRoomKeyVerification = false;
}

0 comments on commit a7436a2

Please sign in to comment.