diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-01-16 17:33:57 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-01-16 18:01:45 +0100 |
commit | 9a30451890b61aa8121fde7570a7e1d1ebaa3778 (patch) | |
tree | 831f7683a05ebb119e5a3f39cb61b31942cd5fdf /openpgp-ffi/examples/decrypt-with.c | |
parent | f1dabd075d78cf45c4e0b2e61334267c22d7145b (diff) |
openpgp: Remove variant VerificationResult::BadChecksum.
- This is better expressed as an error.
Diffstat (limited to 'openpgp-ffi/examples/decrypt-with.c')
-rw-r--r-- | openpgp-ffi/examples/decrypt-with.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/openpgp-ffi/examples/decrypt-with.c b/openpgp-ffi/examples/decrypt-with.c index d395abd9..3f98c574 100644 --- a/openpgp-ffi/examples/decrypt-with.c +++ b/openpgp-ffi/examples/decrypt-with.c @@ -102,13 +102,15 @@ check_cb (void *cookie_opaque, pgp_message_structure_t structure) fprintf (stderr, "No key to check signature from %s\n", keyid_str); break; - case PGP_VERIFICATION_RESULT_BAD_CHECKSUM: - pgp_verification_result_bad_checksum (result, NULL, NULL, - &key, NULL, NULL); - keyid = pgp_key_keyid (key); - keyid_str = pgp_keyid_to_string (keyid); - fprintf (stderr, "Bad signature from %s\n", keyid_str); + case PGP_VERIFICATION_RESULT_ERROR: { + pgp_error_t err; + pgp_verification_result_error (result, NULL, &err); + char *err_str = pgp_error_to_string (err); + fprintf (stderr, "Bad signature: %s\n", err_str); + free (err_str); + pgp_error_free (err); break; + } default: assert (! "reachable"); |