mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 02:17:36 +00:00
types/key: add a dedicated type for node keys.
Complete with converters to all the other types that represent a node key today, so the new type can gradually subsume old ones. Updates #3206 Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:

committed by
Dave Anderson

parent
22dbaa0894
commit
bc89a796ec
@@ -81,6 +81,15 @@ func (u StableNodeID) IsZero() bool {
|
||||
// NodeKey is the curve25519 public key for a node.
|
||||
type NodeKey [32]byte
|
||||
|
||||
// NodeKeyFromNodePublic returns k converted to a NodeKey.
|
||||
//
|
||||
// Deprecated: exists only as a compatibility bridge while NodeKey
|
||||
// gets removed from the codebase. Do not introduce new uses that
|
||||
// aren't related to #3206.
|
||||
func NodeKeyFromNodePublic(k key.NodePublic) NodeKey {
|
||||
return k.Raw32()
|
||||
}
|
||||
|
||||
// DiscoKey is the curve25519 public key for path discovery key.
|
||||
// It's never written to disk or reused between network start-ups.
|
||||
type DiscoKey [32]byte
|
||||
|
Reference in New Issue
Block a user