Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -2054,6 +2054,13 @@ func (d *Daemon) RotateKey() (map[string]interface{}, error) {
d.identity = newID
d.identityMu.Unlock()

// Zero the old private key so it doesn't linger on the heap
// until GC — a long-lived daemon can keep it alive for hours.
// ed25519.PrivateKey is a []byte (seed || public).
for i := range current.PrivateKey {
current.PrivateKey[i] = 0
}

d.tunnels.SetIdentity(newID)
// The signer installed in Start() reads d.identity under d.identityMu
// on every call, so this SetSigner re-bind is no longer load-bearing —
Expand Down
Loading