diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-19 12:18:01 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-19 12:46:58 +0100 |
commit | ef396882bc35a97d778e985cd69ebd5181852d8c (patch) | |
tree | 6e7945e1394ff82e5a72badc933ddac710c108cc /openpgp/examples/generate-sign-verify.rs | |
parent | 32174f69cd4d94b4f621f3273781d487e97fa031 (diff) |
openpgp: Split VerificationResult.
- Split VerificationResult into Result<GoodChecksum,
VerificationError>.
- Fixes #416.
Diffstat (limited to 'openpgp/examples/generate-sign-verify.rs')
-rw-r--r-- | openpgp/examples/generate-sign-verify.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/openpgp/examples/generate-sign-verify.rs b/openpgp/examples/generate-sign-verify.rs index d371a812..e5f21505 100644 --- a/openpgp/examples/generate-sign-verify.rs +++ b/openpgp/examples/generate-sign-verify.rs @@ -113,16 +113,10 @@ impl<'a> VerificationHelper for Helper<'a> { // whether the signature checks out mathematically, we apply // our policy. match results.into_iter().next() { - Some(VerificationResult::GoodChecksum { .. }) => + Some(Ok(_)) => good = true, - Some(VerificationResult::NotAlive { .. }) => - return Err(failure::err_msg( - "Signature good, but not alive")), - Some(VerificationResult::MissingKey { .. }) => - return Err(failure::err_msg( - "Missing key to verify signature")), - Some(VerificationResult::Error { error, .. }) => - return Err(error), + Some(Err(e)) => + return Err(openpgp::Error::from(e).into()), None => return Err(failure::err_msg("No signature")), } |