diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-11-09 23:55:02 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-11-10 00:05:23 +0100 |
commit | b8e5ef908ee211daee84a0782a115ae7fc003ec0 (patch) | |
tree | 360698ced26dc36aad015e11b89137d613b89208 /tool/src/commands/mod.rs | |
parent | 365862ed513057900c0d6c106ec51dff0a09693e (diff) |
openpgp: Distinguish bad signatures from those that are not alive.
- Return a different `VerificationResult` for signatures that are
not alive (BadSignature) from signatures that are actually
bad (BadCheck).
Diffstat (limited to 'tool/src/commands/mod.rs')
-rw-r--r-- | tool/src/commands/mod.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs index c637da4a..21521e90 100644 --- a/tool/src/commands/mod.rs +++ b/tool/src/commands/mod.rs @@ -229,6 +229,7 @@ impl<'a> VHelper<'a> { for result in results { let (issuer, level) = match result { GoodChecksum(ref sig, ..) => (sig.get_issuer(), sig.level()), + NotAlive(ref sig) => (sig.get_issuer(), sig.level()), MissingKey(ref sig) => (sig.get_issuer(), sig.level()), BadChecksum(ref sig) => (sig.get_issuer(), sig.level()), }; @@ -258,6 +259,23 @@ impl<'a> VHelper<'a> { self.good_checksums += 1; } }, + NotAlive(_) => { + if let Some(issuer) = issuer { + let issuer_str = format!("{}", issuer); + eprintln!("Good, but not alive {} from {}", what, + self.labels.get(&issuer).unwrap_or( + &issuer_str)); + } else { + eprintln!("Good, but not alive signature from {} \ + without issuer information", + what); + } + if trusted { + self.bad_signatures += 1; + } else { + self.bad_checksums += 1; + } + }, MissingKey(_) => { let issuer = issuer .expect("missing key checksum has an issuer"); |