diff options
author | Werner Koch <wk@gnupg.org> | 2009-08-06 22:12:00 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2009-08-06 22:12:00 +0200 |
commit | 019601191a250f5ec95ca871aa281ae836a1a34e (patch) | |
tree | 2d948f3e1fa834f262519853f5556bfe48f37209 /sm/sign.c | |
parent | Enable readline support in --card-edit. (diff) | |
download | gnupg2-019601191a250f5ec95ca871aa281ae836a1a34e.tar.xz gnupg2-019601191a250f5ec95ca871aa281ae836a1a34e.zip |
Improved detection of bad/invalid signer keys.
Diffstat (limited to '')
-rw-r--r-- | sm/sign.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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); |