client,cmd/tailscale,ipn,tka,types: implement tka initialization flow

This PR implements the client-side of initializing network-lock with the
Coordination server.

Signed-off-by: Tom DNetto <tom@tailscale.com>
This commit is contained in:
Tom DNetto
2022-08-11 10:43:09 -07:00
committed by Tom
parent 18edd79421
commit facafd8819
18 changed files with 514 additions and 13 deletions

View File

@ -23,11 +23,11 @@ func TestSigDirect(t *testing.T) {
KeyID: key.ID(),
Pubkey: nodeKeyPub,
}
sigHash := sig.sigHash()
sigHash := sig.SigHash()
sig.Signature = ed25519.Sign(priv, sigHash[:])
if sig.sigHash() != sigHash {
t.Errorf("sigHash changed after signing: %x != %x", sig.sigHash(), sigHash)
if sig.SigHash() != sigHash {
t.Errorf("sigHash changed after signing: %x != %x", sig.SigHash(), sigHash)
}
if err := sig.verifySignature(key); err != nil {
@ -44,7 +44,7 @@ func TestSigSerializeUnserialize(t *testing.T) {
KeyID: key.ID(),
Pubkey: nodeKeyPub,
}
sigHash := sig.sigHash()
sigHash := sig.SigHash()
sig.Signature = ed25519.Sign(priv, sigHash[:])
var decoded NodeKeySignature