Update
This commit is contained in:
1 parent
3530afb854
commit
6903fcff27
2146 files changed
+112256
-190703
No files matched your search
+4
-7
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// Copyright (c) Tailscale Inc & contributors
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
package tka
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"crypto/ed25519"
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
|
||||
"tailscale.com/types/tkatype"
|
||||
)
|
||||
@@ -31,7 +32,7 @@ func (k KeyKind) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
// Key describes the public components of a key known to network-lock.
|
||||
// Key describes the public components of a key known to tailnet-lock.
|
||||
type Key struct {
|
||||
Kind KeyKind `cbor:"1,keyasint"`
|
||||
|
||||
@@ -64,9 +65,7 @@ func (k Key) Clone() Key {
|
||||
|
||||
if k.Meta != nil {
|
||||
out.Meta = make(map[string]string, len(k.Meta))
|
||||
for k, v := range k.Meta {
|
||||
out.Meta[k] = v
|
||||
}
|
||||
maps.Copy(out.Meta, k.Meta)
|
||||
}
|
||||
|
||||
return out
|
||||
@@ -105,8 +104,6 @@ func (k Key) Ed25519() (ed25519.PublicKey, error) {
|
||||
}
|
||||
}
|
||||
|
||||
const maxMetaBytes = 512
|
||||
|
||||
func (k Key) StaticValidate() error {
|
||||
if k.Votes > 4096 {
|
||||
return fmt.Errorf("excessive key weight: %d > 4096", k.Votes)
|
||||
|
||||
Reference in new issue
Block a user