From 52197975cd7240aeacad9dc7eeac956721636d12 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 16 Jan 2019 23:35:21 +0100 Subject: [PATCH] Better API calls for getting the string representation of an ip --- build.gradle.kts | 1 - src/dorkbox/network/connection/RegistrationWrapper.java | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9123d6a6..ea0dc182 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -332,7 +332,6 @@ task("compileUtils") { "dorkbox.util.MathUtil", "dorkbox.util.MersenneTwisterFast", "dorkbox.util.NativeLoader", - "dorkbox.util.NetworkUtil", "dorkbox.util.generics.TypeResolver", // "dorkbox.util.generics.DefaultMethodHelper", // this class must be compiled java 8+ diff --git a/src/dorkbox/network/connection/RegistrationWrapper.java b/src/dorkbox/network/connection/RegistrationWrapper.java index 7b409626..35e507bb 100644 --- a/src/dorkbox/network/connection/RegistrationWrapper.java +++ b/src/dorkbox/network/connection/RegistrationWrapper.java @@ -33,7 +33,6 @@ import dorkbox.network.pipeline.udp.KryoDecoderUdpCrypto; import dorkbox.network.pipeline.udp.KryoEncoderUdp; import dorkbox.network.pipeline.udp.KryoEncoderUdpCrypto; import dorkbox.network.serialization.CryptoSerializationManager; -import dorkbox.util.NetworkUtil; import dorkbox.util.RandomUtil; import dorkbox.util.collections.IntMap.Values; import dorkbox.util.collections.LockFreeIntMap; @@ -165,17 +164,15 @@ class RegistrationWrapper { else { // COMPARE! if (!CryptoECC.compare(publicKey, savedPublicKey)) { - String byAddress = NetworkUtil.ipv4ToString(hostAddress); - if (this.endPoint.disableRemoteKeyValidation) { - logger2.warn("Invalid or non-matching public key from remote connection, their public key has changed. Toggling extra flag in channel to indicate key change. To fix, remove entry for: {}", byAddress); + logger2.warn("Invalid or non-matching public key from remote connection, their public key has changed. Toggling extra flag in channel to indicate key change. To fix, remove entry for: {}", address.getHostAddress()); metaChannel.changedRemoteKey = true; return true; } else { // keys do not match, abort! - logger2.error("Invalid or non-matching public key from remote connection, their public key has changed. To fix, remove entry for: {}", byAddress); + logger2.error("Invalid or non-matching public key from remote connection, their public key has changed. To fix, remove entry for: {}", address.getHostAddress()); return false; } }