mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-28 18:08:00 +03:00
Remove sing form xray
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/sing-shadowsocks/shadowaead_2022"
|
||||
"github.com/xtls/xray-core/app/log"
|
||||
"github.com/xtls/xray-core/app/proxyman"
|
||||
"github.com/xtls/xray-core/common"
|
||||
@@ -22,9 +21,19 @@ import (
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
var ss2022Methods = []string{
|
||||
shadowsocks_2022.MethodAES128GCM,
|
||||
shadowsocks_2022.MethodAES256GCM,
|
||||
shadowsocks_2022.MethodChaCha20Poly1305,
|
||||
}
|
||||
|
||||
func TestShadowsocks2022Tcp(t *testing.T) {
|
||||
for _, method := range shadowaead_2022.List {
|
||||
password := make([]byte, 32)
|
||||
for _, method := range ss2022Methods {
|
||||
keySize := 32
|
||||
if method == shadowsocks_2022.MethodAES128GCM {
|
||||
keySize = 16
|
||||
}
|
||||
password := make([]byte, keySize)
|
||||
rand.Read(password)
|
||||
t.Run(method, func(t *testing.T) {
|
||||
testShadowsocks2022Tcp(t, method, base64.StdEncoding.EncodeToString(password))
|
||||
@@ -33,21 +42,21 @@ func TestShadowsocks2022Tcp(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestShadowsocks2022UdpAES128(t *testing.T) {
|
||||
password := make([]byte, 32)
|
||||
password := make([]byte, 16)
|
||||
rand.Read(password)
|
||||
testShadowsocks2022Udp(t, shadowaead_2022.List[0], base64.StdEncoding.EncodeToString(password))
|
||||
testShadowsocks2022Udp(t, shadowsocks_2022.MethodAES128GCM, base64.StdEncoding.EncodeToString(password))
|
||||
}
|
||||
|
||||
func TestShadowsocks2022UdpAES256(t *testing.T) {
|
||||
password := make([]byte, 32)
|
||||
rand.Read(password)
|
||||
testShadowsocks2022Udp(t, shadowaead_2022.List[1], base64.StdEncoding.EncodeToString(password))
|
||||
testShadowsocks2022Udp(t, shadowsocks_2022.MethodAES256GCM, base64.StdEncoding.EncodeToString(password))
|
||||
}
|
||||
|
||||
func TestShadowsocks2022UdpChacha(t *testing.T) {
|
||||
password := make([]byte, 32)
|
||||
rand.Read(password)
|
||||
testShadowsocks2022Udp(t, shadowaead_2022.List[2], base64.StdEncoding.EncodeToString(password))
|
||||
testShadowsocks2022Udp(t, shadowsocks_2022.MethodChaCha20Poly1305, base64.StdEncoding.EncodeToString(password))
|
||||
}
|
||||
|
||||
func testShadowsocks2022Tcp(t *testing.T, method string, password string) {
|
||||
|
||||
Reference in New Issue
Block a user