Skip to content

davey@0.2.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 02:31
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::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 is_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 failing with NoGroup or PendingGroup. (ref: discord/libdave@68f7c02)
  • DaveSession::process_welcome now takes a recognized_user_ids argument that gets checked against the users in the welcome group. (parity with libdave v1.2.0)
  • EncryptionStats and DecryptionStats fields are now u64. (parity with libdave)
  • EncryptError::EncryptionFailed now contains an EncryptorEncryptError.
  • DecryptorDecryptError::NoValidCryptorFound was replaced with more specific errors: MissingKeyRatchet, InvalidNonce, MissingCryptor and DecryptionFailure.

Added:

  • 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.
  • DaveSession::encrypt_into and DaveSession::decrypt_into to encrypt and decrypt into your own buffer, so it can be reused between packets.
  • 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.
  • LEB128 sizes that don't fit in the frame or usize are now rejected. (ref: discord/libdave@7cb36a3)
  • 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)
  • 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)
  • Reduced buffer allocations in encryption and decryption. (#18)