From b3ba97146f534ac5cf67db7f72d8a633112d0a18 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Thu, 19 Dec 2019 21:47:19 +0100 Subject: openpgp: Change KeyIter to return a struct instead of a tuple. - A tuple is just an unnamed, inflexible struct. Use a struct instead. - Fixes #400. --- sqv/src/sqv.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sqv') diff --git a/sqv/src/sqv.rs b/sqv/src/sqv.rs index 3550fdc8..b73592f6 100644 --- a/sqv/src/sqv.rs +++ b/sqv/src/sqv.rs @@ -155,7 +155,7 @@ fn real_main() -> Result<(), failure::Error> { fn cert_has_key(cert: &Cert, keyid: &KeyID) -> bool { // Even if a key is revoked or expired, we can still use it to // verify a message. - cert.keys_all().any(|(_, _, k)| *keyid == k.keyid()) + cert.keys_all().any(|ka| *keyid == ka.key().keyid()) } // Find the certs. @@ -233,11 +233,13 @@ fn real_main() -> Result<(), failure::Error> { if let Some(cert) = certs.get(&issuer.clone().into()) { let cert = cert.borrow(); // Find the right key. - for (maybe_binding, _, key) in cert.keys_all() { - let binding = match maybe_binding { + for ka in cert.keys_all() { + // Use the current binding signature. + let binding = match ka.binding_signature(None) { Some(b) => b, None => continue, }; + let key = ka.key(); if issuer == key.keyid() { if !binding.key_flags().for_signing() { -- cgit v1.2.3