summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-11-10 15:27:30 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-11-12 10:31:29 +0100
commit91e82329cb50dda79243d933f13fd22888af5cdd (patch)
tree53d166705c06ce980b48202f3a968ba212aeab65
parentc93f7d53ecf9700eed6245b81031b7512f8ec604 (diff)
openpgp: Improve tracing.
-rw-r--r--openpgp/src/cert.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs
index 62cce750..73453e07 100644
--- a/openpgp/src/cert.rs
+++ b/openpgp/src/cert.rs
@@ -1481,8 +1481,10 @@ impl Cert {
.into_iter()
{
// Use hash prefix as heuristic.
- if let Ok(hash) = Signature::$hash_method(
- &sig, self.primary.key(), $($verify_args),*) {
+ match Signature::$hash_method(&sig,
+ self.primary.key(),
+ $($verify_args),*) {
+ Ok(hash) => {
if &sig.digest_prefix()[..] == &hash[..2] {
// See if we can get the key for a
// positive verification.
@@ -1513,15 +1515,17 @@ impl Cert {
self.bad.push(sig);
}
- } else {
+ },
+ Err(e) => {
// Hashing failed, we likely don't support
// the hash algorithm.
t!("Sig {:02X}{:02X}, type = {}: \
- Hashing failed",
+ Hashing failed: {}",
sig.digest_prefix()[0], sig.digest_prefix()[1],
- sig.typ());
+ sig.typ(), e);
self.bad.push(sig);
+ },
}
}
});