chore: sync vless encryption code

This commit is contained in:
wwqgtxx
2025-08-21 08:33:44 +08:00
parent 5f09db2655
commit 7e0a77c99c
10 changed files with 243 additions and 113 deletions

View File

@@ -94,34 +94,33 @@ func TestInboundVless_Encryption(t *testing.T) {
t.Fatal(err)
return
}
t.Run("-vless-", func(t *testing.T) {
inboundOptions := inbound.VlessOption{
Decryption: "10min-vless-mlkem768seed-" + seedBase64,
}
outboundOptions := outbound.VlessOption{
Encryption: "8min-vless-mlkem768client-" + clientBase64,
}
testInboundVless(t, inboundOptions, outboundOptions)
t.Run("xtls-rprx-vision", func(t *testing.T) {
outboundOptions := outboundOptions
outboundOptions.Flow = "xtls-rprx-vision"
privateKeyBase64, passwordBase64, err := encryption.GenX25519("")
if err != nil {
t.Fatal(err)
return
}
var modes = []string{
"native",
"divide",
"random",
}
for i := range modes {
mode := modes[i]
t.Run(mode, func(t *testing.T) {
inboundOptions := inbound.VlessOption{
Decryption: "10min." + mode + ".mlkem768Seed." + privateKeyBase64 + "." + seedBase64,
}
outboundOptions := outbound.VlessOption{
Encryption: "8min." + mode + ".mlkem768Client." + passwordBase64 + "." + clientBase64,
}
testInboundVless(t, inboundOptions, outboundOptions)
t.Run("xtls-rprx-vision", func(t *testing.T) {
outboundOptions := outboundOptions
outboundOptions.Flow = "xtls-rprx-vision"
testInboundVless(t, inboundOptions, outboundOptions)
})
})
})
t.Run("-xored-", func(t *testing.T) {
inboundOptions := inbound.VlessOption{
Decryption: "10min-xored-mlkem768seed-" + seedBase64,
}
outboundOptions := outbound.VlessOption{
Encryption: "8min-xored-mlkem768client-" + clientBase64,
}
testInboundVless(t, inboundOptions, outboundOptions)
t.Run("xtls-rprx-vision", func(t *testing.T) {
outboundOptions := outboundOptions
outboundOptions.Flow = "xtls-rprx-vision"
testInboundVless(t, inboundOptions, outboundOptions)
})
})
}
}
func TestInboundVless_Wss1(t *testing.T) {