mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-03 02:21:58 +00:00
wgengine/wgcfg: convert to use new node key type.
Updates #3206 Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
committed by
Dave Anderson
parent
a47158e14d
commit
a9c78910bd
@@ -54,6 +54,19 @@ func NewNode() NodePrivate {
|
||||
return ret
|
||||
}
|
||||
|
||||
// NodePrivateFromRaw32 parses a 32-byte raw value as a NodePrivate.
|
||||
//
|
||||
// Deprecated: only needed to cast from legacy node private key types,
|
||||
// do not add more uses unrelated to #3206.
|
||||
func NodePrivateFromRaw32(raw mem.RO) NodePrivate {
|
||||
if raw.Len() != 32 {
|
||||
panic("input has wrong size")
|
||||
}
|
||||
var ret NodePrivate
|
||||
raw.Copy(ret.k[:])
|
||||
return ret
|
||||
}
|
||||
|
||||
func ParseNodePrivateUntyped(raw mem.RO) (NodePrivate, error) {
|
||||
var ret NodePrivate
|
||||
if err := parseHex(ret.k[:], raw, mem.B(nil)); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user