Skip to content

davey-python@0.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Nov 04:05
Immutable release. Only release title and notes can be modified.
72d1c6d

Read the short migration guide: https://github.com/Snazzah/davey/wiki/Migrating-to-0.2.0


Breaking:

  • DaveSession.get_user_ids() now returns List[int] instead of List[str]
  • DaveSession.process_commit() and DaveSession.process_welcome() no longer update keys. Call DaveSession.prepare_transition() with the transition ID and protocol_version afterwards, and the key used to encrypt packets is only switched once that transition is executed with DaveSession.execute_transition(), unless the transition ID is 0. (parity with libdave's sample)
  • DaveSession.reinit() now keeps the current encryption and decryption keys until the next transition replaces them, so ready stays True. (parity with libdave)
  • DaveSession.process_commit() now returns True if the transition should be prepared, or False if the commit was ignored because there is no established group or queued proposals, instead of raising. (ref: discord/libdave@68f7c02)

Added:

  • DaveSession.process_welcome() now has an optional recognized_user_ids argument that gets checked against the users in the welcome group. (parity with libdave v1.2.0)
  • DaveSession.prepare_transition() and DaveSession.execute_transition() for handling opcodes 21 and 22. Preparing a downgrade to protocol version 0 keeps the current decryption keys usable for 10 seconds.
  • DaveSession.can_encrypt to check whether the session has a key to encrypt with.
  • EncryptionStats.missing_keys and DecryptionStats.missing_keys for the number of encryptions and decryptions that failed due to a missing key, and DecryptionStats.invalid_nonces for the number of decryptions that failed due to an invalid nonce.

Fixed:

  • Enabling passthrough mode now also applies to decryptors created afterwards.
  • Group IDs are now checked when processing welcomes. (parity with libdave v1.2.0 & v1.2.1)
  • Welcomes are now only accepted for the most recently created key package. (parity with libdave)
  • Own commits are only accepted if they exactly match the pending commit.
  • Passthrough mode can now only shorten the cipher manager expiry, not extend it. (ref: discord/libdave@48e6232)
  • Decrypting with a newer key generation can now only shorten the expiry of older generations, not extend it. (parity with libdave)
  • Missing nonces that arrive early are now tracked. (ref: discord/libdave@65be1a4)
  • Missing nonces are now limited to 1000 tracked nonces instead of a window of the last 1000 nonces, so older frames can still be decrypted. (ref: discord/libdave@3bdd9fd)
  • Fixed LEB128 not being read correctly in some cases.
  • DecryptionStats.attempts now only counts actual decryption attempts, not every key ratchet that was tried. (parity with libdave)
  • Duplicate key ratchet installs are now ignored. (ref: discord/libdave@8de72b1)
  • Re-installing the encryption key of the current epoch no longer restarts the nonce sequence, which reused nonces. (ref: discord/libdave@d3bac61)
  • __repr__() of DaveSession and SigningKeyPair no longer leaks memory. (whoops)
  • Duplicate user IDs are now rejected in proposals, welcomes and commits. (parity with libdave)
  • Proposals and commits are now checked for their wire format, epoch, content type and sender, and commits are rejected without queued proposals or with non-reference proposals. (parity with libdave)
  • Welcomes are no longer lost when the members being added were proposed before the latest batch of proposals.
  • The newest key is now tried first when decrypting.
  • Only Opus audio silence packets are passed through.
  • Encrypting with an unknown codec now encrypts the full frame instead of panicking. (parity with libdave)
  • Encryption and decryption stats no longer overflow past 32-bit values.
  • Reduced buffer allocations in encryption and decryption. (#18)