From c4f743e2a33ba39036f7e9919b7adc80415b1754 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 4 Feb 2020 20:31:51 +0100 Subject: Reference preshared keys by path. --- src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index ca4068d..8ab9fb3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,8 +37,7 @@ fn cli_config(mut args: impl Iterator) -> Option { if key == "psk" { arg = args.next()?; - let arg = arg.to_str()?; - s.psk = Some(model::Key::from_str(arg).ok()?); + s.psk = Some(model::Secret::new(arg.into())); continue; } if key == "ipv4" { @@ -65,8 +64,7 @@ fn cli_config(mut args: impl Iterator) -> Option { if key == "psk" { arg = args.next()?; - let arg = arg.to_str()?; - p.psk = Some(model::Key::from_str(arg).ok()?); + p.psk = Some(model::Secret::new(arg.into())); continue; } if key == "source" { @@ -137,7 +135,7 @@ fn help(argv0: &str, args: Vec) -> i32 { print!( "\ Usage: - {} IFNAME CONFIG - run daemon on iterface + {} IFNAME CONFIG - run daemon on interface {} --check-source PATH - validate source JSON {} --cmdline IFNAME ... - run daemon using config passed as arguments ", -- cgit