mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
comments
This commit is contained in:
@@ -56,7 +56,7 @@ func NewClientSession(idHash protocol.IDHash) *ClientSession {
|
||||
|
||||
func (c *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writer io.Writer) error {
|
||||
timestamp := protocol.NewTimestampGenerator(protocol.NowTime(), 30)()
|
||||
account := header.User.Account.(*vmess.InternalAccount)
|
||||
account := header.User.Account.(*vmess.MemoryAccount)
|
||||
idHash := c.idHash(account.AnyValidID().Bytes())
|
||||
common.Must2(idHash.Write(timestamp.Bytes(nil)))
|
||||
common.Must2(writer.Write(idHash.Sum(nil)))
|
||||
|
||||
@@ -135,7 +135,7 @@ func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
|
||||
}
|
||||
|
||||
iv := md5.Sum(hashTimestamp(timestamp))
|
||||
vmessAccount := user.Account.(*vmess.InternalAccount)
|
||||
vmessAccount := user.Account.(*vmess.MemoryAccount)
|
||||
|
||||
aesStream := crypto.NewAesDecryptionStream(vmessAccount.ID.CmdKey(), iv[:])
|
||||
decryptor := crypto.NewCryptionReader(aesStream, reader)
|
||||
|
||||
Reference in New Issue
Block a user