ausf

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AtRandAttribute         = 1
	AtAutnAttribute         = 2
	AtResAttribute          = 3
	AtMacAttribute          = 11
	AtNotificationAttribute = 12
	AtIdentityAttribute     = 14
	AtKdfInputAttribute     = 23
	AtKdfAttribute          = 24
)

Attribute Types for EAP-AKA'

View Source
const (
	EapAkaPrimeTypeNum = 50
)

Variables

This section is empty.

Functions

func AddAusfUeContextToPool

func AddAusfUeContextToPool(ausfUeContext *AusfUeContext)

func AddSuciSupiPairToMap

func AddSuciSupiPairToMap(supiOrSuci string, supi string)

func Auth5gAkaComfirmRequestProcedure

func Auth5gAkaComfirmRequestProcedure(resStar string, confirmationDataResponseID string) (*models.ConfirmationDataResponse, error)

func CalculateAtMAC

func CalculateAtMAC(key []byte, input []byte) ([]byte, error)

func CheckIfAusfUeContextExists

func CheckIfAusfUeContextExists(ref string) bool

func CheckIfSuciSupiPairExists

func CheckIfSuciSupiPairExists(ref string) bool

func ConstructEapNoTypePkt

func ConstructEapNoTypePkt(code EapCode, pktID uint8) string

func ConstructFailEapAkaNotification

func ConstructFailEapAkaNotification(oldPktID uint8) (string, error)

func EapAuthComfirmRequestProcedure

func EapAuthComfirmRequestProcedure(eapPayload string, eapSessionID string) (*models.EapSession, error)

func EapEncodeAttribute

func EapEncodeAttribute(attributeType string, data string) (string, error)

func EapEncodeAttribute(attributeType string, data string) (returnStr string, err error) {

func GenerateRandomNumber

func GenerateRandomNumber() (uint8, error)

Generates a random int between 0 and 255

func GetSupiFromSuciSupiMap

func GetSupiFromSuciSupiMap(ref string) string

func IsServingNetworkAuthorized

func IsServingNetworkAuthorized(lookup string) bool

func Start

func Start() error

func UeAuthPostRequestProcedure

func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationInfo) (*models.UeAuthenticationCtx, error)

Types

type AUSFContext

type AUSFContext struct {
	UePool sync.Map
	// contains filtered or unexported fields
}

type AusfUeContext

type AusfUeContext struct {
	Supi               string
	Kausf              string
	Kseaf              string
	ServingNetworkName string
	AuthStatus         models.AuthResult

	// for 5G AKA
	XresStar string

	XRES string
	Rand string
	// contains filtered or unexported fields
}

func GetAusfUeContext

func GetAusfUeContext(ref string) *AusfUeContext

func NewAusfUeContext

func NewAusfUeContext(identifier string) (ausfUeContext *AusfUeContext)

type EapCode

type EapCode uint8
const (
	EapCodeRequest  EapCode = 1
	EapCodeResponse EapCode = 2
	EapCodeSuccess  EapCode = 3
	EapCodeFailure  EapCode = 4
)

type EapPacket

type EapPacket struct {
	Code       EapCode
	Identifier uint8
	Type       EapType
	Data       []byte
}

func EapDecode

func EapDecode(b []byte) (*EapPacket, error)

func (*EapPacket) Encode

func (a *EapPacket) Encode() []byte

type EapType

type EapType uint8
const (
	EapTypeIdentity         EapType = 1
	EapTypeNotification     EapType = 2
	EapTypeNak              EapType = 3 // Response only
	EapTypeMd5Challenge     EapType = 4
	EapTypeOneTimePassword  EapType = 5 // otp
	EapTypeGenericTokenCard EapType = 6 // gtc
	EapTypeMSCHAPV2         EapType = 26
	EapTypeExpandedTypes    EapType = 254
	EapTypeExperimentalUse  EapType = 255
)

type SuciSupiMap

type SuciSupiMap struct {
	SupiOrSuci string
	Supi       string
}

Jump to

Keyboard shortcuts

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