tka,types/key: remove dependency for tailcfg & types/ packages on tka
Following the pattern elsewhere, we create a new tka-specific types package for the types that need to couple between the serialized structure types, and tka. Signed-off-by: Tom DNetto <tom@tailscale.com>
This commit is contained in:
+2
-1
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/fxamacker/cbor/v2"
|
||||
"github.com/hdevalence/ed25519consensus"
|
||||
"golang.org/x/crypto/blake2s"
|
||||
"tailscale.com/types/tkatype"
|
||||
)
|
||||
|
||||
// SigKind describes valid NodeKeySignature types.
|
||||
@@ -67,7 +68,7 @@ func (s NodeKeySignature) sigHash() [blake2s.Size]byte {
|
||||
}
|
||||
|
||||
// Serialize returns the given NKS in a serialized format.
|
||||
func (s *NodeKeySignature) Serialize() []byte {
|
||||
func (s *NodeKeySignature) Serialize() tkatype.MarshaledSignature {
|
||||
out := bytes.NewBuffer(make([]byte, 0, 128)) // 64byte sig + 32byte keyID + 32byte headroom
|
||||
encoder, err := cbor.CTAP2EncOptions().EncMode()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user