Merge pull request #2077 from PragmaTwice/add-xchacha20-poly1305

add xchacha20-poly1305 to shadowsocks ciphers for xray
pull/2097/head
2dust 2022-03-05 17:58:26 +08:00 committed by GitHub
commit 61bd48fd1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 3 deletions

View File

@ -15,7 +15,7 @@ namespace v2rayN.Forms
private void AddServer3Form_Load(object sender, EventArgs e)
{
cmbSecurity.Items.AddRange(Global.ssSecuritys.ToArray());
cmbSecurity.Items.AddRange(config.GetShadowsocksSecuritys().ToArray());
if (EditIndex >= 0)
{
vmessItem = config.vmess[EditIndex];

View File

@ -195,6 +195,7 @@ namespace v2rayN
public static readonly List<string> vmessSecuritys = new List<string> { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" };
public static readonly List<string> ssSecuritys = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
public static readonly List<string> ssSecuritysInXray = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain" };
public static readonly List<string> xtlsFlows = new List<string> { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443" };
public static readonly List<string> networks = new List<string> { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
public static readonly List<string> kcpHeaderTypes = new List<string> { "srtp", "utp", "wechat-video", "dtls", "wireguard" };

View File

@ -540,7 +540,7 @@ namespace v2rayN.Handler
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.security = vmessItem.security.TrimEx();
if (!Global.ssSecuritys.Contains(vmessItem.security))
if (!config.GetShadowsocksSecuritys().Contains(vmessItem.security))
{
return -1;
}

View File

@ -401,7 +401,7 @@ namespace v2rayN.Handler
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.password = config.id();
if (Global.ssSecuritys.Contains(config.security()))
if (config.GetShadowsocksSecuritys().Contains(config.security()))
{
serversItem.method = config.security();
}

View File

@ -411,6 +411,16 @@ namespace v2rayN.Mode
return vmess.FindIndex(it => it.indexId == indexId);
}
public List<string> GetShadowsocksSecuritys()
{
if (coreType == ECoreType.v2fly_core)
{
return Global.ssSecuritys;
}
return Global.ssSecuritysInXray;
}
#endregion
}