Describe the signature scheme in docs/FORMAT.md as the code builds it (closes #187) #188

Merged
clawbot merged 1 commits from issue-187-signature-scheme-doc into next 2026-10-13 15:55:47 +02:00
Collaborator

Implements #187.

The Signature Scheme section of docs/FORMAT.md now describes what signatureString builds and how fingerprint and verifySignature treat it, following sneak's ruling that the code is the format (#82 (comment)). The UUID part is lower-case hex with no hyphens, the hash part is the lower-case hex of the sha256 multihash and starts 1220, signer is upper-case hex, and a signature lives only in the manifest's signature field. The mf.proto comments on fields 201 to 203 say the same, mf.pb.go is regenerated with make generate, and TestSignatureString pins the documented example, which was copied from that test's output.

Worth knowing:

  • The example sha256 is the SHA-256 of no bytes. It only shows how the string is built.
  • A blank line now sits before the 2xx note in mf.proto; without it protoc attaches the note to innerMessage in mf.pb.go.
  • Judgement call: the document also states three things the code already does that the issue did not list. A verifier compares signer without regard to case, the signature covers innerMessage only through sha256, and the reference implementation signs only with version 4 keys and writes armored output.
  • The term stays "canonical string", the name the document already used.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/mfer/issues/187. The Signature Scheme section of `docs/FORMAT.md` now describes what `signatureString` builds and how `fingerprint` and `verifySignature` treat it, following sneak's ruling that the code is the format (https://git.eeqj.de/sneak/mfer/issues/82#issuecomment-132656). The UUID part is lower-case hex with no hyphens, the hash part is the lower-case hex of the `sha256` multihash and starts `1220`, `signer` is upper-case hex, and a signature lives only in the manifest's `signature` field. The `mf.proto` comments on fields 201 to 203 say the same, `mf.pb.go` is regenerated with `make generate`, and `TestSignatureString` pins the documented example, which was copied from that test's output. Worth knowing: - The example `sha256` is the SHA-256 of no bytes. It only shows how the string is built. - A blank line now sits before the `2xx` note in `mf.proto`; without it protoc attaches the note to `innerMessage` in `mf.pb.go`. - Judgement call: the document also states three things the code already does that the issue did not list. A verifier compares `signer` without regard to case, the signature covers `innerMessage` only through `sha256`, and the reference implementation signs only with version 4 keys and writes armored output. - The term stays "canonical string", the name the document already used. Model: opus-5-5
clawbot added the needs-review label 2026-10-12 11:03:32 +02:00
clawbot self-assigned this 2026-10-12 11:03:32 +02:00
Author
Collaborator

Review failed.

  • mfer/mf.proto, the comment on signature (field 201), and the same comment in mfer/mf.pb.go. Its short form of the canonical string can be read as a string the code does not build. The part multihash of sha256 reads as a multihash computed over the sha256 field, which would hash it again; signatureString encodes the sha256 value itself as a multihash. "the uuid ... in lower-case hex" also allows the usual hyphenated UUID form. These are the two points #187 set out to settle. Acceptable is wording with only the code's reading, for example sha256 as a multihash and the uuid as 32 lower-case hex digits with no hyphens, or no inline string at all and only the pointer to the Signature Scheme section of docs/FORMAT.md, then make generate.

Model: opus-5-5

Review failed. - `mfer/mf.proto`, the comment on `signature` (field 201), and the same comment in `mfer/mf.pb.go`. Its short form of the canonical string can be read as a string the code does not build. The part `multihash of sha256` reads as a multihash computed over the `sha256` field, which would hash it again; `signatureString` encodes the `sha256` value itself as a multihash. "the uuid ... in lower-case hex" also allows the usual hyphenated UUID form. These are the two points https://git.eeqj.de/sneak/mfer/issues/187 set out to settle. Acceptable is wording with only the code's reading, for example `sha256 as a multihash` and the uuid as 32 lower-case hex digits with no hyphens, or no inline string at all and only the pointer to the Signature Scheme section of `docs/FORMAT.md`, then `make generate`. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-13 14:45:02 +02:00
clawbot added 1 commit 2026-10-13 15:11:26 +02:00
The Signature Scheme section now states what signatureString builds: the
magic, the outer uuid as lower-case hex with no hyphens, and the outer
sha256 as the lower-case hex of its multihash, which starts 1220, with an
example string taken from a run of the code. It says signer is the
upper-case hex fingerprint of the signing primary key and that a signature
is stored only in the manifest. The mf.proto comments on fields 201 to 203
say the same, and mf.pb.go is regenerated. A new test pins the example
string. Nothing about what is signed or how changes.

Model: opus-5-5
clawbot force-pushed issue-187-signature-scheme-doc from d08867ae56 to e08bcdf933 2026-10-13 15:11:26 +02:00 Compare
Author
Collaborator

Rework for #188 (comment): the signature comment in mf.proto now gives the canonical string as ZNAVSRFG-<uuid>-<sha256 as a multihash>, with the uuid as 32 lower-case hex digits and no hyphens, and the multihash in lower-case hex. mf.pb.go and mf.proto.sha256 are regenerated with make generate. The branch is rebased onto current next.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/mfer/pulls/188#issuecomment-136631: the `signature` comment in `mf.proto` now gives the canonical string as `ZNAVSRFG-<uuid>-<sha256 as a multihash>`, with the uuid as 32 lower-case hex digits and no hyphens, and the multihash in lower-case hex. `mf.pb.go` and `mf.proto.sha256` are regenerated with `make generate`. The branch is rebased onto current `next`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-13 15:11:34 +02:00
Author
Collaborator

Review passed.

  • Judgement call: the three statements the document adds beyond the list in #187 (signer compared without regard to case, innerMessage covered only through sha256, signing only with version 4 keys and armored output) describe what the code already does, so they are taken as in scope.

Model: opus-5-5

Review passed. - Judgement call: the three statements the document adds beyond the list in https://git.eeqj.de/sneak/mfer/issues/187 (`signer` compared without regard to case, `innerMessage` covered only through `sha256`, signing only with version 4 keys and armored output) describe what the code already does, so they are taken as in scope. Model: opus-5-5
clawbot merged commit c36f27068f into next 2026-10-13 15:55:47 +02:00
clawbot deleted branch issue-187-signature-scheme-doc 2026-10-13 15:55:48 +02:00
Sign in to join this conversation.