diff --git a/pumpkin/src/server/bikeshed_key_store.rs b/pumpkin/src/server/key_store.rs similarity index 96% rename from pumpkin/src/server/bikeshed_key_store.rs rename to pumpkin/src/server/key_store.rs index e3b447af6..54393dccf 100644 --- a/pumpkin/src/server/bikeshed_key_store.rs +++ b/pumpkin/src/server/key_store.rs @@ -6,13 +6,13 @@ use sha2::Digest; use crate::client::EncryptionError; -pub struct BikeShedKeyStore { +pub struct KeyStore { pub _public_key: RsaPublicKey, pub private_key: RsaPrivateKey, pub public_key_der: Box<[u8]>, } -impl BikeShedKeyStore { +impl KeyStore { pub fn new() -> Self { log::debug!("Creating encryption keys..."); let (public_key, private_key) = Self::generate_keys(); @@ -22,7 +22,7 @@ impl BikeShedKeyStore { &private_key.e().to_bytes_be(), ) .into_boxed_slice(); - BikeShedKeyStore { + KeyStore { _public_key: public_key, private_key, public_key_der, diff --git a/pumpkin/src/server/mod.rs b/pumpkin/src/server/mod.rs index ca43f5211..364101500 100644 --- a/pumpkin/src/server/mod.rs +++ b/pumpkin/src/server/mod.rs @@ -1,4 +1,4 @@ -use bikeshed_key_store::BikeShedKeyStore; +use key_store::KeyStore; use bikeshed_server_listing::BikeShedServerListing; use mio::Token; use parking_lot::{Mutex, RwLock}; @@ -31,13 +31,11 @@ use crate::{ world::World, }; -mod bikeshed_key_store; -mod bikeshed_server_listing; +mod key_store; pub const CURRENT_MC_VERSION: &str = "1.21.1"; pub struct Server { - key_store: BikeShedKeyStore, - server_listing: BikeShedServerListing, + key_store: KeyStore, pub plugin_loader: PluginLoader, pub command_dispatcher: Arc>, @@ -58,7 +56,7 @@ impl Server { #[allow(clippy::new_without_default)] pub fn new() -> Self { // TODO: only create when needed - let key_store = BikeShedKeyStore::new(); + let server_listing = BikeShedServerListing::new(); let auth_client = if BASIC_CONFIG.online_mode { Some( @@ -90,7 +88,7 @@ impl Server { worlds: vec![Arc::new(world)], command_dispatcher: Arc::new(command_dispatcher), auth_client, - key_store, + key_store: KeyStore::new(), server_listing, } }