Documentation ¶
Index ¶
- Variables
- func ChallengeHash(peerChallenge, authenticatorChallenge, username []byte) []byte
- func ChallengeResponse(challenge, passwordHash []byte) []byte
- func DESCrypt(key, clear []byte) []byte
- func GenerateCHAPMD5Response(id, password, challenge []byte) []byte
- func GenerateCHAPResponse(id, challenge, username, password, autype []byte) ([]byte, error)
- func GenerateMSChapV2Response(authenticatorChallenge, username, password []byte) ([]byte, error)
- func GenerateNTResponse(authenticatorChallenge, peerChallenge, username, password []byte) ([]byte, error)
- func NTPasswordHash(password []byte) []byte
- func ToUTF16(in []byte) ([]byte, error)
- type PPPAuth
- func (p *PPPAuth) AuthTypeCanUse(authType []byte) bool
- func (p *PPPAuth) ChangeAuthType(rejectType []byte) error
- func (p *PPPAuth) GetLCPConfigReqParams(id int) map[string]any
- func (p *PPPAuth) GetPAPReqParams() map[string]any
- func (p *PPPAuth) GetPPPStartReqParams() map[string]any
- func (p *PPPAuth) ProcessCHAPMessage(messageNode *base.Node) (map[string]any, error)
- func (p *PPPAuth) ProcessLCPMessage(messageNode *base.Node) (map[string]any, error)
- func (p *PPPAuth) ProcessMessage(messageNode *base.Node) (map[string]any, error)
- func (p *PPPAuth) ProcessPAPMessage(messageNode *base.Node) (map[string]any, error)
- func (p *PPPAuth) SetAuthType(authType []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PPP_LCP uint16 = 0xc021 PPP_PAP uint16 = 0xc023 PPP_CHAP uint16 = 0xc223 LCP_REQ uint8 = 0x1 LCP_ACK uint8 = 0x2 LCP_NCK uint8 = 0x3 LCP_REJ uint8 = 0x4 LCP_OPTION_AUTH uint8 = 0x3 CHAP_MD5 = []byte{0xc2, 0x23, 0x05} MS_CHAP_V2 = []byte{0xc2, 0x23, 0x81} PAP = []byte{0xc0, 0x23} CHAP_CHALLENGE uint8 = 0x1 CHAP_SUCCESS uint8 = 0x3 CHAP_FAILURE uint8 = 0x4 PAP_ACK uint8 = 0x2 PAP_NAK uint8 = 0x3 SupportAuthTypeMap = map[string][]byte{ "CHAP": CHAP_MD5, "MSCHAPV2": MS_CHAP_V2, "PAP": PAP, } )
Functions ¶
func ChallengeHash ¶
ChallengeHash - rfc2759, 8.2
func ChallengeResponse ¶
ChallengeResponse - rfc2759, 8.5
func GenerateCHAPMD5Response ¶
func GenerateCHAPResponse ¶
func GenerateNTResponse ¶
func NTPasswordHash ¶
NTPasswordHash with MD4 - rfc2759, 8.3
Types ¶
type PPPAuth ¶
type PPPAuth struct { Username string Password string AuthTypeCode []byte AuthTypeName string CanUseAuthTypeList map[string][]byte AuthOk chan bool NegotiateOk chan struct{} MagicNumber []byte // contains filtered or unexported fields }
func GetDefaultPPPAuth ¶
func GetDefaultPPPAuth() *PPPAuth
func (*PPPAuth) AuthTypeCanUse ¶
func (*PPPAuth) ChangeAuthType ¶
func (*PPPAuth) GetLCPConfigReqParams ¶
func (*PPPAuth) GetPAPReqParams ¶
func (*PPPAuth) GetPPPStartReqParams ¶
func (*PPPAuth) ProcessCHAPMessage ¶
func (*PPPAuth) ProcessLCPMessage ¶
func (*PPPAuth) ProcessMessage ¶
func (*PPPAuth) ProcessPAPMessage ¶
func (*PPPAuth) SetAuthType ¶
Click to show internal directories.
Click to hide internal directories.