From d78c3e11f1a37112316e48272d10f00abc0bfd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 24 May 2023 18:43:57 +0200 Subject: [PATCH] signatures: Remove age_ts from reference hash calculation According to a spec clarification --- crates/ruma-signatures/CHANGELOG.md | 4 ++++ crates/ruma-signatures/src/functions.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ruma-signatures/CHANGELOG.md b/crates/ruma-signatures/CHANGELOG.md index c0a12a53..886e8e54 100644 --- a/crates/ruma-signatures/CHANGELOG.md +++ b/crates/ruma-signatures/CHANGELOG.md @@ -4,6 +4,10 @@ Bug fixes: - Ignore keys with unknown algorithms in `verify_events` +Improvements: + +- Remove `age_ts` from `REFERENCE_HASH_FIELDS_TO_REMOVE` according to a spec clarification + # 0.13.1 No changes for this version diff --git a/crates/ruma-signatures/src/functions.rs b/crates/ruma-signatures/src/functions.rs index 96ef8e13..73fd8965 100644 --- a/crates/ruma-signatures/src/functions.rs +++ b/crates/ruma-signatures/src/functions.rs @@ -31,7 +31,7 @@ static CANONICAL_JSON_FIELDS_TO_REMOVE: &[&str] = &["signatures", "unsigned"]; static CONTENT_HASH_FIELDS_TO_REMOVE: &[&str] = &["hashes", "signatures", "unsigned"]; /// The fields to remove from a JSON object when creating a reference hash of an event. -static REFERENCE_HASH_FIELDS_TO_REMOVE: &[&str] = &["age_ts", "signatures", "unsigned"]; +static REFERENCE_HASH_FIELDS_TO_REMOVE: &[&str] = &["signatures", "unsigned"]; /// Signs an arbitrary JSON object and adds the signature to an object under the key `signatures`. ///