spse

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Basic definitions
	SecModeLength   = 1
	TimestampLength = 4

	// Metadata length (Shall be 4 + i*8, were i in [0,1,...])
	AesCMacMetaLength    = TimestampLength
	HmacSha256MetaLength = TimestampLength
	ED25519MetaLength    = TimestampLength
	GcmAes128MetaLength  = TimestampLength

	// Authenticator length
	AesCMacAuthLength    = 16
	HmacSha256AuthLength = 32
	ED25519AuthLength    = 64
	GcmAes128AuthLength  = 16

	AesCMacTotalLength    = SecModeLength + AesCMacMetaLength + AesCMacAuthLength
	HmacSha256TotalLength = SecModeLength + HmacSha256MetaLength + HmacSha256AuthLength
	ED25519TotalLength    = SecModeLength + ED25519MetaLength + ED25519AuthLength
	GcmAes128TotalLength  = SecModeLength + GcmAes128MetaLength + GcmAes128AuthLength
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseExtn

type BaseExtn struct {
	// SecMode indicates the security mode of the extension.
	SecMode SecMode
}

BaseExtn is the base for Extn, scmp_auth.DRKeyExt and scmp_auth.HashTreeExt

func (*BaseExtn) Class

func (s *BaseExtn) Class() common.L4ProtocolType

func (*BaseExtn) Reverse

func (s *BaseExtn) Reverse() (bool, error)

func (*BaseExtn) Type

func (s *BaseExtn) Type() common.ExtnType

type Extn

type Extn struct {
	*BaseExtn
	// Metadata contains the metadata required by the security mode.
	Metadata common.RawBytes
	// Authenticator contains the authenticator required by the security mode.
	Authenticator common.RawBytes
}

Extn is the implementation of the SCIONPacketSecurity extension.

func NewExtn

func NewExtn(secMode SecMode) (*Extn, error)

func (*Extn) Copy

func (s *Extn) Copy() common.Extension

func (*Extn) Len

func (s *Extn) Len() int

func (*Extn) Pack

func (s *Extn) Pack() (common.RawBytes, error)

func (*Extn) SetAuthenticator

func (s *Extn) SetAuthenticator(authenticator common.RawBytes) error

Set the Authenticator.

func (*Extn) SetMetadata

func (s *Extn) SetMetadata(metadata common.RawBytes) error

Set the Metadata.

func (*Extn) String

func (s *Extn) String() string

func (*Extn) Write

func (s *Extn) Write(b common.RawBytes) error

type SecMode

type SecMode uint8
const (
	// SecMode codes
	AesCMac SecMode = iota
	HmacSha256
	Ed25519
	GcmAes128
	ScmpAuthDRKey
	ScmpAuthHashTree
)

func (SecMode) String

func (s SecMode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL