mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 14:44:15 +00:00
refactor auth reader
This commit is contained in:
2 files changed
+111
-44
No files matched your search
@@ -190,7 +190,12 @@ func (v *VMessInboundHandler) HandleConnection(connection internet.Connection) {
|
||||
bodyReader := session.DecodeRequestBody(reader)
|
||||
var requestReader v2io.Reader
|
||||
if request.Option.Has(protocol.RequestOptionChunkStream) {
|
||||
authReader := crypto.NewAuthenticationReader(new(encoding.FnvAuthenticator), bodyReader, func() []byte { return nil }, func() []byte { return nil })
|
||||
auth := &crypto.AEADAuthenticator{
|
||||
AEAD: new(encoding.FnvAuthenticator),
|
||||
NonceGenerator: crypto.NoOpBytesGenerator{},
|
||||
AdditionalDataGenerator: crypto.NoOpBytesGenerator{},
|
||||
}
|
||||
authReader := crypto.NewAuthenticationReader(auth, bodyReader, request.Command == protocol.RequestCommandTCP)
|
||||
requestReader = v2io.NewAdaptiveReader(authReader)
|
||||
} else {
|
||||
requestReader = v2io.NewAdaptiveReader(bodyReader)
|
||||
|
||||
Reference in new issue
Block a user