mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
refactor: use strum on EncryptionAlgorithm, use Xor as default when AesGcm not available (#1923)
This commit is contained in:
@@ -10,10 +10,9 @@ use std::{
|
||||
use crate::{
|
||||
common::{
|
||||
config::{
|
||||
get_avaliable_encrypt_methods, load_config_from_file, process_secure_mode_cfg,
|
||||
ConfigFileControl, ConfigLoader, ConsoleLoggerConfig, FileLoggerConfig,
|
||||
LoggingConfigLoader, NetworkIdentity, PeerConfig, PortForwardConfig, TomlConfigLoader,
|
||||
VpnPortalConfig,
|
||||
load_config_from_file, process_secure_mode_cfg, ConfigFileControl, ConfigLoader,
|
||||
ConsoleLoggerConfig, EncryptionAlgorithm, FileLoggerConfig, LoggingConfigLoader,
|
||||
NetworkIdentity, PeerConfig, PortForwardConfig, TomlConfigLoader, VpnPortalConfig,
|
||||
},
|
||||
constants::EASYTIER_VERSION,
|
||||
log,
|
||||
@@ -277,9 +276,9 @@ struct NetworkOptions {
|
||||
long,
|
||||
env = "ET_ENCRYPTION_ALGORITHM",
|
||||
help = t!("core_clap.encryption_algorithm").to_string(),
|
||||
value_parser = get_avaliable_encrypt_methods()
|
||||
value_enum,
|
||||
)]
|
||||
encryption_algorithm: Option<String>,
|
||||
encryption_algorithm: Option<EncryptionAlgorithm>,
|
||||
|
||||
#[arg(
|
||||
long,
|
||||
@@ -1007,7 +1006,7 @@ impl NetworkOptions {
|
||||
f.enable_encryption = !v;
|
||||
}
|
||||
if let Some(algorithm) = &self.encryption_algorithm {
|
||||
f.encryption_algorithm = algorithm.clone();
|
||||
f.encryption_algorithm = algorithm.to_string();
|
||||
}
|
||||
if let Some(v) = self.disable_ipv6 {
|
||||
f.enable_ipv6 = !v;
|
||||
|
||||
Reference in New Issue
Block a user