summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient/direct.go
diff options
context:
space:
mode:
Diffstat (limited to 'control/controlclient/direct.go')
-rw-r--r--control/controlclient/direct.go16
1 files changed, 0 insertions, 16 deletions
diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go
index cbbf2bdfe..3b4e6ba9b 100644
--- a/control/controlclient/direct.go
+++ b/control/controlclient/direct.go
@@ -79,7 +79,6 @@ type Direct struct {
autoUpdatePub *eventbus.Publisher[AutoUpdate]
controlTimePub *eventbus.Publisher[ControlTime]
getMachinePrivKey func() (key.MachinePrivate, error)
- persistState func(persist.PersistView) // or nil; called before RegisterRequest to persist new node key
debugFlags []string
pinger Pinger
popBrowser func(url string) // or nil
@@ -177,12 +176,6 @@ type Options struct {
// attempted. It is used to allow the client to clean up any resources or complete any
// tasks that are dependent on a live client.
Shutdown func()
-
- // PersistState, if non-nil, is called with an updated Persist after
- // generating a new node key but before sending the RegisterRequest.
- // This allows the caller to write the key to durable storage so that
- // a crash during registration doesn't lose the key.
- PersistState func(persist.PersistView)
}
// ControlDialPlanner is the interface optionally supplied when creating a
@@ -338,7 +331,6 @@ func NewDirect(opts Options) (*Direct, error) {
dialer: opts.Dialer,
dnsCache: dnsCache,
dialPlan: opts.DialPlan,
- persistState: opts.PersistState,
}
c.discoPubKey = opts.DiscoPublicKey
c.closedCtx, c.closeCtx = context.WithCancel(context.Background())
@@ -665,14 +657,6 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new
persist.NetworkLockKey = key.NewNLPrivate()
}
- // Persist the new key before the RegisterRequest so a crash
- // mid-HTTP doesn't lose it.
- if c.persistState != nil && !tryingNewKey.IsZero() && (persist.PrivateNodeKey.IsZero() || tryingNewKey.Public() != persist.PrivateNodeKey.Public()) {
- preHTTPPersist := persist
- preHTTPPersist.PrivateNodeKey = tryingNewKey
- c.persistState(preHTTPPersist.View())
- }
-
nlPub := persist.NetworkLockKey.Public()
if tryingNewKey.IsZero() {