mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 22:45:13 +00:00
fix build break
This commit is contained in:
2 files changed
+5
-5
No files matched your search
@@ -2,9 +2,9 @@ package kcp
|
||||
|
||||
import (
|
||||
"crypto/cipher"
|
||||
"errors"
|
||||
"hash/fnv"
|
||||
|
||||
"v2ray.com/core/common/crypto"
|
||||
"v2ray.com/core/common/serial"
|
||||
)
|
||||
|
||||
@@ -64,12 +64,12 @@ func (v *SimpleAuthenticator) Open(dst, nonce, cipherText, extra []byte) ([]byte
|
||||
fnvHash := fnv.New32a()
|
||||
fnvHash.Write(dst[4:])
|
||||
if serial.BytesToUint32(dst[:4]) != fnvHash.Sum32() {
|
||||
return nil, crypto.ErrAuthenticationFailed
|
||||
return nil, errors.New("KCP:SimpleAuthenticator: Invalid auth.")
|
||||
}
|
||||
|
||||
length := serial.BytesToUint16(dst[4:6])
|
||||
if len(dst)-6 != int(length) {
|
||||
return nil, crypto.ErrAuthenticationFailed
|
||||
return nil, errors.New("KCP:SimpleAuthenticator: Invalid auth.")
|
||||
}
|
||||
|
||||
return dst[6:], nil
|
||||
|
||||
Reference in new issue
Block a user