From c48493f892a01da948eaad281e6b2e012cfdde8a Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 12 Jan 2025 10:12:14 +0800 Subject: [PATCH] feat: v1.10.16 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/cmd_sshpivsign.rs | 3 +++ src/cmd_sshpubkey.rs | 5 ++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e9ce80e..cdf9529 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -487,7 +487,7 @@ dependencies = [ [[package]] name = "card-cli" -version = "1.10.15" +version = "1.10.16" dependencies = [ "authenticator 0.3.1", "base64 0.21.7", diff --git a/Cargo.toml b/Cargo.toml index e614f71..198a50c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "card-cli" -version = "1.10.15" +version = "1.10.16" authors = ["Hatter Jiang "] edition = "2018" diff --git a/src/cmd_sshpivsign.rs b/src/cmd_sshpivsign.rs index 455e008..a9405ea 100644 --- a/src/cmd_sshpivsign.rs +++ b/src/cmd_sshpivsign.rs @@ -2,6 +2,7 @@ use clap::{App, Arg, ArgMatches, SubCommand}; use der_parser::ber::BerObjectContent; use pem::Pem; use rust_util::util_clap::{Command, CommandError}; +use rust_util::util_msg; use yubikey::{Key, YubiKey}; use yubikey::piv::{AlgorithmId, sign_data}; @@ -25,6 +26,8 @@ impl Command for CommandImpl { } fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError { + util_msg::set_logger_std_out(false); + let namespace_opt = sub_arg_matches.value_of("namespace"); let namespace = match namespace_opt { None => return simple_error!("Namespace required"), diff --git a/src/cmd_sshpubkey.rs b/src/cmd_sshpubkey.rs index 4415dad..bd1d6cb 100644 --- a/src/cmd_sshpubkey.rs +++ b/src/cmd_sshpubkey.rs @@ -6,6 +6,7 @@ use base64::engine::general_purpose::STANDARD; use base64::Engine; use clap::{App, Arg, ArgMatches, SubCommand}; use rust_util::util_clap::{Command, CommandError}; +use rust_util::util_msg; use yubikey::piv::AlgorithmId; use yubikey::{Key, YubiKey}; @@ -21,6 +22,8 @@ impl Command for CommandImpl { } fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError { + util_msg::set_logger_std_out(false); + let slot = opt_value_result!(sub_arg_matches.value_of("slot"), "--slot must assigned, e.g. 82, 83 ... 95, 9a, 9c, 9d, 9e"); let ca = sub_arg_matches.is_present("ca"); let mut yk = opt_result!(YubiKey::open(), "YubiKey not found: {}"); @@ -81,7 +84,7 @@ impl Command for CommandImpl { let ssh_pub_key_sha256 = sha256_bytes(&ssh_pub_key); information!("SSH key SHA256: {} (base64)", STANDARD.encode(&ssh_pub_key_sha256)); information!("SSH key SHA256: {} (hex)", hex::encode(&ssh_pub_key_sha256)); - println!(); + eprintln!(); println!( "{}ecdsa-sha2-{} {} Yubikey-PIV-{}",