SourceWriters / LoginPlus

LoginPlus is a spigot-plugin that works on version 1.8 up to the currently latest spigot-version. It is a lightweight login and register-plugin to prevent users from taking over accounts and adding a second layer of security on servers.
GNU General Public License v3.0
9 stars 5 forks source link

Default Argon2-RAM-Usage #11

Closed YellowPhoenix18 closed 3 years ago

YellowPhoenix18 commented 3 years ago

It can happen, that Argon2 with default 1024MB takes too much RAM, causing issues.

This will result in following error: [18:23:02 ERROR]: Could not pass event AsyncPlayerChatEvent to LoginPlus v2.2.0 java.lang.IllegalStateException: Memory allocation error (-22) at com.syntaxphoenix.loginplus.shaded.mkammerer.argon2.BaseArgon2.hashBytes(BaseArgon2.java:163) ~[?:?] at com.syntaxphoenix.loginplus.shaded.mkammerer.argon2.BaseArgon2.hashBytes(BaseArgon2.java:147) ~[?:?] at com.syntaxphoenix.loginplus.shaded.mkammerer.argon2.BaseArgon2.hash(BaseArgon2.java:94) ~[?:?] at com.syntaxphoenix.loginplus.shaded.mkammerer.argon2.BaseArgon2.hash(BaseArgon2.java:102) ~[?:?] at com.syntaxphoenix.loginplus.encryption.EncryptionUtils.hashPassword(EncryptionUtils.java:29) ~[?:?] at com.syntaxphoenix.loginplus.listener.ChatListener.on(ChatListener.java:67) ~[?:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor5.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-390] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.15.2.jar:git-Paper-390] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-390] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-390] at net.minecraft.server.v1_15_R1.PlayerConnection.chat(PlayerConnection.java:1782) ~[patched_1.15.2.jar:git-Paper-390] at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1697) ~[patched_1.15.2.jar:git-Paper-390] at net.minecraft.server.v1_15_R1.PacketPlayInChat$1.run(PacketPlayInChat.java:41) ~[patched_1.15.2.jar:git-Paper-390] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_271] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_271] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_271] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_271] at java.lang.Thread.run(Unknown Source) [?:1.8.0_271]

Add a feature to detect the RAm free and calculate the amount added by default to Argon2

YellowPhoenix18 commented 3 years ago

The RAm-Usage in v3 is now monitored and will get logged and adjusted to your server. Its very likely, that the issue is then non-persitent anymore