zellfrey / Voting

Minecraft hook for voting APIs
https://minecraft.curseforge.com/projects/293830
Other
1 stars 2 forks source link

Vote Plugin Issue on Encryption NuVotifier -> Votifier #9

Open JustZerooo opened 1 year ago

JustZerooo commented 1 year ago

Hey, we try to obtain a vote from proxy -> server but seems how the encryption / decrypion is made does not work :(

[14:47:07] [Vote-Listener/ERROR]: an error occured during decryption of data 
javax.crypto.BadPaddingException: Decryption error
    at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:370) ~[?:1.8.0_381]
    at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[?:1.8.0_381]
    at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:370) ~[sunjce_provider.jar:1.8.0_371]
    at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:404) ~[sunjce_provider.jar:1.8.0_371]
    at javax.crypto.Cipher.doFinal(Cipher.java:2170) ~[?:1.8.0_381]
    at com.github.upcraftlp.votifier.util.RSAUtil.decrypt(RSAUtil.java:38) [RSAUtil.class:1.4.0]
    at com.github.upcraftlp.votifier.net.NetworkListenerThread.run(NetworkListenerThread.java:57) [NetworkListenerThread.class:1.4.0]
[14:47:07] [Vote-Listener/ERROR]: Votifier: incorrect vote received:
-----------------------------------------------------

-----------------------------------------------------
[14:47:08] [Vote-Listener/ERROR]: an error occured during decryption of data 
javax.crypto.BadPaddingException: Decryption error
    at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:370) ~[?:1.8.0_381]
    at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[?:1.8.0_381]
    at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:370) ~[sunjce_provider.jar:1.8.0_371]
    at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:404) ~[sunjce_provider.jar:1.8.0_371]
    at javax.crypto.Cipher.doFinal(Cipher.java:2170) ~[?:1.8.0_381]
    at com.github.upcraftlp.votifier.util.RSAUtil.decrypt(RSAUtil.java:38) [RSAUtil.class:1.4.0]
    at com.github.upcraftlp.votifier.net.NetworkListenerThread.run(NetworkListenerThread.java:57) [NetworkListenerThread.class:1.4.0]
[14:47:08] [Vote-Listener/ERROR]: Votifier: incorrect vote received:
-----------------------------------------------------

-----------------------------------------------------
[14:47:10] [Vote-Listener/ERROR]: an error occured during decryption of data 
javax.crypto.BadPaddingException: Decryption error
    at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:370) ~[?:1.8.0_381]
    at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[?:1.8.0_381]
    at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:370) ~[sunjce_provider.jar:1.8.0_371]
    at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:404) ~[sunjce_provider.jar:1.8.0_371]
    at javax.crypto.Cipher.doFinal(Cipher.java:2170) ~[?:1.8.0_381]
    at com.github.upcraftlp.votifier.util.RSAUtil.decrypt(RSAUtil.java:38) [RSAUtil.class:1.4.0]
    at com.github.upcraftlp.votifier.net.NetworkListenerThread.run(NetworkListenerThread.java:57) [NetworkListenerThread.class:1.4.0]
[14:47:10] [Vote-Listener/ERROR]: Votifier: incorrect vote received:
-----------------------------------------------------

-----------------------------------------------------
[14:47:13] [Finalizer/WARN]: Clearing LoliStringPool 1
[14:47:13] [Finalizer/WARN]: Clearing LoliStringPool 1
[14:47:13] [Vote-Listener/ERROR]: an error occured during decryption of data 
javax.crypto.BadPaddingException: Decryption error
    at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:370) ~[?:1.8.0_381]
    at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[?:1.8.0_381]
    at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:370) ~[sunjce_provider.jar:1.8.0_371]
    at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:404) ~[sunjce_provider.jar:1.8.0_371]
    at javax.crypto.Cipher.doFinal(Cipher.java:2170) ~[?:1.8.0_381]
    at com.github.upcraftlp.votifier.util.RSAUtil.decrypt(RSAUtil.java:38) [RSAUtil.class:1.4.0]
    at com.github.upcraftlp.votifier.net.NetworkListenerThread.run(NetworkListenerThread.java:57) [NetworkListenerThread.class:1.4.0]
[14:47:13] [Vote-Listener/ERROR]: Votifier: incorrect vote received:
-----------------------------------------------------

