summaryrefslogtreecommitdiffstats
path: root/openpgp
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp')
-rw-r--r--openpgp/examples/decrypt-with.rs3
-rw-r--r--openpgp/examples/generate-sign-verify.rs2
-rw-r--r--openpgp/src/parse/stream.rs26
3 files changed, 6 insertions, 25 deletions
diff --git a/openpgp/examples/decrypt-with.rs b/openpgp/examples/decrypt-with.rs
index 9af4e197..3f470f0f 100644
--- a/openpgp/examples/decrypt-with.rs
+++ b/openpgp/examples/decrypt-with.rs
@@ -132,9 +132,6 @@ impl VerificationHelper for Helper {
MissingKey { .. } => {
eprintln!("No key to check signature");
},
- BadChecksum { cert, .. } => {
- eprintln!("Bad signature from {}", cert);
- },
Error { error, .. } => {
eprintln!("Error: {}", error);
},
diff --git a/openpgp/examples/generate-sign-verify.rs b/openpgp/examples/generate-sign-verify.rs
index fefc8a20..8df9f1cf 100644
--- a/openpgp/examples/generate-sign-verify.rs
+++ b/openpgp/examples/generate-sign-verify.rs
@@ -116,8 +116,6 @@ impl<'a> VerificationHelper for Helper<'a> {
Some(VerificationResult::MissingKey { .. }) =>
return Err(failure::err_msg(
"Missing key to verify signature")),
- Some(VerificationResult::BadChecksum { .. }) =>
- return Err(failure::err_msg("Bad signature")),
Some(VerificationResult::Error { error, .. }) =>
return Err(error),
None =>
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,
}
}