Commit 71ed0a1e authored by Max Lv's avatar Max Lv

Fix #2301

parent f9aa478d
...@@ -46,7 +46,7 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro ...@@ -46,7 +46,7 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
suspend fun init(service: BaseService.Interface) { suspend fun init(service: BaseService.Interface) {
// it's hard to resolve DNS on a specific interface so we'll do it here // it's hard to resolve DNS on a specific interface so we'll do it here
if (profile.host.parseNumericAddress() == null) { if (profile.host.parseNumericAddress() == null && profile.plugin != null) {
profile.host = try { profile.host = try {
service.resolver(profile.host).firstOrNull() service.resolver(profile.host).firstOrNull()
} catch (e: IOException) { } catch (e: IOException) {
...@@ -54,11 +54,13 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro ...@@ -54,11 +54,13 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
}?.hostAddress ?: throw UnknownHostException() }?.hostAddress ?: throw UnknownHostException()
} }
// check the crypto // check the crypto
if (profile.method == "xchacha20-ietf-poly1305") { val deprecatedCiphers
throw IllegalArgumentException("cipher xchacha20-ietf-poly1305 is deprecated.") = arrayOf("xchacha20-ietf-poly1305", "aes-192-gcm", "chacha20", "salsa20")
for (c in deprecatedCiphers)
{
if (profile.method == c) {
throw IllegalArgumentException("cipher $c is deprecated.")
} }
if (profile.method == "aes-192-gcm") {
throw IllegalArgumentException("cipher aes-192-gcm is deprecated.")
} }
} }
......
Subproject commit 9000b31ffb9805324719ff5ba57c9338e357d1f0 Subproject commit 1ac8e2fd5059eb92d6d6bc8d3d66ad423cb7cb05
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment