Clean legacy vmess (#2199)

* Remove legacy Vmess

* validators

* protos
This commit is contained in:
yuhan6665 2023-06-12 10:32:25 -04:00 committed by GitHub
parent bf4b1fab3c
commit 9112cfd39c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 150 additions and 761 deletions

View file

@ -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,
},
}

View file

@ -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
}
}