1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-28 04:55:37 -05:00

security options in vmess

This commit is contained in:
Darien Raymond
2016-12-07 21:43:41 +01:00
parent 85163d4b47
commit a6e25b3f67
8 changed files with 63 additions and 19 deletions

View File

@@ -196,7 +196,7 @@ func (v *ServerSession) DecodeRequestBody(request *protocol.RequestHeader, reade
}
authReader = crypto.NewAuthenticationReader(auth, reader, aggressive)
} else if request.Security.Is(protocol.SecurityType_CHACHA20_POLY1305) {
aead, _ := chacha20poly1305.New(v.responseBodyKey)
aead, _ := chacha20poly1305.New(GenerateChacha20Poly1305Key(v.responseBodyKey))
auth := &crypto.AEADAuthenticator{
AEAD: aead,
@@ -267,7 +267,7 @@ func (v *ServerSession) EncodeResponseBody(request *protocol.RequestHeader, writ
}
authWriter = crypto.NewAuthenticationWriter(auth, writer)
} else if request.Security.Is(protocol.SecurityType_CHACHA20_POLY1305) {
aead, _ := chacha20poly1305.New(v.responseBodyKey)
aead, _ := chacha20poly1305.New(GenerateChacha20Poly1305Key(v.responseBodyKey))
auth := &crypto.AEADAuthenticator{
AEAD: aead,