mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-23 20:52:15 +08:00
fix: add length check for ssr auth_aes128_sha1 (#2129)
This commit is contained in:
parent
695fb64fa8
commit
c3f4e1ba2e
@ -154,6 +154,9 @@ func (a *authAES128) Encode(buf *bytes.Buffer, b []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *authAES128) DecodePacket(b []byte) ([]byte, error) {
|
func (a *authAES128) DecodePacket(b []byte) ([]byte, error) {
|
||||||
|
if len(b) < 4 {
|
||||||
|
return nil, errAuthAES128LengthError
|
||||||
|
}
|
||||||
if !bytes.Equal(a.hmac(a.Key, b[:len(b)-4])[:4], b[len(b)-4:]) {
|
if !bytes.Equal(a.hmac(a.Key, b[:len(b)-4])[:4], b[len(b)-4:]) {
|
||||||
return nil, errAuthAES128ChksumError
|
return nil, errAuthAES128ChksumError
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user