ssh/tailssh: use control server time instead of local time

This takes advantage of existing functionality in ipn/ipnlocal to adjust
the local clock based on periodic time signals from the control server.
This way, when checking things like SSHRule expirations, calculations are
protected incorrectly set local clocks.

Fixes tailscale/corp#15796

Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
Ox Cart
2023-11-14 16:15:57 -06:00
committed by Percy Wegmann
parent bd534b971a
commit 719ee4415e
2 changed files with 10 additions and 0 deletions

View File

@@ -109,6 +109,9 @@ func init() {
lb: lb,
logf: logf,
tailscaledPath: tsd,
timeNow: func() time.Time {
return lb.ControlNow(time.Now())
},
}
return srv, nil