@ -5,6 +5,7 @@ import (
|
|||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
"github.com/gorilla/securecookie"
|
"github.com/gorilla/securecookie"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@ -95,8 +96,8 @@ func (p *Packet) handleEAP(pp protocol.Payload, stm protocol.StateManager) (*eap
|
|||||||
return p.handleEAP(pp, stm)
|
return p.handleEAP(pp, stm)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := p.eap.Payload.(*legacy_nak.Payload); ok {
|
if n, ok := p.eap.Payload.(*legacy_nak.Payload); ok {
|
||||||
log.Debug("Root-EAP: received NAK, trying next protocol")
|
log.WithField("desired", n.DesiredType).Debug("Root-EAP: received NAK, trying next protocol")
|
||||||
p.eap.Payload = nil
|
p.eap.Payload = nil
|
||||||
return next()
|
return next()
|
||||||
}
|
}
|
||||||
@ -125,11 +126,10 @@ func (p *Packet) handleEAP(pp protocol.Payload, stm protocol.StateManager) (*eap
|
|||||||
MsgType: t,
|
MsgType: t,
|
||||||
}
|
}
|
||||||
var payload any
|
var payload any
|
||||||
if ctx.IsProtocolStart(t) {
|
if reflect.TypeOf(p.eap.Payload) == reflect.TypeOf(np) {
|
||||||
p.eap.Payload = np
|
np.Decode(pp.(*eap.Payload).RawPayload)
|
||||||
p.eap.Payload.Decode(pp.(*eap.Payload).RawPayload)
|
|
||||||
}
|
}
|
||||||
payload = p.eap.Payload.Handle(ctx)
|
payload = np.Handle(ctx)
|
||||||
if payload != nil {
|
if payload != nil {
|
||||||
res.Payload = payload.(protocol.Payload)
|
res.Payload = payload.(protocol.Payload)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user