start handling inner
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -24,7 +24,7 @@ type Context interface {
|
||||
SetProtocolState(p Type, s interface{})
|
||||
IsProtocolStart(p Type) bool
|
||||
|
||||
HandleInnerEAP(Payload, StateManager) Payload
|
||||
HandleInnerEAP(Payload, StateManager) (Payload, error)
|
||||
EndInnerProtocol(Status, func(p *radius.Packet) *radius.Packet)
|
||||
|
||||
Log() *log.Entry
|
||||
|
||||
@ -26,7 +26,7 @@ type Payload struct {
|
||||
|
||||
eap *eap.Payload
|
||||
st *State
|
||||
settings *Settings
|
||||
settings Settings
|
||||
raw []byte
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ func (p *Payload) Handle(ctx protocol.Context) protocol.Payload {
|
||||
defer func() {
|
||||
ctx.SetProtocolState(TypePEAP, p.st)
|
||||
}()
|
||||
p.settings = ctx.ProtocolSettings().(*Settings)
|
||||
p.settings = ctx.ProtocolSettings().(Settings)
|
||||
|
||||
rootEap := ctx.RootPayload().(*eap.Payload)
|
||||
|
||||
@ -99,7 +99,11 @@ func (p *Payload) Handle(ctx protocol.Context) protocol.Payload {
|
||||
}
|
||||
}
|
||||
|
||||
return ctx.HandleInnerEAP(ep, p)
|
||||
res, err := ctx.HandleInnerEAP(ep, p)
|
||||
if err != nil {
|
||||
ctx.Log().WithError(err).Warning("PEAP: failed to handle inner EAP")
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func (p *Payload) GetEAPSettings() protocol.Settings {
|
||||
|
||||
@ -11,6 +11,6 @@ type Settings struct {
|
||||
InnerProtocols protocol.Settings
|
||||
}
|
||||
|
||||
func (s *Settings) TLSConfig() *tls.Config {
|
||||
func (s Settings) TLSConfig() *tls.Config {
|
||||
return s.Config
|
||||
}
|
||||
|
||||
@ -16,6 +16,6 @@ type Settings struct {
|
||||
HandshakeSuccessful func(ctx protocol.Context, certs []*x509.Certificate) protocol.Status
|
||||
}
|
||||
|
||||
func (s *Settings) TLSConfig() *tls.Config {
|
||||
func (s Settings) TLSConfig() *tls.Config {
|
||||
return s.Config
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user