bag

package module
v0.0.0-...-1ac3b05 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 21 Imported by: 0

README

Bootstrapping Authentication Gateway

Documentation

Index

Constants

View Source
const IdentityUnknown uint32 = 10415*10000 + 5401

IdentityUnknown Diameter response code

Variables

This section is empty.

Functions

func ApplicationHandler

func ApplicationHandler(w http.ResponseWriter, r *http.Request)

func BootstrapHandler

func BootstrapHandler(w http.ResponseWriter, r *http.Request)

func CloneHeader

func CloneHeader(h http.Header) http.Header

func GetSIPAuthDataItem

func GetSIPAuthDataItem(a diameter.AVP) (rand, autn, auts, xres, ck, ik []byte, e error)

GetSIPAuthDataItem read SIP-Auth-Data-Item AVP

func KeyDerivation

func KeyDerivation(ck, ik, rand []byte, impi, naf string, vid uint8, pid uint32) []byte
func KeyDerivationFromCache(btid string, naf string, vid uint8, pid uint32) []byte {
	av, _ := getCachedAV(btid)
	if av.RAND == nil {
		return nil
	}
	return KeyDerivation(av.CK, av.IK, av.RAND, av.IMPI, naf, vid, pid)
}

func NewRandText

func NewRandText() string

func SetSIPAuthDataItem

func SetSIPAuthDataItem(rand, autn, auts, xres, ck, ik []byte) (a diameter.AVP)

SetSIPAuthDataItem make SIP-Auth-Data-Item AVP

Types

type AV

type AV struct {
	RAND []byte // 128 bit AKA RAND
	AUTN []byte // SQN(48)+AMF(16)+MAC(64)=128 bit AKA AUTN
	RES  []byte // 128 bit AKA RES
	IK   []byte // 128 bit AKA IK
	CK   []byte // 128 bit AKA CK
	IMPI string
}

func MultimediaAuthRequest

func MultimediaAuthRequest(name string, rand, auts []byte) (av AV, e error)

func (AV) MarshalJSON

func (a AV) MarshalJSON() (b []byte, e error)

func (AV) MarshalText

func (a AV) MarshalText() (b []byte, e error)

func (AV) String

func (a AV) String() string

func (*AV) UnmarshalJSON

func (a *AV) UnmarshalJSON(b []byte) (e error)

func (*AV) UnmarshalText

func (a *AV) UnmarshalText(b []byte) (e error)

type AuthenticationInfo

type AuthenticationInfo struct {
	Nextnonce string //mandatory
	Qop       string //mandatory, not quoted
	Rspauth   [16]byte
	Cnonce    string
	Nc        uint64 // not quoted
}

func ParseaAuthenticationInfo

func ParseaAuthenticationInfo(s string) (a AuthenticationInfo, e error)

func (AuthenticationInfo) String

func (a AuthenticationInfo) String() string

type Authorization

type Authorization struct {
	Username  string   // mandatory
	Realm     string   // mandatory
	Nonce     string   // mandatory
	Uri       string   // mandatory
	Response  [16]byte // mandatory
	Algorithm string   // not quoted
	Cnonce    string
	Opaque    string
	Qop       string // mandatory, not quoted
	Nc        uint64 // not quoted
	// Userhash bool
	Auts string
}

func ParseaAuthorization

func ParseaAuthorization(s string) (a Authorization, e error)

func (*Authorization) SetBootstrapNonce

func (a *Authorization) SetBootstrapNonce(rand, autn []byte)

func (*Authorization) SetResponse

func (a *Authorization) SetResponse(method string, pwd, body []byte)

func (Authorization) String

func (a Authorization) String() string

type WWWAuthenticate

type WWWAuthenticate struct {
	Realm     string // mandatory
	Domain    []string
	Nonce     string // mandatory
	Opaque    string
	Stale     bool     // not quoted
	Algorithm string   // not quoted
	Qop       []string //mandatory

}

func ParseaWWWAuthenticate

func ParseaWWWAuthenticate(s string) (a WWWAuthenticate, e error)

func (WWWAuthenticate) String

func (a WWWAuthenticate) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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