ensure stdout stays open
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4a3b6f8e23
commit
de76f3f480
@ -154,6 +154,7 @@ pub fn parse_cmdline() -> Args {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_cli() -> Fido2LuksResult<()> {
|
pub fn run_cli() -> Fido2LuksResult<()> {
|
||||||
|
let mut stdout = io::stdout();
|
||||||
let args = parse_cmdline();
|
let args = parse_cmdline();
|
||||||
match &args.command {
|
match &args.command {
|
||||||
Command::Credential => {
|
Command::Credential => {
|
||||||
@ -167,11 +168,11 @@ pub fn run_cli() -> Fido2LuksResult<()> {
|
|||||||
} => {
|
} => {
|
||||||
let secret = secret_gen.patch(&args).obtain_secret()?;
|
let secret = secret_gen.patch(&args).obtain_secret()?;
|
||||||
if *binary {
|
if *binary {
|
||||||
io::stdout().write(&secret[..])?;
|
stdout.write(&secret[..])?;
|
||||||
} else {
|
} else {
|
||||||
io::stdout().write(hex::encode(&secret[..]).as_bytes())?;
|
stdout.write(hex::encode(&secret[..]).as_bytes())?;
|
||||||
}
|
}
|
||||||
Ok(io::stdout().flush()?)
|
Ok(stdout.flush()?)
|
||||||
}
|
}
|
||||||
Command::AddKey {
|
Command::AddKey {
|
||||||
device,
|
device,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user