mirror of https://github.com/v2ray/v2ray-core
				
				
				
			support disable vmess aead by os environ
							parent
							
								
									e8a27648a1
								
							
						
					
					
						commit
						43174d6951
					
				| 
						 | 
				
			
			@ -12,6 +12,7 @@ import (
 | 
			
		|||
	"hash"
 | 
			
		||||
	"hash/fnv"
 | 
			
		||||
	"io"
 | 
			
		||||
	"os"
 | 
			
		||||
	vmessaead "v2ray.com/core/proxy/vmess/aead"
 | 
			
		||||
 | 
			
		||||
	"golang.org/x/crypto/chacha20poly1305"
 | 
			
		||||
| 
						 | 
				
			
			@ -62,6 +63,12 @@ func NewClientSession(idHash protocol.IDHash, ctx context.Context) *ClientSessio
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if vmessAeadDisable, vmessAeadDisableFound := os.LookupEnv("V2RAY_VMESS_AEAD_DISABLED"); vmessAeadDisableFound {
 | 
			
		||||
		if vmessAeadDisable == "true" {
 | 
			
		||||
			session.isAEADRequest = false
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	copy(session.requestBodyKey[:], randomBytes[:16])
 | 
			
		||||
	copy(session.requestBodyIV[:], randomBytes[16:32])
 | 
			
		||||
	session.responseHeader = randomBytes[32]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue