From d0c59b5b612ccfb65da88784b2e77f1221ec2402 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Fri, 9 Sep 2022 18:01:46 -0500 Subject: [PATCH] Moved exponent/modulus out to config --- Server/src/main/kotlin/rs09/ServerConstants.kt | 6 ++---- .../kotlin/rs09/game/system/config/ServerConfigParser.kt | 3 +++ Server/worldprops/default.conf | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Server/src/main/kotlin/rs09/ServerConstants.kt b/Server/src/main/kotlin/rs09/ServerConstants.kt index 9425830f1..af34eb9c0 100644 --- a/Server/src/main/kotlin/rs09/ServerConstants.kt +++ b/Server/src/main/kotlin/rs09/ServerConstants.kt @@ -222,12 +222,10 @@ class ServerConstants { var SERVER_GE_NAME: String = "" //The RSA_KEY for the server. - @JvmField - var EXPONENT = BigInteger("52317200263721308660411803146360972546561037484450290559823448967617618536819222494429186211525706853703641369936136465589036631055945454547936148730495933263344792588795811788941129493188907621550836988152620502378278134421731002382361670176785306598134280732756356458964850508114958769985438054979422820241") + lateinit var EXPONENT: BigInteger //The MODULUS for the server. - @JvmField - var MODULUS = BigInteger("96982303379631821170939875058071478695026608406924780574168393250855797534862289546229721580153879336741968220328805101128831071152160922518190059946555203865621183480223212969502122536662721687753974815205744569357388338433981424032996046420057284324856368815997832596174397728134370577184183004453899764051") + lateinit var MODULUS: BigInteger @JvmField var DAILY_RESTART = false diff --git a/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt b/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt index 3dc3574e7..745f9ae80 100644 --- a/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt +++ b/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt @@ -8,6 +8,7 @@ import rs09.game.system.SystemLogger import rs09.game.world.GameSettings import rs09.game.world.GameWorld import java.io.File +import java.math.BigInteger import java.net.URL import kotlin.system.exitProcess @@ -126,6 +127,8 @@ object ServerConfigParser { ServerConstants.DAILY_ACCOUNT_LIMIT = data.getLong("server.daily_accounts_per_ip", 3L).toInt() ServerConstants.DISCORD_MOD_WEBHOOK = data.getString("server.moderation_webhook", "") ServerConstants.NOAUTH_DEFAULT_ADMIN = data.getBoolean("server.noauth_default_admin", false) + ServerConstants.EXPONENT = BigInteger(data.getString("server.rsa_exponent", "")) + ServerConstants.MODULUS = BigInteger(data.getString("server.rsa_modulus", "")) } diff --git a/Server/worldprops/default.conf b/Server/worldprops/default.conf index 8bdb499da..256186d02 100644 --- a/Server/worldprops/default.conf +++ b/Server/worldprops/default.conf @@ -16,6 +16,8 @@ noauth_default_admin = true #NOTE: If we are not using auth, this determines whe #------------------------------------------------------------------------------------------------------ #The limit on how many different accounts a player can log into per day. daily_accounts_per_ip = 3 +rsa_exponent = "52317200263721308660411803146360972546561037484450290559823448967617618536819222494429186211525706853703641369936136465589036631055945454547936148730495933263344792588795811788941129493188907621550836988152620502378278134421731002382361670176785306598134280732756356458964850508114958769985438054979422820241" +rsa_modulus = "96982303379631821170939875058071478695026608406924780574168393250855797534862289546229721580153879336741968220328805101128831071152160922518190059946555203865621183480223212969502122536662721687753974815205744569357388338433981424032996046420057284324856368815997832596174397728134370577184183004453899764051" [database] database_name = "global"