Commit e10844d
committed
state: apply a new pre-auth key's tags on re-registration
An already-tagged node re-authenticating with a fresh, differently-tagged
pre-auth key had the key validated and consumed but its tags discarded;
only a user-owned->tagged conversion applied them. Re-key when the
presented key differs from the node's current AuthKeyID, matching
Tailscale's documented retag-by-rekey (KB 1068). Same-key re-auth still
preserves tags and admin overrides.
Applying a differently-tagged key is an authorization decision, so a retag
forces key validation instead of riding the same-NodeKey fast path; a
spent, revoked or expired key can no longer retag a node.
Also persist AuthKeyID on the re-registration write. It was set in the
NodeStore but excluded from the column set (#2862, to avoid persisting a
deleted key's stale reference on MapRequest), so a restart reloaded the
old key and any key-scoped property (notably Ephemeral) silently reverted,
risking GC of a node meant to be persistent. The re-registration key is
freshly validated, so persisting it is safe; the MapRequest path is
unchanged.
Fixes #33701 parent 04fd52b commit e10844d
4 files changed
Lines changed: 771 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
0 commit comments