summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-02-14 11:51:24 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-02-14 12:40:47 +0100
commitef2d54c025aa14d6dd73c9fee2ed9219964b4d9b (patch)
treeb75b48d158527c92a94dd1e8ee9e4c95c5618483
parentb0267b73eaed48cc0c3a4cf45f1fdce9b074c0a5 (diff)
openpgp: Improve error messages.
-rw-r--r--openpgp/src/cert/key_amalgamation.rs2
-rw-r--r--openpgp/src/cert/mod.rs5
2 files changed, 5 insertions, 2 deletions
diff --git a/openpgp/src/cert/key_amalgamation.rs b/openpgp/src/cert/key_amalgamation.rs
index 7840e5c1..e8c5eb39 100644
--- a/openpgp/src/cert/key_amalgamation.rs
+++ b/openpgp/src/cert/key_amalgamation.rs
@@ -176,7 +176,7 @@ impl<'a, P: 'a + key::KeyParts> KeyAmalgamation<'a, P> {
policy.key(
key::PublicParts::convert_valid_amalgamation_ref(
(&ka).mark_parts_unspecified_ref())
- .expect("secret key amalgamations contain secret keys"))?;
+ .expect("unspecified parts"))?;
Ok(ka)
} else {
Err(Error::NoBindingSignature(time).into())
diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs
index 5e050ea9..505b7a38 100644
--- a/openpgp/src/cert/mod.rs
+++ b/openpgp/src/cert/mod.rs
@@ -598,7 +598,10 @@ impl Cert {
where T: Into<Option<time::SystemTime>>
{
let t = t.into();
- self.primary_key().with_policy(policy, t).context("Primary key")?.alive()
+ self.primary_key()
+ .with_policy(policy, t).context(
+ "primary key rejected by policy")?
+ .alive()
}
/// Sets the key to expire in delta seconds.