From ac350f99c82f87ac2a23465129b6bf0254c7cbb2 Mon Sep 17 00:00:00 2001 From: "Clint.Network" Date: Sun, 1 Mar 2020 20:03:40 +0100 Subject: [PATCH] Generate private key and iv at initialization --- src/configuration.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/configuration.rs b/src/configuration.rs index ed82eb3..a331d09 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -5,6 +5,7 @@ use std::{ use app_dirs::{AppDataType, AppDirsError}; use log::LevelFilter; +use rand::Rng; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Configuration { @@ -49,8 +50,8 @@ impl Default for Configuration { }, encryption: Encryption { enabled: false, - private_key: String::new(), - iv: String::new(), + private_key: hex::encode(rand::thread_rng().gen::<[u8; 24]>()), + iv: hex::encode(rand::thread_rng().gen::<[u8; 16]>()), }, webui: WebUI { enabled: false }, store: Store { max_limit: 7340032 },