diff --git a/protocol/vless/outbound.go b/protocol/vless/outbound.go index 61a60cce..81475330 100644 --- a/protocol/vless/outbound.go +++ b/protocol/vless/outbound.go @@ -478,6 +478,10 @@ func parseClientEncryption(raw string) (clientEncryptionConfig, error) { if segment == "" { return cfg, E.New("invalid empty segment in encryption string") } + if paddingPhase && len(segment) < 20 { + paddingParts = append(paddingParts, segment) + continue + } if data, err := base64.RawURLEncoding.DecodeString(segment); err == nil { if len(data) == 32 || len(data) == 1184 { cfg.keys = append(cfg.keys, data) @@ -486,10 +490,6 @@ func parseClientEncryption(raw string) (clientEncryptionConfig, error) { } return cfg, E.New("invalid encryption key length: ", len(data)) } - if paddingPhase { - paddingParts = append(paddingParts, segment) - continue - } return cfg, E.New("invalid encryption key: ", segment) } if len(cfg.keys) == 0 {