add xchacha20-poly1305 to shadowsocks ciphers for xray

pull/2077/head
PragmaTwice 3 years ago
parent ba8f24d398
commit 32a07bceb2

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

@ -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> 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> 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> 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> 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" }; public static readonly List<string> kcpHeaderTypes = new List<string> { "srtp", "utp", "wechat-video", "dtls", "wireguard" };

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

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

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

Loading…
Cancel
Save