summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize/cert.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-27 17:15:13 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-03-27 17:58:29 +0100
commitffd468e0dadf8065f8ce21a62cbea8e59ec09c60 (patch)
tree08d45ba532cd03ce274dcd73856083d31cf470da /openpgp/src/serialize/cert.rs
parent38bf9e15efe78aa08a864f14e113d8ff46bfbd11 (diff)
openpgp: Explain binding signature lookup failures.
- If looking up a binding signature fails, don't merely return None, but an Err(_) that explains the lookup failure. For example, a binding signature may be present, but it may not meet the policy. - Fixes #460.
Diffstat (limited to 'openpgp/src/serialize/cert.rs')
-rw-r--r--openpgp/src/serialize/cert.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/openpgp/src/serialize/cert.rs b/openpgp/src/serialize/cert.rs
index e4b86ce5..2dd2532f 100644
--- a/openpgp/src/serialize/cert.rs
+++ b/openpgp/src/serialize/cert.rs
@@ -801,8 +801,7 @@ mod test {
]).unwrap();
assert_eq!(cert.subkeys().count(), 1);
- assert!(cert.subkeys().nth(0).unwrap().binding_signature(p, None)
- .is_some());
+ cert.subkeys().nth(0).unwrap().binding_signature(p, None).unwrap();
assert_eq!(cert.userids().count(), 1);
assert!(cert.userids().with_policy(p, None).nth(0).is_some());
assert_eq!(cert.user_attributes().count(), 1);