Repository navigation
davey@0.2.0
Immutable
release. Only release title and notes can be modified.
Read the short migration guide: https://github.com/Snazzah/davey/wiki/Migrating-to-0.2.0
Breaking:
DaveSession::process_commitandDaveSession::process_welcomeno longer update keys. CallDaveSession::prepare_transitionwith the transition ID andprotocol_versionafterwards, and the key used to encrypt packets is only switched once that transition is executed withDaveSession::execute_transition, unless the transition ID is 0. (parity with libdave's sample)DaveSession::reinitnow keeps the current encryption and decryption keys until the next transition replaces them, sois_readystaystrue. (parity with libdave)DaveSession::process_commitnow returnstrueif the transition should be prepared, orfalseif the commit was ignored because there is no established group or queued proposals, instead of failing withNoGrouporPendingGroup. (ref: discord/libdave@68f7c02)DaveSession::process_welcomenow takes arecognized_user_idsargument that gets checked against the users in the welcome group. (parity with libdave v1.2.0)EncryptionStatsandDecryptionStatsfields are nowu64. (parity with libdave)EncryptError::EncryptionFailednow contains anEncryptorEncryptError.DecryptorDecryptError::NoValidCryptorFoundwas replaced with more specific errors:MissingKeyRatchet,InvalidNonce,MissingCryptorandDecryptionFailure.
Added:
DaveSession::prepare_transitionandDaveSession::execute_transitionfor handling opcodes 21 and 22. Preparing a downgrade to protocol version 0 keeps the current decryption keys usable for 10 seconds.DaveSession::can_encryptto check whether the session has a key to encrypt with.DaveSession::encrypt_intoandDaveSession::decrypt_intoto encrypt and decrypt into your own buffer, so it can be reused between packets.EncryptionStats::missing_keysandDecryptionStats::missing_keysfor the number of encryptions and decryptions that failed due to a missing key, andDecryptionStats::invalid_noncesfor 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
usizeare now rejected. (ref: discord/libdave@7cb36a3) DecryptionStats::attemptsnow 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)