feat(agent-fetch): verify agent binaries with age key + XEdDSA (VS-41) #62
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VS-41-age-xeddsa-verifier"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the verifier half of the in-house age-key + XEdDSA agent-binary signing scheme (VA-61 decision, VS-36 epic), replacing the
minisign-verifycrate. Companion publisher PR is in vervain-agent (VA-62).What changed
meshcentral-agent-fetch/src/verify.rs:MinisignVerifierbecomesAgeXeddsaVerifier. It validates the operator'sage1...recipient through theagecrate, recovers the raw 32-byte X25519 public key viabech32(age exposes no byte accessor), and verifies a detached XEdDSA signature with the pure-Rustxeddsacrate (Montgomery-to-Edwards conversion and sign-bit handling are internal to the crate). The method surface (from_pubkey_str,verify) and theVerifyErrorvariants are unchanged, so call sites only see the rename.meshagent-<id>.minisigbecomes a two-linemeshagent-<id>.sig(anuntrusted comment:line plus base64 of the raw 64-byte signature). Verification is over the full binary bytes. Fail-closed is preserved: a binary that does not verify is never written to disk.publickeyconfig now holds theage1...recipient. Boot (boot.rs), the VS-37 runtime overlay (settings_overlay.rs), the env seed (agent_fetcher_seed.rs), and.env.exampleare updated.minisign-verify; addage,xeddsa,bech32,base64.Interop guarantee
The two repos have no shared crate, so a fixed cross-repo known-answer vector (
age1...recipient + message + signature) is embedded as a unit test in BOTH this crate and vervain-agent. Any drift in signature format, bech32 handling, or curve handling fails the test in both repos.Tests
cargo test -p meshcentral-agent-fetchpasses (19 tests), including the roundtrip (age keypair signs and verifies), tampered-binary rejection, wrong-key rejection, and the shared known-answer vector.cargo check -p meshcentral -p meshcentral-web --testsis clean.This is bespoke (non-standard) cryptography by design, per the VA-61 decision: it is isolated behind the verifier module and leans entirely on the
xeddsacrate (no hand-rolled curve math). Multi-key rotation (apublickeysset) stays out of scope; the config remains a singlepublickey.