mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
Check replay only for AEAD connection
This commit is contained in:
parent
6a29fa5fe2
commit
9fc37646b6
@ -89,15 +89,17 @@ func (a *AuthIDDecoderHolder) RemoveUser(key [16]byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *AuthIDDecoderHolder) Match(AuthID [16]byte) (interface{}, error) {
|
func (a *AuthIDDecoderHolder) Match(AuthID [16]byte) (interface{}, error) {
|
||||||
if !a.apw.Check(AuthID[:]) {
|
|
||||||
return nil, ErrReplay
|
|
||||||
}
|
|
||||||
for _, v := range a.aidhi {
|
for _, v := range a.aidhi {
|
||||||
|
|
||||||
t, z, r, d := v.dec.Decode(AuthID)
|
t, z, r, d := v.dec.Decode(AuthID)
|
||||||
if z != crc32.ChecksumIEEE(d[:12]) {
|
if z != crc32.ChecksumIEEE(d[:12]) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !a.apw.Check(AuthID[:]) {
|
||||||
|
return nil, ErrReplay
|
||||||
|
}
|
||||||
|
|
||||||
if math.Abs(float64(t-time.Now().Unix())) > 120 {
|
if math.Abs(float64(t-time.Now().Unix())) > 120 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user