diff options
author | Hristo Venev <hristo@venev.name> | 2020-02-04 20:31:51 +0100 |
---|---|---|
committer | Hristo Venev <hristo@venev.name> | 2020-02-04 20:31:51 +0100 |
commit | c4f743e2a33ba39036f7e9919b7adc80415b1754 (patch) | |
tree | c708bbc6e089a1b66c61d189a010cb2a80aa0a34 /src/main.rs | |
parent | 3f5c00af303c1b706a74cafa58ff23b068f6d819 (diff) |
Reference preshared keys by path.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 3 insertions, 5 deletions
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<Item = OsString>) -> Option<config::Config State::Source(ref mut s) => { 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<Item = OsString>) -> Option<config::Config State::Peer(ref mut p) => { 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<OsString>) -> 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 ", |