-----------------------------------------------------
[14:47:18] [Vote-Listener/ERROR]: an error occured during decryption of data 
javax.crypto.BadPaddingException: Decryption error
    at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:370) ~[?:1.8.0_381]
    at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[?:1.8.0_381]
    at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:370) ~[sunjce_provider.jar:1.8.0_371]
    at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:404) ~[sunjce_provider.jar:1.8.0_371]
    at javax.crypto.Cipher.doFinal(Cipher.java:2170) ~[?:1.8.0_381]
    at com.github.upcraftlp.votifier.util.RSAUtil.decrypt(RSAUtil.java:38) [RSAUtil.class:1.4.0]
    at com.github.upcraftlp.votifier.net.NetworkListenerThread.run(NetworkListenerThread.java:57) [NetworkListenerThread.class:1.4.0]
[14:47:18] [Vote-Listener/ERROR]: Votifier: incorrect vote received:
-----------------------------------------------------

-----------------------------------------------------
[14:47:26] [Vote-Listener/ERROR]: an error occured during decryption of data 
javax.crypto.BadPaddingException: Decryption error
    at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:370) ~[?:1.8.0_381]
    at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[?:1.8.0_381]
    at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:370) ~[sunjce_provider.jar:1.8.0_371]
    at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:404) ~[sunjce_provider.jar:1.8.0_371]
    at javax.crypto.Cipher.doFinal(Cipher.java:2170) ~[?:1.8.0_381]
    at com.github.upcraftlp.votifier.util.RSAUtil.decrypt(RSAUtil.java:38) [RSAUtil.class:1.4.0]
    at com.github.upcraftlp.votifier.net.NetworkListenerThread.run(NetworkListenerThread.java:57) [NetworkListenerThread.class:1.4.0]
[14:47:26] [Vote-Listener/ERROR]: Votifier: incorrect vote received:
-----------------------------------------------------

-----------------------------------------------------

Config we use :

# The IP to listen to. Use 0.0.0.0 if you wish to listen to all interfaces on your server. (All IP addresses)
# This defaults to the IP you have configured your server to listen on, or 0.0.0.0 if you have not configured this.
host = "0.0.0.0"

# Port to listen for new votes on
port = 8192

# Setting this option to true will disable handling of Protocol v1 packets. While the old protocol is not secure, this
# option is currently not recommended as most voting sites only support the old protocol at present. However, if you are
# using NuVotifier's proxy forwarding mechanism, enabling this option will increase your server's security.
disable-v1-protocol = false

# All tokens, labeled by the serviceName of each server list.
[tokens]
# Default token for all server lists, if another isn't supplied.
default = ""

# Configuration section for all vote forwarding to NuVotifier
[forwarding]
# Sets whether to set up a remote method for fowarding. Supported methods:
# - none - Does not set up a forwarding method.
# - pluginMessaging - Sets up plugin messaging.
# - proxy - Proxies votes to other NuVotifier servers from this server.
method = "proxy"

[forwarding.pluginMessaging]
channel = "nuvotifier:voting"

# Only send votes to certain servers. If a server is present on excludedServers, then votes will NOT be forwarded
# to them. If excludedServers is not present, votes will be sent to all servers.
# If onlySendToJoinedServer is true and a player is on one of these servers, NuVotifier will process the vote as if the
# player was not on the network at all.
# excludedServers = ["server1", "server2"]

# If uncommented, turns excludedServers into an includedServers, where only servers on the list will be used.
# whitelist = true

# Sets which cache to use if there are no players on the server that the vote is being sent to. Supported caches:
# - none - Votes will simply be lost when no players are present on the server.
# - memory - Votes will be cached in memory when no players are present. When Bungee is restarted, the votes will be lost.
# - file - Votes will be saved to a local file every 3 minutes and on shutdown and reloaded when Bungee is restarted. This is suitable for
#   most set ups.
cache = "file"
# Only sends the vote to the server in which the player is currently joined.
onlySendToJoinedServer = true

# Sets which server to send the vote in the event the player is not online when the vote is cast
# If you do not want the vote forwarded to a fallback, set this value to empty ('')
# ONLY USED IF onlySendToJoinedServer is true!!
joinedServerFallback = ""

# Defines how quickly to dump votes over a player's connection while offloading a cache in votes per second
dumpRate = 5

[forwarding.file-cache]
# Options for file caching.
name = "cached-votes.json"
# days before a vote is considered 'dead' - removed from cache with a console warning. -1 signifies no cache.
cacheTime = 10

[forwarding.memory-cache]
# Options for file caching.
name = "cached-votes.json"
# days before a vote is considered 'dead' - removed from cache with a console warning. -1 signifies no cache. Votes are
# also removed on restart
cacheTime = 10

[forwarding.proxy.nomifactory-ceu-1]
address = "0.0.0.0"
port = 8194
token = ""

[forwarding.proxy.ier-1]
address = "0.0.0.0"
port = 8195
token = ""

[forwarding.proxy.dj2-1]
address = "0.0.0.0"
port = 8196
token = ""

Someone can add a Channel or update how the RSA should work?