feat: v1.12.1
This commit is contained in:
@@ -8,6 +8,7 @@ use yubikey::YubiKey;
|
||||
|
||||
use crate::util::base64_encode;
|
||||
use crate::{argsutil, cmdutil, pivutil, util};
|
||||
use crate::digestutil::DigestAlgorithm;
|
||||
|
||||
pub struct CommandImpl;
|
||||
|
||||
@@ -32,12 +33,12 @@ impl Command for CommandImpl {
|
||||
let mut json = BTreeMap::<&'_ str, String>::new();
|
||||
|
||||
let slot = opt_value_result!(sub_arg_matches.value_of("slot"), "--slot must assigned, e.g. 82, 83 ... 95, 9a, 9c, 9d, 9e");
|
||||
let hash_bytes = argsutil::get_sha256_digest_or_hash(sub_arg_matches)?;
|
||||
let (algorithm, algorithm_str) = match sub_arg_matches.value_of("algorithm") {
|
||||
None | Some("p256") => (AlgorithmId::EccP256, "ecdsa_p256_with_sha256"),
|
||||
Some("p384") => (AlgorithmId::EccP384, "ecdsa_p384_with_sha256"),
|
||||
let (algorithm, algorithm_str, digest_algorithm) = match sub_arg_matches.value_of("algorithm") {
|
||||
None | Some("p256") => (AlgorithmId::EccP256, "ecdsa_p256_with_sha256", DigestAlgorithm::Sha256),
|
||||
Some("p384") => (AlgorithmId::EccP384, "ecdsa_p384_with_sha384", DigestAlgorithm::Sha384),
|
||||
Some(unknown_algorithm) => return simple_error!("Unknown algorithm {}, e.g. p256 or p384", unknown_algorithm),
|
||||
};
|
||||
let hash_bytes = argsutil::get_digest_or_hash(sub_arg_matches, digest_algorithm)?;
|
||||
|
||||
let mut yk = opt_result!(YubiKey::open(), "YubiKey not found: {}");
|
||||
let slot_id = pivutil::get_slot_id(slot)?;
|
||||
|
||||
Reference in New Issue
Block a user