diff options
Diffstat (limited to 'tool/src')
-rw-r--r-- | tool/src/commands/decrypt.rs | 4 | ||||
-rw-r--r-- | tool/src/sq.rs | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index b6d27aa2..52778cdb 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -46,7 +46,9 @@ impl<'a> Helper<'a> { let mut identities: HashMap<KeyID, Fingerprint> = HashMap::new(); let mut hints: HashMap<KeyID, String> = HashMap::new(); for tsk in secrets { - let hint = match tsk.primary_userid(policy, None).ok() { + let hint = match tsk.with_policy(policy, None) + .and_then(|valid_cert| valid_cert.primary_userid()).ok() + { Some(uid) => format!("{} ({})", uid.userid(), KeyID::from(tsk.fingerprint())), None => format!("{}", KeyID::from(tsk.fingerprint())), diff --git a/tool/src/sq.rs b/tool/src/sq.rs index 3e3df364..1d6c0a92 100644 --- a/tool/src/sq.rs +++ b/tool/src/sq.rs @@ -389,7 +389,8 @@ fn main() -> Result<()> { let cert = Cert::from_reader(input)?; let addr = m.value_of("address").map(|a| a.to_string()) .or_else(|| { - cert.primary_userid(policy, None).ok() + cert.with_policy(policy, None) + .and_then(|vcert| vcert.primary_userid()).ok() .map(|ca| ca.userid().to_string()) }); let ac = autocrypt::AutocryptHeader::new_sender( |