From 22ef625b55a69362e7e2a2a698dfa396ae81c95f Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 19 Oct 2023 16:50:29 +0100 Subject: [PATCH] Disable ratcheting The auto ratcheting sets the keys and so looks like it can clobber us setting a key from the app if they race, so just disable it, at least for now - we aren't using it. --- src/e2ee/matrixKeyProvider.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/e2ee/matrixKeyProvider.ts b/src/e2ee/matrixKeyProvider.ts index 7053054a..fcef3d8e 100644 --- a/src/e2ee/matrixKeyProvider.ts +++ b/src/e2ee/matrixKeyProvider.ts @@ -24,6 +24,10 @@ import { export class MatrixKeyProvider extends BaseKeyProvider { private rtcSession?: MatrixRTCSession; + public constructor() { + super({ ratchetWindowSize: 0 }); + } + public setRTCSession(rtcSession: MatrixRTCSession): void { if (this.rtcSession) { this.rtcSession.off( @@ -63,7 +67,7 @@ export class MatrixKeyProvider extends BaseKeyProvider { ); logger.debug( - `Embedded-E2EE-LOG onEncryptionKeyChanged participantId=${participantId} encryptionKeyIndex=${encryptionKeyIndex} encryptionKey=${encryptionKey}`, + `Embedded-E2EE-LOG onEncryptionKeyChanged room=${this.rtcSession?.room.roomId} participantId=${participantId} encryptionKeyIndex=${encryptionKeyIndex} encryptionKey=${encryptionKey}`, this.getKeys(), ); };