Grapevine is a Matrix homeserver, forked from Conduit 0.7.0
Find a file
Matthias Ahouansou 9087da91db
fix(keys): only use keys valid at the time of PDU or transaction, and actually refresh keys
Previously, we only fetched keys once, only requesting them again if we have any missing, allowing for ancient keys to be used to sign PDUs and transactions
Now we refresh keys that either have or are about to expire, preventing attacks that make use of leaked private keys of a homeserver
We also ensure that when validating PDUs or transactions, that they are valid at the origin_server_ts or time of us receiving the transaction respectfully
As to not break event authorization for old rooms, we need to keep old keys around
We move verify_keys which we no longer see in direct requests to the origin to old_verify_keys
We keep old_verify_keys indefinitely as mentioned above, as to not break event authorization (at least until a future MSC addresses this)

Original patch by Matthias. Benjamin just rebased it onto grapevine and
fixed clippy/rustc warnings.

Co-authored-by: Benjamin Lee <benjamin@computer.surgery>
2024-06-12 11:10:50 -07:00
bin use all-features devshell for clippy/all in CI 2024-05-30 21:19:08 -07:00
nix don't strip binary for dev builds 2024-06-05 16:42:40 -07:00
src fix(keys): only use keys valid at the time of PDU or transaction, and actually refresh keys 2024-06-12 11:10:50 -07:00
.envrc optionally use nom to build devshell dependencies 2024-05-30 21:19:09 -07:00
.gitignore allow loading env vars from .env if it exists 2024-05-14 20:08:37 -07:00
.gitlab-ci.yml pin nixos/nix to 2.18.2 2024-05-26 19:47:00 -07:00
Cargo.lock use strum instead 2024-06-05 17:41:39 -07:00
Cargo.toml use strum instead 2024-06-05 17:41:39 -07:00
clippy.toml enable doc_markdown lint 2024-05-14 16:34:10 -07:00
default.nix feat: support non-flake users 2024-02-01 19:19:56 -08:00
engage.toml test all-features in CI 2024-05-30 21:19:09 -07:00
flake.lock update flake.lock 2024-05-24 20:08:54 -07:00
flake.nix add all-features devshell 2024-05-30 21:19:08 -07:00
LICENSE.md convert license to markdown 2024-04-30 21:54:56 -07:00
rust-toolchain.toml update the rust toolchain, ignore new lints 2024-05-24 20:09:41 -07:00
rustfmt.toml enable error_on_line_overflow and fix errors 2024-05-16 19:11:40 -07:00