The device id is derived from the pubkey in JoinRequest, but the hub never checked the joiner actually held that key — anyone with a token could enroll claiming another device's identity. Now the client signs JoinChallenge(token, pubkey) with its ed25519 private key and the hub verifies it (ed25519.Verify) BEFORE redeeming the token — so a bad request can't burn a legitimate one-time token either. proto gains a Signature field + the shared JoinChallenge helper. Regression test: garbage/missing/wrong-key sigs all 401, token survives, valid join enrolls. |
||
|---|---|---|
| .. | ||
| deploy_test.go | ||
| fsync_test.go | ||
| hooks_integration_test.go | ||
| preserve_ignored_test.go | ||
| pull.go | ||
| pull_test.go | ||
| restore_test.go | ||
| safejoin_test.go | ||
| syncer.go | ||
| syncer_test.go | ||