HomePhabricator
Diffusion Comm 4723c3b6eb1d

[lib] Restart session when any Olm error is thrown

Description

[lib] Restart session when any Olm error is thrown

Summary:
This diff restarts session when any Olm error is thrown by throwing an exception with OLM_ERROR flag set if error occured when decrypting the message.
If flag is included in the exception then the session is reset.

https://linear.app/comm/issue/ENG-9729/session-not-reset-after-getting-bad-message-mac

Test Plan:

  1. Simulate BAD_MESSAGE_MAC by changing the last 3 characters of the message passed to session.decrypt() in the code
  2. Verify in the logs that BAD_MESSAGE_MAC is thrown and session is reset.

Reviewers: kamil, tomek, ashoat

Reviewed By: kamil, ashoat

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D13757

Details

Provenance
angelikaAuthored on Mon, Oct 21, 6:11 AM
Reviewer
kamil
Differential Revision
D13757: [lib] Restart session when any Olm error is thrown
Parents
rCOMMb0cce8b61c26: [lib] Add timestamp check when flipping unread status
Branches
Unknown
Tags
Unknown