vmess: add rand.Seed to avoid same sequence values of rand.Read

This commit is contained in:
nadoo 2018-07-12 10:58:48 +08:00
parent 3c3cb8e3fd
commit 49482bf054

View File

@ -114,6 +114,7 @@ func (c *Client) NewConn(rc net.Conn, target string) (*Conn, error) {
} }
randBytes := make([]byte, 33) randBytes := make([]byte, 33)
rand.Seed(time.Now().UnixNano())
rand.Read(randBytes) rand.Read(randBytes)
copy(conn.reqBodyIV[:], randBytes[:16]) copy(conn.reqBodyIV[:], randBytes[:16])