From 6aaa48054b1c3347b2f8b0bbaddbd174459d6345 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 2 Jul 2002 19:38:14 +0000 Subject: [PATCH] * verify.c (gpgsm_verify): Extend the STATUS_BADSIG line with the fingerprint. --- sm/ChangeLog | 3 +++ sm/verify.c | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sm/ChangeLog b/sm/ChangeLog index ac45cfa55..423c223a7 100644 --- a/sm/ChangeLog +++ b/sm/ChangeLog @@ -1,5 +1,8 @@ 2002-07-02 Werner Koch + * verify.c (gpgsm_verify): Extend the STATUS_BADSIG line with + the fingerprint. + * certpath.c (check_cert_policy): Don't use log_error to print a warning. diff --git a/sm/verify.c b/sm/verify.c index 8e54da285..f4af56885 100644 --- a/sm/verify.c +++ b/sm/verify.c @@ -351,9 +351,13 @@ gpgsm_verify (CTRL ctrl, int in_fd, int data_fd, FILE *out_fp) || gcry_md_get_algo_dlen (algo) != msgdigestlen || !s || memcmp (s, msgdigest, msgdigestlen) ) { + char *fpr; + log_error ("invalid signature: message digest attribute " "does not match calculated one\n"); - gpgsm_status (ctrl, STATUS_BADSIG, NULL); + fpr = gpgsm_get_fingerprint_hexstring (cert, GCRY_MD_SHA1); + gpgsm_status (ctrl, STATUS_BADSIG, fpr); + xfree (fpr); goto next_signer; } @@ -385,8 +389,12 @@ gpgsm_verify (CTRL ctrl, int in_fd, int data_fd, FILE *out_fp) if (rc) { + char *fpr; + log_error ("invalid signature: %s\n", gnupg_strerror (rc)); - gpgsm_status (ctrl, STATUS_BADSIG, NULL); + fpr = gpgsm_get_fingerprint_hexstring (cert, GCRY_MD_SHA1); + gpgsm_status (ctrl, STATUS_BADSIG, fpr); + xfree (fpr); goto next_signer; } rc = gpgsm_cert_use_verify_p (cert); /*(this displays an info message)*/