Commit Graph

106 Commits

Author SHA1 Message Date
Shane Freeder 71feb11b2e Fix fallback compression handler 2025-01-17 15:11:03 +00:00
Andrew Steinborn af97ffffa5 A few small code cleanups for cryptography
* Remove some unused cryptographic code
* Add some notes about how Minecraft's cryptography choices have not quite survived the test of time
2024-12-21 03:45:17 -05:00
Andrew Steinborn 3c23ee7576 Fix typo for musl crypto 2024-09-07 13:14:04 -04:00
Andrew Steinborn 525ac2712e Also provide musl libc builds of Velocity natives
Reference: PaperMC/Paper#11367
2024-09-07 12:56:38 -04:00
Andrew Steinborn 862036d424 Fix a compile error. 2024-09-02 03:00:19 -04:00
Andrew Steinborn a7654af1a3 Do some minor natives housekeeping. 2024-09-02 02:57:03 -04:00
Andrew Steinborn 956fca142c Readd accidentally removed macOS arm64 compression native 2024-08-31 22:26:16 -04:00
Andrew Steinborn af629cf000 Fall 2024 recompile of the natives (#1416)
This time around, instead of the very ad hoc approach I have historically taken, this time we actually have a convenient script that takes care of basically all the hard work necessary, including cross-compilation.

We compile natives for Ubuntu 20.04 LTS (OpenSSL 1.1.x native and libdeflate) and Ubuntu 22.04 LTS (OpenSSL 3.x.x native), for both x86_64 and aarch64.

The macOS natives have also been recompiled on macOS Sonoma.
2024-08-31 20:30:47 -04:00
R00tB33rMan 6f7f722bfb [ci skip] Remove duplicate space from NativeZlibInflate (#1240) 2024-02-09 18:02:43 +00:00
Andrew Steinborn c3583e182c Stop shipping the OpenSSL 1.0.x native
CentOS 7 is end of life in June 2024. Let's cut this loose.

I'll also recompiling all the natives soon.
2024-01-21 20:48:15 -05:00
Andrew Steinborn b0862d2d16 Use Spotless for license formatting 2023-01-01 18:46:33 -05:00
Andrew Steinborn d72d707b1c Convert Velocity buildscripts to Kotlin DSL (#918)
Spiritually indebted to #518 and @alexstaeding.

There's a minor break - we're going up to 3.2.0-SNAPSHOT as the API now compiles against Java 11. But this is more academic in practice.
2023-01-01 17:53:37 -05:00
Andrew Steinborn f62768be9a Fix native compile as libdeflate moved to CMake
Fixes #890 correctly. Also rebuild the compression/encryption natives on macOS and Linux ARM64.
2023-01-01 11:45:47 -05:00
Andrew Steinborn 57ca66de2e readd local linux aarch64 cipher def 2022-09-12 00:34:04 -04:00
Andrew Steinborn ece90dedfb Update natives to latest libdeflate and add OpenSSL 3 native compiled on Fedora 36 for ARM64 2022-09-11 23:54:33 -04:00
Hugo Manrique 6547ccaa7e Provide crypto native for Linux x86_64 and OpenSSL 3.0.x (#854)
Compiled the crypto native on Debian testing (that ships with OpenSSL
3.0.5-2). Fixes #852.
2022-08-28 17:24:56 -04:00
4drian3d e45ca5f357 Improved Scheduler API (#696)
* Improved Scheduler API

- Added `Scheduler#builder(plugin)`
This method allows a more simplified builder while maintaining the main requirement of the executor plugin
- Added `Scheduler#taskByPlugin(plugin)`
Allows to obtain the tasks that a plugin has sent to execute and that are currently active
- Added `TaskBuilder#task(Consumer<SchuledTask>)`
Allows to specify a task with access to the task itself with the ability to cancel itself

* Applied requested changes

- Removed tasks builder method
- Added `Scheduler#buildTask(plugin, Consumer<ScheduledTask>)`

* Removed some unused imports

* Applied suggested change

* Fix possible test bug

* Applied more suggested changes

* Fixed tests inside tasks
2022-06-09 03:27:06 -04:00
Andrew Steinborn 4b1cdbcb31 I have sinned but it feels good 2022-06-08 01:18:19 -04:00
Andrew Steinborn 01c6777948 Fix several issues with JNI compression
The libraries will require a recompile.
2022-06-08 00:53:15 -04:00
4drian3d acc407a6d5 Added ability to customize translations (#692)
* Added ability to customize translations

* Removed remaining usage of `Paths#get`

As of java 11 its replacement `Path#of` was created, which is called when using `Paths#get`, besides, according to documentation, it mentions that it can be deprecated at any time

And fix a minor typo in LegacyChannelIdentifier
2022-04-16 00:38:44 -04:00
Andrew Steinborn 35a1456c5f Update Linux natives for latest libdeflate
x86_64 libdeflate was compiled with Fedora Linux 35. aarch64 binaries were compiled with Ubuntu 18.04.
2022-03-09 02:12:15 -05:00
Andrew Steinborn 590f18dbe0 Convert to Java 11 compressor 2021-05-23 13:58:01 -04:00
Andrew Steinborn c747120b20 Relicense the Velocity proxy under the terms of GPLv3 (#448) 2021-03-31 16:04:06 -04:00
Andrew Steinborn 3d0cb50569 Better check for unfinished decompression 2020-11-17 04:48:20 -05:00
Andrew Steinborn 91b295ead5 Further improve the inflate overflow checks in the Java 11 compressor native
This brings the Java compressor in line with our libdeflate one. Backport this from Velocity 2.0.0.
2020-11-05 17:22:19 -05:00
Andrew Steinborn 1f5b0e1e03 Fix a few minor issues with the Java 11 compressor 2020-11-05 17:07:49 -05:00
Andrew Steinborn 911aba1b45 Native cipher test should only be enabled on Linux 2020-10-27 01:53:43 -04:00
Andrew Steinborn bf81d20ba7 Recompile natives for Linux aarch64 2020-10-27 01:48:25 -04:00
Andrew Steinborn 0f919d7163 Recompile natives for Linux x86_64
Debian 9 was used to compile the libdeflate native and OpenSSL 1.1.x crypto, CentOS for OpenSSL 1.0.x crypto only.
2020-10-27 01:44:14 -04:00
Andrew Steinborn 4ca996098c Merge branch 'dev/1.1.0' into further-native-tweaks
# Conflicts:
#	native/compile-linux.sh
2020-10-27 01:30:42 -04:00
Andrew Steinborn 5072e1085a Revert server list ping changes
They are broken with ping passthrough.
2020-10-06 11:05:36 -04:00
Andrew Steinborn 3bf252cf45 Start optimizing server list ping. 2020-10-04 15:30:28 -04:00
Andrew Steinborn 6c348c994c Don't need to call memoryAddress() here as we do it later on anyway 2020-09-21 11:27:47 -04:00
Andrew Steinborn bb31226e09 Clean up more cipher code and make it -Wall + -Werror clean 2020-09-16 00:07:52 -04:00
Andrew Steinborn a49a77a7ef Working on improvements to natives. Not done yet. 2020-09-11 01:46:59 -04:00
Andrew Steinborn 5d287306c2 Small code cleanups 2020-09-01 03:25:15 -04:00
Andrew Steinborn 89f98ce57d Make Disposable interface implement Closeable 2020-07-29 05:34:15 -04:00
Andrew Steinborn 62703780e1 Fix a few areas of concern spotted by JITWatch 2020-06-27 21:33:05 -04:00
Andrew Steinborn 9dda0ba9dd Commit the other aarch64 native recompiled on Debian 9 2020-06-23 07:55:41 -04:00
Andrew Steinborn f00301e15b Add aarch64 natives compiled on Debian 9 2020-06-22 20:56:07 -04:00
Andrew Steinborn 676ce7b7fd Use compression native compiled on CentOS 7 2020-06-22 20:17:52 -04:00
Andrew Steinborn 1bb84f81df Rewrite native crypto to use OpenSSL
OpenSSL is much more portable and optimized (important for aarch64) and most systems already have a version.

Unfortunately, OpenSSL likes to break their ABI. Thankfully, Velocity's natives system is very flexible largely, so we can provide multiple versions of this crypto.

Versions of the dynamically-linked crypto were compiled on CentOS 7 (still supported until 2024, uses OpenSSL 1.0.x) and Debian 9 (the oldest distro including OpenSSL 1.1.0, whose LTS supports ends in 2022). The choice of distros was intended to cover most modern distributions (2014 and afterwards).

An ARM compilation (using Debian 9) will be published soon.
2020-06-22 20:14:46 -04:00
Andrew Steinborn 877f98b87a Fix typo in LibdeflateVelocityCompressor 2020-06-21 14:14:41 -04:00
Andrew Steinborn f3d5c986da Add Velocity compression native for aarch64
This native has been compiled and tested on Ubuntu 18.04 aarch64 on AWS Graviton2.

The cipher native is at the moment unlikely to provide a performance boost as mbed TLS doesn't provide an accelerated AES extension.
2020-06-04 15:22:03 -04:00
Andrew Steinborn 31d1871bd5 Check for AARCH64. 2020-06-04 15:03:27 -04:00
Andrew Steinborn bb69481f99 Lay down foundation for cross-architecture natives
We have dropped the rarely used kqueue and replaced it with the new Netty aarch64
native. In addition, lay down the foundation for other aarch64 natives.
2020-06-04 14:59:22 -04:00
Andrew Steinborn ae8852dc9d Native tests should only run on Linux 2020-05-25 13:29:02 -04:00
Andrew Steinborn 793e938dd1 Drop macOS native support
This served a good purpose when I used macOS as a primary development system, but those days are gone (I use Linux now). The spirit of multiple variants is preserved by our special Java 11+ optimized compression.
2020-05-24 10:58:28 -04:00
Andrew Steinborn b3bd773fea Switch out Cloudflare zlib for libdeflate.
libdeflate is significantly faster than vanilla zlib, zlib-ng, and Cloudflare zlib. It is also MIT-licensed (so no licensing concerns). In addition, it simplifies a lot of the native code (something that's been tricky to get right).

While we're at it, I have also taken the time to fine-time compression in Velocity in general. Thanks to this work, native compression only requires one JNI call, an improvement from the more than 2 (sometimes up to 5) that were possible before. This optimization also extends to the existing Java compressors, though they require potentially two JNI calls.
2020-05-24 10:56:26 -04:00
Andrew Steinborn 742b8d98cb Fix noexecstack for natives. 2020-05-20 04:55:55 -04:00