fix a bunch of stuff ig
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -119,7 +119,21 @@ func (p *Packet) handleEAP(pp protocol.Payload, stm protocol.StateManager) (*eap
|
||||
}
|
||||
ctx.log.Debug("Root-EAP: Passing to protocol")
|
||||
|
||||
res := p.GetChallengeForType(ctx, np, t)
|
||||
res := &eap.Payload{
|
||||
Code: protocol.CodeRequest,
|
||||
ID: p.eap.ID + 1,
|
||||
MsgType: t,
|
||||
}
|
||||
var payload any
|
||||
if ctx.IsProtocolStart(t) {
|
||||
p.eap.Payload = np
|
||||
p.eap.Payload.Decode(pp.(*eap.Payload).RawPayload)
|
||||
}
|
||||
payload = p.eap.Payload.Handle(ctx)
|
||||
if payload != nil {
|
||||
res.Payload = payload.(protocol.Payload)
|
||||
}
|
||||
|
||||
stm.SetEAPState(p.state, st)
|
||||
|
||||
if ctx.endModifier != nil {
|
||||
@ -145,24 +159,6 @@ func (p *Packet) handleInner() (*eap.Payload, error) {
|
||||
return p.handleEAP(p.eap, p.stm)
|
||||
}
|
||||
|
||||
func (p *Packet) GetChallengeForType(ctx *context, np protocol.Payload, t protocol.Type) *eap.Payload {
|
||||
res := &eap.Payload{
|
||||
Code: protocol.CodeRequest,
|
||||
ID: p.eap.ID + 1,
|
||||
MsgType: t,
|
||||
}
|
||||
var payload any
|
||||
if ctx.IsProtocolStart(t) {
|
||||
p.eap.Payload = np
|
||||
p.eap.Payload.Decode(p.eap.RawPayload)
|
||||
}
|
||||
payload = p.eap.Payload.Handle(ctx)
|
||||
if payload != nil {
|
||||
res.Payload = payload.(protocol.Payload)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func (p *Packet) setMessageAuthenticator(rp *radius.Packet) error {
|
||||
_ = rfc2869.MessageAuthenticator_Set(rp, make([]byte, 16))
|
||||
hash := hmac.New(md5.New, rp.Secret)
|
||||
|
||||
Reference in New Issue
Block a user