Documentation
¶
Overview ¶
Package agentlink contains the versioned signed-link handshake shared by the panel and node agent.
Index ¶
- Constants
- Variables
- func AgentDigest(nodeID, audience string, panelNonce []byte) []byte
- func PanelDigest(nodeID, audience string, panelNonce, agentNonce []byte) []byte
- func ReadFrame(ctx context.Context, ws *websocket.Conn) (websocket.MessageType, []byte, error)
- func Sign(key *ecdsa.PrivateKey, digest []byte) ([]byte, error)
- func Verify(key *ecdsa.PublicKey, digest, signature []byte) bool
- func WriteFrame(ctx context.Context, ws *websocket.Conn, message proto.Message) error
Constants ¶
const MaxFrameSize = 4 << 20
MaxFrameSize is the maximum encoded link frame size in bytes (4 MiB).
Variables ¶
var ErrFrameTooLarge = errors.New("link frame too large")
ErrFrameTooLarge reports a link frame whose encoded payload exceeds MaxFrameSize.
Functions ¶
func AgentDigest ¶
AgentDigest hashes the mistgate-agent-link/1 domain, NUL-separated node ID and audience, and panel nonce with SHA-256.
func PanelDigest ¶
PanelDigest hashes the mistgate-panel-link/1 domain, NUL-separated node ID and audience, and concatenated nonces with SHA-256.
func Sign ¶
func Sign(key *ecdsa.PrivateKey, digest []byte) ([]byte, error)
Sign signs digest and encodes the ECDSA signature as fixed-width r||s: two 32-byte big-endian scalars.
Types ¶
This section is empty.