diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-12-19 21:47:19 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-12-19 21:51:19 +0100 |
commit | b3ba97146f534ac5cf67db7f72d8a633112d0a18 (patch) | |
tree | 581c64936f0a857dd1f0fbf75c7a4ddf243d8656 /sqv | |
parent | 2b2b5c8905d0e823d03b5ba2a115298e80e08b74 (diff) |
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.
Diffstat (limited to 'sqv')
-rw-r--r-- | sqv/src/sqv.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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() { |