mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 11:29:36 +03:00
Fix shadowsocks xchacha cipher nonce size
This commit is contained in:
@ -93,11 +93,11 @@ func (v *Validator) Get(bs []byte, command protocol.RequestCommand) (u *protocol
|
||||
var matchErr error
|
||||
switch command {
|
||||
case protocol.RequestCommandTCP:
|
||||
data := make([]byte, 16)
|
||||
ret, matchErr = aead.Open(data[:0], data[4:16], bs[ivLen:ivLen+18], nil)
|
||||
data := make([]byte, 4+aead.NonceSize())
|
||||
ret, matchErr = aead.Open(data[:0], data[4:], bs[ivLen:ivLen+18], nil)
|
||||
case protocol.RequestCommandUDP:
|
||||
data := make([]byte, 8192)
|
||||
ret, matchErr = aead.Open(data[:0], data[8180:8192], bs[ivLen:], nil)
|
||||
ret, matchErr = aead.Open(data[:0], data[8192-aead.NonceSize():8192], bs[ivLen:], nil)
|
||||
}
|
||||
|
||||
if matchErr == nil {
|
||||
|
Reference in New Issue
Block a user