From 0ec859f4a612b54b63815fb8da0c39cee3ca3f25 Mon Sep 17 00:00:00 2001 From: shimun Date: Fri, 25 Sep 2020 12:40:34 +0200 Subject: [PATCH] remove trailing newline from pin --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index e1e06d2..629b5b9 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -25,7 +25,7 @@ fn read_pin(ap: &AuthenticatorParameters) -> Fido2LuksResult { if let Some(src) = ap.pin_source.as_ref() { let mut pin = String::new(); File::open(src)?.read_to_string(&mut pin)?; - Ok(pin) + Ok(pin.trim_end_matches("\n").to_string()) //remove trailing newline } else { util::read_password("Authenticator PIN", false) }