Documentation ¶
Index ¶
- func GenerateRandomNumber() (*big.Int, error)
- func GenerateRandomUint8() (uint8, error)
- type ChildSA
- func (childsa *ChildSA) CalcKEMaterial(peerPublicValue []byte) ([]byte, []byte, error)
- func (childsa *ChildSA) GenerateKey(prf hash.Hash, dhSharedKey, concatenatedNonce []byte) error
- func (childsa *ChildSA) GenerateXFRMPolicy(role int) error
- func (childsa *ChildSA) GenerateXFRMState(role int, allocspi bool) error
- func (childsa *ChildSA) GetDHTransformID() uint16
- func (childsa *ChildSA) SelectProposal(proposal *message.Proposal) bool
- func (childsa *ChildSA) SetProposal(proposal *message.Proposal) bool
- func (childsa *ChildSA) SetXFRMState(role int) error
- func (childsa *ChildSA) ToProposal() *message.Proposal
- func (childsa *ChildSA) XFRMRuleAdd() error
- func (childsa *ChildSA) XFRMRuleFlush() error
- type IKESA
- func (ikesa *IKESA) CalcIKEChecksum(data []byte) error
- func (ikesa *IKESA) CalcKEMaterial(peerPublicValue []byte) ([]byte, []byte, error)
- func (ikesa *IKESA) CheckMessageID(mID uint32) bool
- func (ikesa *IKESA) DecryptSKPayload(data []byte) ([]byte, error)
- func (ikesa *IKESA) EncryptToSKPayload(data []byte) ([]byte, error)
- func (ikesa *IKESA) GenerateKey(concatenatedNonce, dhSharedKey, concatenatedSPI []byte) error
- func (ikesa *IKESA) GetAuth(kn3iwf []byte, signedOctets []byte) []byte
- func (ikesa *IKESA) GetDHTransformID() uint16
- func (ikesa *IKESA) SelectProposal(proposal *message.Proposal) bool
- func (ikesa *IKESA) SetProposal(proposal *message.Proposal) bool
- func (ikesa *IKESA) ToProposal() *message.Proposal
- func (ikesa *IKESA) VerifyIKEChecksum(data []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomNumber ¶
func GenerateRandomUint8 ¶
Types ¶
type ChildSA ¶
type ChildSA struct { // SPI SPI uint32 // Mark Mark *uint32 // IP addresses RemotePublicIPAddr net.IP LocalPublicIPAddr net.IP // Traffic IPProto uint8 TSLocal *net.IPNet TSRemote *net.IPNet // Encapsulate EnableEncap bool LocalPort int RemotePort int // contains filtered or unexported fields }
func (*ChildSA) CalcKEMaterial ¶
CalcKEMaterial generates secret and calculate Diffie-Hellman public key exchange material. Peer public value as parameter, return local public value and shared key.
func (*ChildSA) GenerateKey ¶
Key Gen for child SA
func (*ChildSA) GenerateXFRMPolicy ¶
func (*ChildSA) GenerateXFRMState ¶
func (*ChildSA) GetDHTransformID ¶
func (*ChildSA) SelectProposal ¶
func (*ChildSA) SetXFRMState ¶
func (*ChildSA) ToProposal ¶
func (*ChildSA) XFRMRuleAdd ¶
func (*ChildSA) XFRMRuleFlush ¶
type IKESA ¶
type IKESA struct { // SPI RemoteSPI uint64 LocalSPI uint64 // Role Role int // Security objects Prf_d hash.Hash // used to derive key for child sa Integ_i hash.Hash // used by initiator for integrity checking Integ_r hash.Hash // used by responder for integrity checking Encr_i types.IKECrypto // used by initiator for encrypting Encr_r types.IKECrypto // used by responder for encrypting Prf_i hash.Hash // used by initiator for IKE authentication Prf_r hash.Hash // used by responder for IKE authentication // NAT detection NATT bool // Message ID MessageID uint32 // contains filtered or unexported fields }
func (*IKESA) CalcIKEChecksum ¶
func (*IKESA) CalcKEMaterial ¶
CalcKEMaterial generates secret and calculate Diffie-Hellman public key exchange material. Peer public value as parameter, return local public value and shared key.
func (*IKESA) CheckMessageID ¶
func (*IKESA) EncryptToSKPayload ¶
func (*IKESA) GenerateKey ¶
func (*IKESA) GetDHTransformID ¶
func (*IKESA) ToProposal ¶
func (*IKESA) VerifyIKEChecksum ¶
Click to show internal directories.
Click to hide internal directories.