This commit is contained in:
Darien Raymond
2018-10-18 09:25:58 +02:00
parent be56feead3
commit 4fcb39ded9
8 changed files with 31 additions and 16 deletions
+1 -1
View File
@@ -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)))
+1 -1
View File
@@ -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)