Better API calls for getting the string representation of an ip

This commit is contained in:
nathan 2019-01-16 23:35:21 +01:00
parent 5000fdd264
commit 52197975cd
2 changed files with 2 additions and 6 deletions

View File

@ -332,7 +332,6 @@ task<JavaCompile>("compileUtils") {
"dorkbox.util.MathUtil", "dorkbox.util.MathUtil",
"dorkbox.util.MersenneTwisterFast", "dorkbox.util.MersenneTwisterFast",
"dorkbox.util.NativeLoader", "dorkbox.util.NativeLoader",
"dorkbox.util.NetworkUtil",
"dorkbox.util.generics.TypeResolver", "dorkbox.util.generics.TypeResolver",
// "dorkbox.util.generics.DefaultMethodHelper", // this class must be compiled java 8+ // "dorkbox.util.generics.DefaultMethodHelper", // this class must be compiled java 8+

View File

@ -33,7 +33,6 @@ import dorkbox.network.pipeline.udp.KryoDecoderUdpCrypto;
import dorkbox.network.pipeline.udp.KryoEncoderUdp; import dorkbox.network.pipeline.udp.KryoEncoderUdp;
import dorkbox.network.pipeline.udp.KryoEncoderUdpCrypto; import dorkbox.network.pipeline.udp.KryoEncoderUdpCrypto;
import dorkbox.network.serialization.CryptoSerializationManager; import dorkbox.network.serialization.CryptoSerializationManager;
import dorkbox.util.NetworkUtil;
import dorkbox.util.RandomUtil; import dorkbox.util.RandomUtil;
import dorkbox.util.collections.IntMap.Values; import dorkbox.util.collections.IntMap.Values;
import dorkbox.util.collections.LockFreeIntMap; import dorkbox.util.collections.LockFreeIntMap;
@ -165,17 +164,15 @@ class RegistrationWrapper {
else { else {
// COMPARE! // COMPARE!
if (!CryptoECC.compare(publicKey, savedPublicKey)) { if (!CryptoECC.compare(publicKey, savedPublicKey)) {
String byAddress = NetworkUtil.ipv4ToString(hostAddress);
if (this.endPoint.disableRemoteKeyValidation) { 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; metaChannel.changedRemoteKey = true;
return true; return true;
} }
else { else {
// keys do not match, abort! // 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; return false;
} }
} }