Page MenuHomePhabricator

Enhance error check in CryptoModule decrypt. Add encrypted message hash to error message.

Authored by marcin on Wed, Sep 13, 6:50 AM.



This differential addresses crypto sync follow ups described there: In particular:

  1. EncryptedData is passed by reference.
  2. Error checking for olm_max_decrypt_plaintext_length is implemented.
  3. Hash of encrypted message is calculated before decryption. In the case of failure, hash of the message is appended to error message.
  4. Notifications Service Extension adds notifications id to error message notification. NOTE: it is NOT id of an entry in notifications table in MariaDB. It is the iosID field of delivery column of an entry in notifications table.
Test Plan
  1. Build iOS app,
  2. Apply this patch to the keyserver code to send each encrypted notification twice:
  3. Send notification to iOS device.
  4. Ensure that the second notification contains the hash and id of the notification received,

Diff Detail

rCOMM Comm
Lint Not Applicable
Tests Not Applicable

Event Timeline

marcin edited the test plan for this revision. (Show Details)
343 ↗(On Diff #31043)

In retrospect there is probably no performance gain here, since in the old code C++ compilers would probably optimize to use a move constructor here. We can leave it though, in case we change things in the future at the callsite

This revision is now accepted and ready to land.Fri, Sep 15, 3:41 AM