mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
parent
bf4b1fab3c
commit
9112cfd39c
25 changed files with 150 additions and 761 deletions
|
@ -12,9 +12,8 @@ import (
|
|||
func (h *Handler) handleSwitchAccount(cmd *protocol.CommandSwitchAccount) {
|
||||
rawAccount := &vmess.Account{
|
||||
Id: cmd.ID.String(),
|
||||
AlterId: uint32(cmd.AlterIds),
|
||||
SecuritySettings: &protocol.SecurityConfig{
|
||||
Type: protocol.SecurityType_LEGACY,
|
||||
Type: protocol.SecurityType_AUTO,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -128,11 +128,6 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||
input := link.Reader
|
||||
output := link.Writer
|
||||
|
||||
isAEAD := false
|
||||
if !aeadDisabled && len(account.AlterIDs) == 0 {
|
||||
isAEAD = true
|
||||
}
|
||||
|
||||
hashkdf := hmac.New(sha256.New, []byte("VMessBF"))
|
||||
hashkdf.Write(account.ID.Bytes())
|
||||
|
||||
|
@ -144,7 +139,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||
newCtx, newCancel = context.WithCancel(context.Background())
|
||||
}
|
||||
|
||||
session := encoding.NewClientSession(ctx, isAEAD, protocol.DefaultIDHash, int64(behaviorSeed))
|
||||
session := encoding.NewClientSession(ctx, int64(behaviorSeed))
|
||||
sessionPolicy := h.policyManager.ForLevel(request.User.Level)
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
|
@ -233,7 +228,6 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||
|
||||
var (
|
||||
enablePadding = false
|
||||
aeadDisabled = false
|
||||
)
|
||||
|
||||
func shouldEnablePadding(s protocol.SecurityType) bool {
|
||||
|
@ -251,9 +245,4 @@ func init() {
|
|||
if paddingValue != defaultFlagValue {
|
||||
enablePadding = true
|
||||
}
|
||||
|
||||
isAeadDisabled := platform.NewEnvFlag("xray.vmess.aead.disabled").GetValue(func() string { return defaultFlagValue })
|
||||
if isAeadDisabled == "true" {
|
||||
aeadDisabled = true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue