mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
providers/radius: fix inverted message authenticator validation (#17855)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package radius
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/hmac"
|
||||
"crypto/md5"
|
||||
"errors"
|
||||
@@ -46,7 +45,7 @@ func (r *RadiusRequest) validateMessageAuthenticator() error {
|
||||
return err
|
||||
}
|
||||
hash.Write(encode)
|
||||
if bytes.Equal(mauth, hash.Sum(nil)) {
|
||||
if !hmac.Equal(mauth, hash.Sum(nil)) {
|
||||
return ErrInvalidMessageAuthenticator
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user