Remove unnecessary lookup.
- `Sq::resolve_cert` already returns the certificate. Don't look it up again.
This commit is contained in:
parent
6ffdd4aab7
commit
b49386a886
@ -22,10 +22,7 @@ use crate::common::password;
|
||||
|
||||
pub fn bind(sq: Sq, command: cli::key::subkey::bind::Command) -> Result<()>
|
||||
{
|
||||
let handle =
|
||||
sq.resolve_cert(&command.cert, sequoia_wot::FULLY_TRUSTED)?.1;
|
||||
|
||||
let cert = sq.lookup_one(handle, None, true)?;
|
||||
let cert = sq.resolve_cert(&command.cert, sequoia_wot::FULLY_TRUSTED)?.0;
|
||||
|
||||
let null_policy_;
|
||||
let adoptee_policy: &dyn Policy = if command.allow_broken_crypto {
|
||||
|
@ -59,7 +59,7 @@ where CP: cert_designator::ArgumentPrefix,
|
||||
let (cert, cert_source)
|
||||
= sq.resolve_cert(&cert, sequoia_wot::FULLY_TRUSTED)?;
|
||||
|
||||
let cert = match cert_source {
|
||||
match cert_source {
|
||||
FileStdinOrKeyHandle::FileOrStdin(ref file) => {
|
||||
// If it is not a TSK, there is nothing to do.
|
||||
if ! cert.is_tsk() {
|
||||
@ -68,12 +68,9 @@ where CP: cert_designator::ArgumentPrefix,
|
||||
key material.",
|
||||
cert.fingerprint(), file));
|
||||
}
|
||||
|
||||
cert
|
||||
}
|
||||
FileStdinOrKeyHandle::KeyHandle(ref kh) => {
|
||||
FileStdinOrKeyHandle::KeyHandle(ref _kh) => {
|
||||
ks = Some(sq.key_store_or_else()?);
|
||||
sq.lookup_one(kh, None, true)?
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -68,7 +68,6 @@ where P: cert_designator::ArgumentPrefix,
|
||||
output = Some(FileOrStdout::new(None));
|
||||
}
|
||||
}
|
||||
let cert = sq.lookup_one(cert_handle.clone(), None, true)?;
|
||||
|
||||
let mut primary_signer
|
||||
= sq.get_primary_key(&cert, Some(&[GetKeysOptions::AllowNotAlive]))?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user