Skip to content

Commit

Permalink
Also guard before resetting to initial material
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Oct 20, 2023
1 parent be1c6a7 commit e338269
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/e2ee/worker/FrameCryptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export class FrameCryptor extends BaseFrameCryptor {
* yet and ratcheting, of course, did not solve the problem. So if we fail RATCHET_WINDOW_SIZE times,
* we come back to the initial key.
*/
if (initialMaterial) {
if (initialMaterial && keySet === this.keys.getKeySet(keyIndex)) {
workerLogger.debug('resetting to initial material');
this.keys.setKeyFromMaterial(initialMaterial.material, keyIndex);
}
Expand Down

0 comments on commit e338269

Please sign in to comment.