From d56b3b069782585a6edcc9c608236361c2644a51 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 8 Nov 2026 14:18:33 +0000 Subject: envelope: a signed value names its swarm Review 3.1, part of finding 12: a signed value's payload bound path, user, time and prev, but not the swarm. A user with the same name and key in two swarms could have an envelope replayed from one into the other, wherever the path holds no envelope yet (prev ""). The payload now names the swarm (`swarm`), and a node takes an envelope only for its own. /auth/whoami says the swarm, and continuum-signed and the example in api.md sign it. Wire version 44: nodes before this refuse such envelopes, and those after refuse the old ones. --- src/api/store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/api/store.rs') diff --git a/src/api/store.rs b/src/api/store.rs index 101957a..81d0046 100644 --- a/src/api/store.rs +++ b/src/api/store.rs @@ -1315,7 +1315,7 @@ mod tests { fn envelope_of(value: JsonValue) -> String { use base64::{Engine, engine::general_purpose::URL_SAFE_NO_PAD}; - let payload = json!({"path": ["x"], "value": value, "user": "alice", "at": 1, "prev": ""}); + let payload = json!({"swarm": "s", "path": ["x"], "value": value, "user": "alice", "at": 1, "prev": ""}); format!("cv1.{}.c2ln", URL_SAFE_NO_PAD.encode(payload.to_string())) } -- cgit v1.3.1