Skip to content

Commit

Permalink
Generate private key and iv at initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Clint.Network committed Mar 1, 2020
1 parent cc829dc commit ac350f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 },
Expand Down

0 comments on commit ac350f9

Please sign in to comment.