1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-29 21:45:21 -05:00

allow dynamic type of user accounts

This commit is contained in:
v2ray
2016-05-28 13:44:11 +02:00
parent 87f664048b
commit 3f9cb1136a
18 changed files with 123 additions and 49 deletions

View File

@@ -60,7 +60,8 @@ func (this *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Requ
timestampHash := md5.New()
timestampHash.Write(hashTimestamp(timestamp))
iv := timestampHash.Sum(nil)
aesStream := crypto.NewAesDecryptionStream(user.ID.CmdKey(), iv)
account := user.Account.(*protocol.VMessAccount)
aesStream := crypto.NewAesDecryptionStream(account.ID.CmdKey(), iv)
decryptor := crypto.NewCryptionReader(aesStream, reader)
nBytes, err := io.ReadFull(decryptor, buffer.Value[:41])