summaryrefslogtreecommitdiffstats
path: root/sm/sign.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-08-06 22:12:00 +0200
committerWerner Koch <wk@gnupg.org>2009-08-06 22:12:00 +0200
commit019601191a250f5ec95ca871aa281ae836a1a34e (patch)
tree2d948f3e1fa834f262519853f5556bfe48f37209 /sm/sign.c
parentEnable readline support in --card-edit. (diff)
downloadgnupg2-019601191a250f5ec95ca871aa281ae836a1a34e.tar.xz
gnupg2-019601191a250f5ec95ca871aa281ae836a1a34e.zip
Improved detection of bad/invalid signer keys.
Diffstat (limited to '')
-rw-r--r--sm/sign.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sm/sign.c b/sm/sign.c
index 0569052ed..776a5a571 100644
--- a/sm/sign.c
+++ b/sm/sign.c
@@ -372,6 +372,8 @@ gpgsm_sign (ctrl_t ctrl, certlist_t signerlist,
if (!cert)
{
log_error ("no default signer found\n");
+ gpgsm_status2 (ctrl, STATUS_INV_SGNR,
+ get_inv_recpsgnr_code (GPG_ERR_NO_SECKEY), NULL);
rc = gpg_error (GPG_ERR_GENERAL);
goto leave;
}
@@ -382,7 +384,15 @@ gpgsm_sign (ctrl_t ctrl, certlist_t signerlist,
if (!rc)
rc = gpgsm_validate_chain (ctrl, cert, "", NULL, 0, NULL, 0, NULL);
if (rc)
- goto leave;
+ {
+ char *tmpfpr;
+
+ tmpfpr = gpgsm_get_fingerprint_hexstring (cert, 0);
+ gpgsm_status2 (ctrl, STATUS_INV_SGNR,
+ get_inv_recpsgnr_code (rc), tmpfpr, NULL);
+ xfree (tmpfpr);
+ goto leave;
+ }
/* That one is fine - create signerlist. */
signerlist = xtrycalloc (1, sizeof *signerlist);