From 91e82329cb50dda79243d933f13fd22888af5cdd Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 10 Nov 2020 15:27:30 +0100 Subject: openpgp: Improve tracing. --- openpgp/src/cert.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'openpgp/src/cert.rs') 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); + }, } } }); -- cgit v1.2.3