settle on key_store for a name

This commit is contained in:
StripedMonkey 2024-09-12 18:48:22 -04:00
parent c13261ba20
commit 8bf8ba14da
2 changed files with 8 additions and 10 deletions

View File

@ -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,

View File

@ -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<CommandDispatcher<'static>>,
@ -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,
}
}