From 41592afade0e3b31780b7d1de5b208dbf2479c2b Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sun, 23 Dec 2018 23:02:51 -0500 Subject: [PATCH] Allow native crypto to always be selected. This removes the need to patch Velocity to enable the native crypto support, if compiled. --- .../main/java/com/velocitypowered/natives/util/Natives.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/native/src/main/java/com/velocitypowered/natives/util/Natives.java b/native/src/main/java/com/velocitypowered/natives/util/Natives.java index af40ccc7e..1fce4f0b6 100644 --- a/native/src/main/java/com/velocitypowered/natives/util/Natives.java +++ b/native/src/main/java/com/velocitypowered/natives/util/Natives.java @@ -6,6 +6,7 @@ import com.velocitypowered.natives.compression.JavaVelocityCompressor; import com.velocitypowered.natives.compression.NativeVelocityCompressor; import com.velocitypowered.natives.compression.VelocityCompressorFactory; import com.velocitypowered.natives.encryption.JavaVelocityCipher; +import com.velocitypowered.natives.encryption.NativeVelocityCipher; import com.velocitypowered.natives.encryption.VelocityCipherFactory; import java.io.IOException; import java.io.InputStream; @@ -58,12 +59,12 @@ public class Natives { public static final NativeCodeLoader cipher = new NativeCodeLoader<>( ImmutableList.of( - /*new NativeCodeLoader.Variant<>(NativeCodeLoader.MACOS, + new NativeCodeLoader.Variant<>(NativeCodeLoader.MACOS, copyAndLoadNative("/macosx/velocity-cipher.dylib"), "mbed TLS (macOS)", NativeVelocityCipher.FACTORY), new NativeCodeLoader.Variant<>(NativeCodeLoader.LINUX, copyAndLoadNative("/linux_x64/velocity-cipher.so"), "mbed TLS (Linux amd64)", - NativeVelocityCipher.FACTORY),*/ + NativeVelocityCipher.FACTORY), new NativeCodeLoader.Variant<>(NativeCodeLoader.ALWAYS, () -> { }, "Java", JavaVelocityCipher.FACTORY) )