ipn/ipnstate: use key.NodePublic instead of the generic key.Public.

Updates #3206.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2021-10-28 16:56:44 -07:00
committed by Dave Anderson
parent ebae0d95d0
commit c1d009b9e9
6 changed files with 24 additions and 19 deletions

View File

@@ -1006,10 +1006,10 @@ func (s *Server) verifyClient(clientKey key.NodePublic, info *clientInfo) error
if err != nil {
return fmt.Errorf("failed to query local tailscaled status: %w", err)
}
if clientKey == key.NodePublicFromRaw32(mem.B(status.Self.PublicKey[:])) {
if clientKey == status.Self.PublicKey {
return nil
}
if _, exists := status.Peer[clientKey.AsPublic()]; !exists {
if _, exists := status.Peer[clientKey]; !exists {
return fmt.Errorf("client %v not in set of peers", clientKey)
}
// TODO(bradfitz): add policy for configurable bandwidth rate per client?