From 45cdc3c64bedb6eefe4a3645afbde82e62f8112a Mon Sep 17 00:00:00 2001 From: slopulus Date: Tue, 17 Nov 2026 20:01:42 +0100 Subject: federation.md, federation-tests.md: ecdsa-sha2-nistp256 keys, their signature low-S A key is `ssh-ed25519` or `ecdsa-sha2-nistp256`, spelled alike; an ECDSA signature is over SHA-256, its `s` low and `r` and `s` SSH's shortest mpints, so that it is spelled one way. The vectors and the agent test, among the harness's. --- docs/federation.md | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'docs/federation.md') diff --git a/docs/federation.md b/docs/federation.md index 7b453af..f30cdd4 100644 --- a/docs/federation.md +++ b/docs/federation.md @@ -46,7 +46,8 @@ What an adversary can do: * delay or drop messages between any nodes, short of forever between honest ones; * steal another party's key. -What it can't: forge an Ed25519 signature, or find two byte strings with one SHA-256. +What it can't: forge an Ed25519 or ECDSA signature, or find two byte strings with one +SHA-256. Out of scope: keeping anything from being read (every party reads all of it), hiding who talks to whom, and a party's own machine taken over whole (then the adversary is that @@ -125,11 +126,12 @@ Spread out: * **`deps`**: the IDs of its dependencies, as 64 lower-case hex digits, one at least, ascending, none twice; a client gives the heads it read. -* **`party`** and **`key`**: the party that signs it, and the key it signs with: - `ssh-ed25519`, one space, and the key's base64, padded and canonical, with no comment, - its 32 bytes an Ed25519 public key. Keys in a version and a key set are spelled so - too, and node IDs as continuum spells them: `continuum:` and the 64 lower-case hex - digits of the node's Ed25519 public key. +* **`party`** and **`key`**: the party that signs it, and the key it signs with: its + type, one space, and the base64 of its SSH encoding, padded and canonical, with no + comment. Two types: `ssh-ed25519`, its 32 bytes an Ed25519 public key, and + `ecdsa-sha2-nistp256`, its point on NIST P-256 uncompressed. Keys in a version and a + key set are spelled so too, and node IDs as continuum spells them: `continuum:` and + the 64 lower-case hex digits of the node's Ed25519 public key. * **What it does**, one field of: * `write`, `{"path": "", "value": }`: a value at a place (The policy); * `keys`, `["", …]`: the party's key set (Keys); @@ -141,9 +143,14 @@ Spread out: * **`sig`**: an SSH signature (`ssh-keygen -Y sign`, namespace `continuum-federation`) over the event's bytes without `sig`: the SSHSIG blob of version 1, hashed with `sha512`, its key the event's `key`, its reserved field empty, as `ssh-keygen` writes - it, in base64, padded and canonical, unarmored. It is checked as continuum checks a - user's signature, strictly *(checked: `access::sshsig::verify_blob`)*, which takes - `sha256` too, and any reserved field: the federation asks `sha512` and an empty one. + it, in base64, padded and canonical, unarmored. An Ed25519 signature is checked as + continuum checks a user's signature, strictly *(checked: + `access::sshsig::verify_blob`)*, which takes `sha256` too, and any reserved field: the + federation asks `sha512` and an empty one. An ECDSA signature is over the SHA-256 of + what it signs, as SSH signs with such a key. Its `s` and the curve's order less `s` + both check, so the federation takes the low one alone, at most half the order, and `r` + and `s` each as SSH's shortest mpint *(checked: `federation::keys`)*. `ssh-keygen` + makes either; a party's client makes `s` low. Three things no party signs, as their bytes need no signer, each without `party`, `key` and `sig`: a version event (Changing the policy), and a federation's root and a fork's, @@ -193,12 +200,13 @@ current at its heads, Forks). Spread out: * **The federation** it follows, and its **number**, one more than that of the version it changes. * **The parties and their keys** (`keys`): one party at least, each by name, as - continuum's user names, 1 to 64 of `A-Z a-z 0-9 . _ @ -`, with one `ssh-ed25519` key - or more, none twice in the version. With them the party signs its votes and proposals - on this version, its key set and its node list (Keys, Nodes). Its `since` is the - number of the version that named them anew: this one's where it does (a party new in - it, keys the parties replace, or the same keys named anew), else the `since` the - version it changes gives the party, whose keys it then names unchanged. + continuum's user names, 1 to 64 of `A-Z a-z 0-9 . _ @ -`, with one key or more + (`ssh-ed25519` or `ecdsa-sha2-nistp256`, Events), none twice in the version. With them + the party signs its votes and proposals on this version, its key set and its node list + (Keys, Nodes). Its `since` is the number of the version that named them anew: this + one's where it does (a party new in it, keys the parties replace, or the same keys + named anew), else the `since` the version it changes gives the party, whose keys it + then names unchanged. * **The node lists** (`nodes`): every party's, a list of node IDs, none twice, with its `since` as keys have one. The version that lets a party in names its list anew, empty where it gives it no nodes, so that a list it wrote before it was taken out counts no -- cgit v1.3.1