handler

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PreSignalling = iota
	EAPSignalling
	PostSignalling
)

IKE_AUTH state

View Source
const (
	Group2PrimeString string = "FFFFFFFFFFFFFFFFC90FDAA22168C234" +
		"C4C6628B80DC1CD129024E088A67CC74" +
		"020BBEA63B139B22514A08798E3404DD" +
		"EF9519B3CD3A431B302B0A6DF25F1437" +
		"4FE1356D6D51C245E485B576625E7EC6" +
		"F44C42E9A637ED6B0BFF5CB6F406B7ED" +
		"EE386BFB5A899FA5AE9F24117C4B1FE6" +
		"49286651ECE65381FFFFFFFFFFFFFFFF"
	Group2Generator           = 2
	Group14PrimeString string = "FFFFFFFFFFFFFFFFC90FDAA22168C234" +
		"C4C6628B80DC1CD129024E088A67CC74" +
		"020BBEA63B139B22514A08798E3404DD" +
		"EF9519B3CD3A431B302B0A6DF25F1437" +
		"4FE1356D6D51C245E485B576625E7EC6" +
		"F44C42E9A637ED6B0BFF5CB6F406B7ED" +
		"EE386BFB5A899FA5AE9F24117C4B1FE6" +
		"49286651ECE45B3DC2007CB8A163BF05" +
		"98DA48361C55D39A69163FA8FD24CF5F" +
		"83655D23DCA3AD961C62F356208552BB" +
		"9ED529077096966D670C354E4ABC9804" +
		"F1746C08CA18217C32905E462E36CE3B" +
		"E39E772C180E86039B2783A2EC07A28F" +
		"B5C55DF06F4C52C9DE2BCBF695581718" +
		"3995497CEA956AE515D2261898FA0510" +
		"15728E5A8AACAA68FFFFFFFFFFFFFFFF"
	Group14Generator = 2
)

Diffie-Hellman Exchange The strength supplied by group 1 may not be sufficient for typical uses

Variables

This section is empty.

Functions

func ApplyXFRMRule

func ApplyXFRMRule(n3iwf_is_initiator bool, childSecurityAssociation *context.ChildSecurityAssociation) error

func CalculateChecksum

func CalculateChecksum(key []byte, originData []byte, algorithmType uint16) ([]byte, error)

Integrity Algorithm

func CalculateDiffieHellmanMaterials

func CalculateDiffieHellmanMaterials(secret *big.Int, peerPublicValue []byte,
	diffieHellmanGroupNumber uint16) (localPublicValue []byte, sharedKey []byte)

func CompareRootCertificate

func CompareRootCertificate(certificateEncoding uint8, requestedCertificateAuthorityHash []byte) bool

Certificate

func DecryptMessage

func DecryptMessage(key []byte, cipherText []byte, algorithmType uint16) ([]byte, error)

func DecryptProcedure

func DecryptProcedure(ikeSecurityAssociation *context.IKESecurityAssociation, ikeMessage *message.IKEMessage,
	encryptedPayload *message.Encrypted) (message.IKEPayloadContainer, error)

Decrypt

func EncryptMessage

func EncryptMessage(key []byte, originData []byte, algorithmType uint16) ([]byte, error)

Encryption Algorithm

func EncryptProcedure

func EncryptProcedure(ikeSecurityAssociation *context.IKESecurityAssociation,
	ikePayload message.IKEPayloadContainer, responseIKEMessage *message.IKEMessage) error

Encrypt

func GenerateKeyForChildSA

func GenerateKeyForChildSA(ikeSecurityAssociation *context.IKESecurityAssociation,
	childSecurityAssociation *context.ChildSecurityAssociation) error

Key Gen for child SA

func GenerateKeyForIKESA

func GenerateKeyForIKESA(ikeSecurityAssociation *context.IKESecurityAssociation) error

Key Gen for IKE SA

func GenerateRandomNumber

func GenerateRandomNumber() *big.Int

func GenerateRandomUint8

func GenerateRandomUint8() (uint8, error)

func HandleCREATECHILDSA

func HandleCREATECHILDSA(udpConn *net.UDPConn, n3iwfAddr, ueAddr *net.UDPAddr, message *ike_message.IKEMessage)

func HandleIKEAUTH

func HandleIKEAUTH(udpConn *net.UDPConn, n3iwfAddr, ueAddr *net.UDPAddr, message *ike_message.IKEMessage)

func HandleIKESAINIT

func HandleIKESAINIT(udpConn *net.UDPConn, n3iwfAddr, ueAddr *net.UDPAddr, message *ike_message.IKEMessage)

func NewPseudorandomFunction

func NewPseudorandomFunction(key []byte, algorithmType uint16) (hash.Hash, bool)

Pseudorandom Function

func PKCS7Padding

func PKCS7Padding(plainText []byte, blockSize int) []byte

func SendIKEMessageToUE

func SendIKEMessageToUE(udpConn *net.UDPConn, srcAddr, dstAddr *net.UDPAddr, message *ike_message.IKEMessage)

func VerifyIKEChecksum

func VerifyIKEChecksum(key []byte, originData []byte, checksum []byte, algorithmType uint16) (bool, error)

Types

type ANParameters

type ANParameters struct {
	GUAMI              *ngapType.GUAMI
	SelectedPLMNID     *ngapType.PLMNIdentity
	RequestedNSSAI     *ngapType.AllowedNSSAI
	EstablishmentCause *ngapType.RRCEstablishmentCause
}

Access Network Parameters

func UnmarshalEAP5GData

func UnmarshalEAP5GData(codedData []byte) (eap5GMessageID uint8, anParameters *ANParameters, nasPDU []byte, err error)

type XFRMEncryptionAlgorithmType

type XFRMEncryptionAlgorithmType uint16

func (XFRMEncryptionAlgorithmType) String

func (xfrmEncryptionAlgorithmType XFRMEncryptionAlgorithmType) String() string

type XFRMIntegrityAlgorithmType

type XFRMIntegrityAlgorithmType uint16

func (XFRMIntegrityAlgorithmType) String

func (xfrmIntegrityAlgorithmType XFRMIntegrityAlgorithmType) String() string

Jump to

Keyboard shortcuts

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