Enable AEAD by Default

pull/2561/head
Shelikhoo 2020-06-06 20:37:30 +08:00
parent 8d489f6c7c
commit 6a29fa5fe2
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
1 changed files with 8 additions and 2 deletions

View File

@ -55,13 +55,19 @@ func NewClientSession(idHash protocol.IDHash) *ClientSession {
session := &ClientSession{} session := &ClientSession{}
session.isAEADRequest = false session.isAEADRequest = true
if vmessexp, vmessexp_found := os.LookupEnv("VMESSAEADEXPERIMENT"); vmessexp_found { if vmessexp, vmessexp_found := os.LookupEnv("VMESSAEADEXPERIMENT"); vmessexp_found {
if vmessexp == "y" { if vmessexp == "y" {
session.isAEADRequest = true session.isAEADRequest = true
fmt.Println("=======VMESSAEADEXPERIMENT ENABLED========")
} }
if vmessexp == "n" {
session.isAEADRequest = false
}
}
if session.isAEADRequest {
fmt.Println("=======VMESSAEADEXPERIMENT ENABLED========")
} }
copy(session.requestBodyKey[:], randomBytes[:16]) copy(session.requestBodyKey[:], randomBytes[:16])