feat: update pgp
This commit is contained in:
@@ -2,10 +2,10 @@ use std::collections::BTreeMap;
|
||||
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use openpgp_card::crypto_data::Cryptogram;
|
||||
use openpgp_card::OpenPgp;
|
||||
use rust_util::{util_msg, XResult};
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
|
||||
use crate::pgpcardutil;
|
||||
use crate::util::{base64_decode, base64_encode};
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
@@ -61,8 +61,7 @@ impl Command for CommandImpl {
|
||||
return simple_error!("cipher or cipher-base64 must assign one");
|
||||
};
|
||||
|
||||
let card = crate::pgpcardutil::get_card()?;
|
||||
let mut pgp = OpenPgp::new(card);
|
||||
let mut pgp = pgpcardutil::get_openpgp_card()?;
|
||||
let mut trans = opt_result!(pgp.transaction(), "Open card failed: {}");
|
||||
|
||||
opt_result!(trans.verify_pw1_user(pin.as_ref()), "User pin verify failed: {}");
|
||||
|
||||
Reference in New Issue
Block a user