summaryrefslogtreecommitdiffstats
path: root/src/federation/keys.rs
Commit message (Collapse)AuthorAgeFilesLines
* federation: merge events, the first revisiontv12 hours1-0/+8
| | | | | | | | | | | | | | | | | | What builds on many heads merges them, but only an event a party writes: in a quiet federation, heads beside each other stay so, and past 64 no event is above them all. Revision 1 (`merge-events`) adds merge events: `{"merge": true}`, signed with a node's own key, the `key` its Ed25519 key, for the party whose node list names it. One counts for nothing, and only gathers what it builds on into the history of what builds on it. Under the base revision, signed by a node its party doesn't list, or by a party's key, it is refused; the model alike. Generated federations begin at either revision, and their nodes merge. A node voting by itself backs no version changing the revision, on any version neither: its party's operators vote on that one, once their nodes run a continuum that knows it. `federation.md` lists the revisions, says what a merge event is, and row 71 is tested (`federation_attack_71`).
* version: say why a version is nonetv20 hours1-6/+18
| | | | | | | | | | | | `Version::read` names what makes a version none: the field it lacks, or the one more it has, that this continuum doesn't know (of the version, a party's keys or node list, a rule), the federation it names beside the one this continuum knows, how many keys or nodes a party has against how many it may, the node ID that is none, and of a key why it is none (`keys::spelled`): its type, its point, or its spelling. A node that stops at a version says so in `stopped` (`GET /events`) and its log; a party's client in what it won't propose or back. The guide to a node that stopped says what `why` tells.
* continuum-party: a key the ssh-agent holds, given itselftv29 hours1-1/+2
| | | | | | | | | `--key` gives a public key itself, an `authorized_keys` line, as well as a file of them: of a file of several, the first signs, with a warning naming it, and another is given itself to sign with it. An agent that doesn't hold the key given signs nothing, and the client stops before it records or puts what it would have signed, saying which key it asked for.
* keys: signing through an ssh-agent tested wherever tests runtv29 hours1-21/+21
| | | | | | The test fails without OpenSSH on the machine testing, rather than passing without asking anything. Its directory is a scratch directory, removed when the test ends, the agent stopped before it.
* attacks: row 62 with an ECDSA signature spelled otherwisetv29 hours1-0/+17
| | | | | | | Row 62 names an ECDSA signature's twins, `s` high (the order less `s`) and `r` or `s` with zeros more in front, each none. Its test offers the ECDSA vector's write with each (`keys::respelled`) to a store whose root names that key, and has it take the write as it was signed.
* continuum-party: signing through an ssh-agentslopulus44 hours1-0/+146
| | | | | | | | | | | | | | A key held in hardware is never a file: only an ssh-agent signs with it. Given a public key as `--key` (a `.pub` file, `ssh-ed25519` or `ecdsa-sha2-nistp256`), the client asks the agent at `SSH_AUTH_SOCK` to sign what SSHSIG signs (a sign request with the key's blob, no flags) and writes the blob around the agent's signature as `ssh-keygen -Y sign` does. An ECDSA signature the agent gives with a high `s` is made low, the other of its two spellings, which the federation takes. What it makes is checked before it is used. A private key file signs as it did. A test starts `ssh-agent`, adds an ECDSA and an Ed25519 key to it and deletes their files, signs through it, and has both continuum and `ssh-keygen -Y verify` check each signature, one of an agent's high-S answers among them. Without OpenSSH it asks nothing.
* keys: a party's key may be ecdsa-sha2-nistp256, its signature low-S onlyslopulus44 hours1-30/+253
| | | | | | | | | | | | | | | | | | | | A party's keys may be held where no file has them, in a Secure Enclave or a phone, and those are ECDSA keys on NIST P-256. Everywhere a party's key counts (a version's keys, a key set, the key an event is signed with) such a key is taken beside an Ed25519 one, spelled as `ssh-keygen` writes it, without a comment: `ecdsa-sha2-nistp256`, a space, and the base64 of its SSH encoding, its point uncompressed and on the curve. Its signature is SSHSIG as an Ed25519 one is, hashed with `sha512`, its inner signature over SHA-256 as SSH signs with such a key. ECDSA signatures are malleable: of `s` and the curve's order less `s`, both check. So the federation takes one spelling alone: `s` low, at most half the order, `r` and `s` each SSH's shortest mpint, and the blob reading back to itself as an Ed25519 one does. What anyone makes of a party's signature is then none, as before. The vectors are a key `ssh-keygen -t ecdsa -b 256` made, a first version naming it, and a write and a key set `ssh-keygen -Y sign` signed with it, each taken; the signature's high-S twin, which checks as ECDSA, and its `r` spelled longer are none. Ed25519 keys and signatures are spelled and checked as they were.
* federation: keys, node IDs and signatures, each spelled one waytv3 days1-0/+147
A key is `ssh-ed25519`, one space, and its base64, padded and canonical, with no comment, its 32 bytes an Ed25519 public key; a node ID is spelled as continuum spells it, its key one too; and a signature is the SSHSIG blob of version 1 for the namespace `continuum-federation`, hashed with `sha512`, its reserved field empty, its key the event's, in base64, padded and canonical, unarmored, checked by continuum's strict check (`access::sshsig::verify_blob`) and read back to what `ssh-keygen` writes around it. `keys::sign` makes one, for clients and tests. Tests show each spelled otherwise taken for none.