eap

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Copyright © 2024 Keytos [email protected]

Define EAP Codes

Copyright © 2024 Keytos [email protected]

Define EAP datagram of the following format

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Code      |  Identifier   |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |  Data ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Copyright © 2025 Keytos [email protected]

Define MD5-Challenge authentication session

Copyright © 2024 Keytos [email protected]

Define MS-CHAPv2 authentication session

Copyright © 2024 Keytos [email protected]

Define Protected EAP tunnel

Copyright © 2024 Keytos [email protected]

Define EAP authentication session

Copyright © 2024 Keytos [email protected]

Define TLS authentication session

Copyright © 2024 Keytos [email protected]

Define Tunneled-TLS authentication session

Copyright © 2024 Keytos [email protected]

Define Tunneled-TLS EAP tunnel

Copyright © 2024 Keytos [email protected]

Define EAP Request/Response Types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code uint8
const (
	CodeRequest Code = iota + 1
	CodeResponse
	CodeSuccess
	CodeFailure
)

func (Code) String

func (c Code) String() string

type Content

type Content struct {
	Type Type
	Data []byte
}

type Datagram

type Datagram struct {
	Header  *Header
	Content *Content
}

func (*Datagram) Deserialize added in v0.2.0

func (d *Datagram) Deserialize(b []byte) error

func (*Datagram) ReadFrom

func (d *Datagram) ReadFrom(r io.Reader) (int64, error)

func (Datagram) WriteTo

func (d Datagram) WriteTo(w io.Writer) (int64, error)

type EapTunnel added in v0.2.0

type EapTunnel interface {
	net.Conn
	MaxDataSize() int
}
type Header struct {
	Code       Code
	Identifier uint8
	Length     uint16
}

type PEAP added in v0.2.0

type PEAP struct {
	*TLS
	// contains filtered or unexported fields
}

func CreatePEAP added in v0.2.0

func CreatePEAP(session *Session, caCert, tlsVersion, serverName, tlsTunnelKeyLogFilename string, tlsSkipHostnameCheck bool) (*PEAP, error)

func (*PEAP) Close added in v0.2.0

func (tt *PEAP) Close() error

func (*PEAP) MaxDataSize added in v0.2.0

func (tt *PEAP) MaxDataSize() int

func (*PEAP) Read added in v0.2.0

func (tt *PEAP) Read(b []byte) (int, error)

func (*PEAP) Write added in v0.2.0

func (tt *PEAP) Write(b []byte) (int, error)

type Session

type Session struct {
	Tunnel            EapTunnel
	EAPSendStart      bool
	AnonymousUsername string
	RecvKey, SendKey  []byte
	// contains filtered or unexported fields
}

func NewSession

func NewSession(tunnel EapTunnel, anonymousUname string, eapSendStart bool) *Session

func (*Session) MD5 added in v0.5.0

func (s *Session) MD5(macAddress string) error

func (*Session) MsCHAPv2 added in v0.2.0

func (s *Session) MsCHAPv2(uname, pw string) error

func (*Session) ReadDatagram

func (s *Session) ReadDatagram(rd *Datagram) (int, error)

func (*Session) WriteDatagram

func (s *Session) WriteDatagram(wd *Datagram) (int, error)

func (*Session) WriteReadDatagram

func (s *Session) WriteReadDatagram(wd *Datagram, rd *Datagram) error

type TLS

type TLS struct {
	*Session
	// contains filtered or unexported fields
}

func CreateTLS

func CreateTLS(session *Session, caCert, tlsVersion string, skipHostnameCheck bool) (*TLS, error)

func (*TLS) Authenticate

func (tt *TLS) Authenticate(certpath, keyLogFilename string) error

func (*TLS) Close

func (tt *TLS) Close() error

func (*TLS) LocalAddr

func (tt *TLS) LocalAddr() net.Addr

func (*TLS) Read

func (tt *TLS) Read(b []byte) (int, error)

func (*TLS) RemoteAddr

func (tt *TLS) RemoteAddr() net.Addr

func (*TLS) SetDeadline

func (tt *TLS) SetDeadline(t time.Time) error

func (*TLS) SetReadDeadline

func (tt *TLS) SetReadDeadline(t time.Time) error

func (*TLS) SetWriteDeadline

func (tt *TLS) SetWriteDeadline(t time.Time) error

func (*TLS) Write

func (tt *TLS) Write(b []byte) (int, error)

type TTLS added in v0.2.0

type TTLS struct {
	*TLS
	// contains filtered or unexported fields
}

func CreateTTLS added in v0.2.0

func CreateTTLS(session *Session, caCert, tlsVersion, serverName, tlsTunnelKeyLogFilename string, tlsSkipHostnameCheck bool) (*TTLS, error)

func (*TTLS) Close added in v0.2.0

func (tt *TTLS) Close() error

func (*TTLS) PAP added in v0.2.0

func (tt *TTLS) PAP(uname, pw string) error

type TtlsEAP added in v0.2.0

type TtlsEAP struct {
	*TTLS
}

func CreateTtlsEAP added in v0.2.0

func CreateTtlsEAP(session *Session, caCert, tlsVersion, serverName, tlsTunnelKeyLogFilename string, tlsSkipHostnameCheck bool) (*TtlsEAP, error)

func (*TtlsEAP) MaxDataSize added in v0.2.0

func (tt *TtlsEAP) MaxDataSize() int

func (*TtlsEAP) Read added in v0.2.0

func (tt *TtlsEAP) Read(b []byte) (int, error)

func (*TtlsEAP) Write added in v0.2.0

func (tt *TtlsEAP) Write(b []byte) (int, error)

type Type

type Type uint8
const (
	TypeIdentity     Type = 1
	TypeNotification Type = 2
	TypeNAK          Type = 3
	TypeMD5          Type = 4
	TypeTLS          Type = 13
	TypeTTLS         Type = 21
	TypePEAP         Type = 25
	TypeMsCHAPv2     Type = 26
	TypeExtensions   Type = 33
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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