mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-10 00:51:07 +00:00
cmd/tailscaled, wgengine, ipn: add /debug/ipn handler with world state
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
dbca186a64
commit
322499473e
@@ -5,7 +5,11 @@
|
||||
// Package key defines some types related to curve25519 keys.
|
||||
package key
|
||||
|
||||
import "golang.org/x/crypto/curve25519"
|
||||
import (
|
||||
"encoding/base64"
|
||||
|
||||
"golang.org/x/crypto/curve25519"
|
||||
)
|
||||
|
||||
// Private represents a curve25519 private key.
|
||||
type Private [32]byte
|
||||
@@ -24,6 +28,13 @@ type Public [32]byte
|
||||
// Public reports whether p is the zero value.
|
||||
func (p Public) IsZero() bool { return p == Public{} }
|
||||
|
||||
// ShortString returns the Tailscale conventional debug representation
|
||||
// of a public key: the first five base64 digits of the key, in square
|
||||
// brackets.
|
||||
func (p Public) ShortString() string {
|
||||
return "[" + base64.StdEncoding.EncodeToString(p[:])[:5] + "]"
|
||||
}
|
||||
|
||||
// B32 returns k as the *[32]byte type that's used by the
|
||||
// golang.org/x/crypto packages. This allocates; it might
|
||||
// not be appropriate for performance-sensitive paths.
|
||||
|
Reference in New Issue
Block a user