Remove restriction of padding length

pull/14/head
V2Ray 9 years ago
parent 54fe1ed8b1
commit cc3f374623

@ -226,10 +226,7 @@ func (w *VMessRequestWriter) Write(writer io.Writer, request *VMessRequest) erro
buffer = append(buffer, []byte(request.Address.Domain)...)
}
paddingLength := blockSize - 1 - (len(buffer)-encryptionBegin)%blockSize
if paddingLength == 0 {
paddingLength = blockSize
}
paddingLength := mrand.Intn(32) + 1
paddingBuffer := make([]byte, paddingLength)
_, err = rand.Read(paddingBuffer)
if err != nil {

@ -26,7 +26,7 @@
* 4 字节IPv4
* 1 字节长度 + 域名
* 16 字节IPv6
* 1 字节:随机填充长度 M2 (0 < M2 <= 32)使 16
* 1 字节:随机填充长度 M2 (0 < M2 <= 32)
* M2 字节:随机填充内容
数据部分

Loading…
Cancel
Save