Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change how MatrixEvent manages encrypted events #138

Merged
merged 1 commit into from
Jun 9, 2016

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jun 9, 2016

Make MatrixEvent.event contain the encrypted event, and keep the plaintext
payload in a separate _clearEvent property.

This achieves several aims:

  • means that we have a record of the actual object which was received over
    the wire, which can be shown by clients for 'view source'.
  • makes sent and received encrypted MatrixEvents more consistent (previously
    sent ones had encryptedType and encryptedContent properties, whereas
    received ones threw away the ciphertext).
  • Avoids having to make two MatrixEvents in the receive path, and copying
    fields from one to the other.

Hopefully most clients have followed the advice given in the jsdoc of not
relying on MatrixEvent.event to get at events. If they haven't, I guess they'll
break in the face of encrypted events.

(The pushprocessor didn't follow this advice, so needed some tweaks.)

Make `MatrixEvent.event` contain the *encrypted* event, and keep the plaintext
payload in a separate `_clearEvent` property.

This achieves several aims:

* means that we have a record of the actual object which was received over
  the wire, which can be shown by clients for 'view source'.

* makes sent and received encrypted MatrixEvents more consistent (previously
  sent ones had `encryptedType` and `encryptedContent` properties, whereas
  received ones threw away the ciphertext).

* Avoids having to make two MatrixEvents in the receive path, and copying
  fields from one to the other.

*Hopefully* most clients have followed the advice given in the jsdoc of not
relying on MatrixEvent.event to get at events. If they haven't, I guess they'll
break in the face of encrypted events.

(The pushprocessor didn't follow this advice, so needed some tweaks.)
@dbkr dbkr merged commit 0f153fd into develop Jun 9, 2016
@richvdh richvdh deleted the rav/event_encryption branch August 3, 2016 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants