Files
authentik/internal/outpost/radius/eap/protocol/mschapv2/op_success.go
Jens Langhammer fad18db70b more mschap v2, start peap extension type 33
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2025-07-01 22:43:02 +02:00

24 lines
528 B
Go

package mschapv2
import "encoding/binary"
type SuccessRequest struct {
*Payload
Authenticator []byte
}
// A success request is encoded slightly differently, it doesn't have a challenge and as such
// doesn't need to encode the length of it
func (sr *SuccessRequest) Encode() ([]byte, error) {
encoded := []byte{
byte(sr.OpCode),
sr.MSCHAPv2ID,
0,
0,
}
encoded = append(encoded, sr.Authenticator...)
sr.MSLength = uint16(len(encoded))
binary.BigEndian.PutUint16(encoded[2:], sr.MSLength)
return encoded, nil
}