Documentation ¶
Overview ¶
Package ctrl handles SCION control-plane payloads, which are encoded as capnp proto messages. Each ctrl payload has a 4B length field prefixed to the start of the capnp message.
Index ¶
- Constants
- func GetChainForSign(ctx context.Context, s *SignSrcDef, tStore infra.TrustStore) (*cert.Chain, error)
- func VerifySig(ctx context.Context, p *SignedPld, sigV SigVerifier) error
- type BasicSigVerifier
- type BasicSigner
- type Data
- type Pld
- func (p *Pld) Copy() (common.Payload, error)
- func (p *Pld) GetCertMgmt() (*cert_mgmt.Pld, *Data, error)
- func (p *Pld) GetPathMgmt() (*path_mgmt.Pld, *Data, error)
- func (p *Pld) Len() int
- func (p *Pld) PackPld() (common.RawBytes, error)
- func (p *Pld) ProtoId() proto.ProtoIdType
- func (p *Pld) SignedPld(signer Signer) (*SignedPld, error)
- func (p *Pld) String() string
- func (p *Pld) Union() (proto.Cerealizable, error)
- func (p *Pld) Write(b common.RawBytes) (int, error)
- func (p *Pld) WritePld(b common.RawBytes) (int, error)
- type SigVerifier
- type SignSrcDef
- type SignedPld
- func (sp *SignedPld) Copy() (common.Payload, error)
- func (sp *SignedPld) Len() int
- func (sp *SignedPld) PackPld() (common.RawBytes, error)
- func (sp *SignedPld) Pld() (*Pld, error)
- func (sp *SignedPld) ProtoId() proto.ProtoIdType
- func (sp *SignedPld) SetPld(p *Pld) error
- func (sp *SignedPld) String() string
- func (sp *SignedPld) WritePld(b common.RawBytes) (int, error)
- type Signer
Constants ¶
const ( // SrcDefaultPrefix is the default prefix for proto.SignS.Src. SrcDefaultPrefix = "DEFAULT: " // SrcDefaultFmt is the default format for proto.SignS.Src. SrcDefaultFmt = `^` + SrcDefaultPrefix + `IA: (\S+) CHAIN: (\d+) TRC: (\d+)$` )
const LenSize = 4
const SignatureValidity = 2 * time.Second
Variables ¶
This section is empty.
Functions ¶
func GetChainForSign ¶ added in v0.1.1
func GetChainForSign(ctx context.Context, s *SignSrcDef, tStore infra.TrustStore) (*cert.Chain, error)
Types ¶
type BasicSigVerifier ¶
type BasicSigVerifier struct {
// contains filtered or unexported fields
}
BasicSigVerifier is a SigVerifier that ignores signatures on cert_mgmt.TRC and cert_mgmt.Chain messages, to avoid dependency cycles.
func NewBasicSigVerifier ¶
func NewBasicSigVerifier(tStore infra.TrustStore) *BasicSigVerifier
type BasicSigner ¶
type BasicSigner struct {
// contains filtered or unexported fields
}
BasicSigner is a simple implementation of Signer.
func NewBasicSigner ¶
func NewBasicSigner(s *proto.SignS, key common.RawBytes) *BasicSigner
NewBasicSigner creates a Signer that uses the supplied s and key to sign Pld's.
type Pld ¶
type Pld struct { *Data // contains filtered or unexported fields }
func NewCertMgmtPld ¶
NewCertMgmtPld creates a new control payload, containing a new cert_mgmt payload, which in turn contains the supplied Cerealizable instance.
func NewPathMgmtPld ¶
NewPathMgmtPld creates a new control payload, containing a new path_mgmt payload, which in turn contains the supplied Cerealizable instance.
func NewPld ¶
func NewPld(u proto.Cerealizable, d *Data) (*Pld, error)
NewPld creates a new control payload, containing the supplied Cerealizable instance.
func (*Pld) GetCertMgmt ¶
GetCertMgmt returns the CertMgmt payload and the CtrlPld's non-union Data. If the union type is not CertMgmt, an error is returned.
func (*Pld) GetPathMgmt ¶
GetCertMgmt returns the PathMgmt payload and the CtrlPld's non-union Data. If the union type is not PathMgmt, an error is returned.
func (*Pld) ProtoId ¶
func (p *Pld) ProtoId() proto.ProtoIdType
type SigVerifier ¶
SigVerifier verifies the signature of a SignedPld.
var NullSigVerifier SigVerifier = &nullSigVerifier{}
NullSigVerifier ignores signatures on all messages.
type SignSrcDef ¶
func NewSignSrcDefFromRaw ¶
func NewSignSrcDefFromRaw(b common.RawBytes) (*SignSrcDef, error)
func (*SignSrcDef) Pack ¶
func (s *SignSrcDef) Pack() common.RawBytes
func (*SignSrcDef) String ¶
func (s *SignSrcDef) String() string
Directories ¶
Path | Synopsis |
---|---|
Package ctrl_msg implements a layer for sending SCION Ctrl payload requests/notifications via the infra dispatcher, including integrated signing and signature verification of ctrl payloads.
|
Package ctrl_msg implements a layer for sending SCION Ctrl payload requests/notifications via the infra dispatcher, including integrated signing and signature verification of ctrl payloads. |