summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-12-19 21:47:19 +0100
committerNeal H. Walfield <neal@pep.foundation>2019-12-19 21:51:19 +0100
commitb3ba97146f534ac5cf67db7f72d8a633112d0a18 (patch)
tree581c64936f0a857dd1f0fbf75c7a4ddf243d8656 /openpgp/src/parse
parent2b2b5c8905d0e823d03b5ba2a115298e80e08b74 (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 'openpgp/src/parse')
-rw-r--r--openpgp/src/parse/stream.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index c4b16049..fe0d7dd5 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -698,8 +698,12 @@ impl<'a, H: VerificationHelper> Verifier<'a, H> {
for issuer in sig.get_issuers() {
if let Some((i, j)) = self.keys.get(&issuer) {
let cert = &self.certs[*i];
- let (binding, revoked, key)
- = cert.keys_all().nth(*j).unwrap();
+
+ let ka = cert.keys_all().nth(*j).unwrap();
+ let binding = ka.binding_signature(self.time);
+ let revoked = ka.revoked(self.time);
+ let key = ka.key();
+
results.push_verification_result(
if sig.verify(key).unwrap_or(false) {
if sig.signature_alive(
@@ -1591,8 +1595,12 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
for issuer in sig.get_issuers() {
if let Some((i, j)) = self.keys.get(&issuer) {
let cert = &self.certs[*i];
- let (binding, revoked, key)
- = cert.keys_all().nth(*j).unwrap();
+
+ let ka = cert.keys_all().nth(*j).unwrap();
+ let binding = ka.binding_signature(self.time);
+ let revoked = ka.revoked(self.time);
+ let key = ka.key();
+
results.push_verification_result(
if sig.verify(key).unwrap_or(false) &&
sig.signature_alive(
@@ -2055,7 +2063,7 @@ mod test {
// sign 30MiB message
let mut buf = vec![];
{
- let key = cert.keys_all().for_signing().nth(0).unwrap().2;
+ let key = cert.keys_all().for_signing().nth(0).unwrap().key();
let keypair =
key.clone().mark_parts_secret().unwrap()
.into_keypair().unwrap();