summaryrefslogtreecommitdiffstats
path: root/openpgp/src
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-01-16 17:33:57 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-01-16 18:01:45 +0100
commit9a30451890b61aa8121fde7570a7e1d1ebaa3778 (patch)
tree831f7683a05ebb119e5a3f39cb61b31942cd5fdf /openpgp/src
parentf1dabd075d78cf45c4e0b2e61334267c22d7145b (diff)
openpgp: Remove variant VerificationResult::BadChecksum.
- This is better expressed as an error.
Diffstat (limited to 'openpgp/src')
-rw-r--r--openpgp/src/parse/stream.rs26
1 files changed, 6 insertions, 20 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index 93ca9b7e..ec53635c 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -201,18 +201,6 @@ pub enum VerificationResult<'a> {
sig: Signature,
},
- /// The signature is bad.
- BadChecksum {
- /// The signature.
- sig: Signature,
-
- /// The signature's issuer.
- cert: &'a Cert,
-
- /// The signing key that made the signature.
- ka: KeyAmalgamation<'a, key::PublicParts>,
- },
-
/// An error occured while verifying the signature.
///
/// This could occur if the signature is invalid (e.g., no
@@ -240,7 +228,6 @@ impl<'a> VerificationResult<'a> {
GoodChecksum { sig, .. } => sig.level(),
NotAlive { sig, .. } => sig.level(),
MissingKey { sig, .. } => sig.level(),
- BadChecksum { sig, .. } => sig.level(),
Error { sig, .. } => sig.level(),
}
}
@@ -757,10 +744,10 @@ impl<'a, H: VerificationHelper> Verifier<'a, H> {
continue 'sigs;
}
Ok(false) => {
- VerificationResult::BadChecksum {
+ VerificationResult::Error {
sig: sig.clone(),
- cert: ka.cert(),
- ka,
+ error:
+ Error::ManipulatedMessage.into(),
}
}
Err(err) => {
@@ -1750,10 +1737,10 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
continue 'sigs;
}
Ok(false) => {
- VerificationResult::BadChecksum {
+ VerificationResult::Error {
sig: sig.clone(),
- cert: ka.cert(),
- ka,
+ error:
+ Error::ManipulatedMessage.into(),
}
}
Err(err) => {
@@ -1920,7 +1907,6 @@ mod test {
GoodChecksum { .. } => self.good += 1,
MissingKey { .. } => self.unknown += 1,
NotAlive { .. } => self.bad += 1,
- BadChecksum { .. } => self.bad += 1,
Error { .. } => self.bad += 1,
}
}