Add optional aes128xor layer

https://github.com/XTLS/Xray-core/pull/4952#issuecomment-3172703168
This commit is contained in:
RPRX
2025-08-11 12:07:00 +00:00
committed by GitHub
parent 2e6a88307c
commit 7ffb555fc8
11 changed files with 146 additions and 36 deletions

View File

@@ -71,7 +71,7 @@ func New(ctx context.Context, config *Config) (*Handler, error) {
e, _ := base64.RawURLEncoding.DecodeString(a.Encryption)
if len(e) == 1184 {
handler.encryption = &encryption.ClientInstance{}
if err := handler.encryption.Init(e, time.Duration(a.Minutes)*time.Minute); err != nil {
if err := handler.encryption.Init(e, a.Xor, time.Duration(a.Minutes)*time.Minute); err != nil {
return nil, errors.New("failed to use mlkem768client").Base(err).AtError()
}
}