This commit is contained in:
世界 2023-01-13 16:38:32 +08:00 committed by H1JK
parent 0e11e20f82
commit e0a4b7756e

View File

@ -3,6 +3,7 @@ package mtproto
import (
"crypto/cipher"
"encoding/binary"
"io"
"net"
"sync"
@ -40,7 +41,10 @@ func (c *FakeTLSConn) SetupObfs2(en, de cipher.Stream) {
}
func (c *FakeTLSConn) read(p []byte) (n int, err error) {
n, err = c.Conn.Read(p)
n, err = io.ReadFull(c.Conn, p)
if err != nil {
return
}
if c.clientDecryptor != nil {
c.clientDecryptor.XORKeyStream(p, p[:n])
}