[svn] gpgme - r1395 - trunk/src
svn author wk
cvs at cvs.gnupg.org
Thu Aug 6 21:09:11 CEST 2009
Author: wk
Date: 2009-08-06 21:09:10 +0200 (Thu, 06 Aug 2009)
New Revision: 1395
Modified:
trunk/src/ChangeLog
trunk/src/sign.c
Log:
Better detection for signature creation failure.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2009-08-06 17:17:18 UTC (rev 1394)
+++ trunk/src/ChangeLog 2009-08-06 19:09:10 UTC (rev 1395)
@@ -10,6 +10,7 @@
(sign_init_result): .. new. Init new fields.
(sign_start): Use sign_init_result.
(_gpgme_sign_status_handler): Take care of the new INV_SGNR.
+ Return an error if no signature has been created.
2009-07-07 Werner Koch <wk at g10code.com>
Modified: trunk/src/sign.c
===================================================================
--- trunk/src/sign.c 2009-08-06 17:17:18 UTC (rev 1394)
+++ trunk/src/sign.c 2009-08-06 19:09:10 UTC (rev 1395)
@@ -50,6 +50,7 @@
/* Flags used while processing the status lines. */
unsigned int ignore_inv_recp:1;
unsigned int inv_sgnr_seen:1;
+ unsigned int sig_created_seen:1;
} *op_data_t;
@@ -262,6 +263,7 @@
switch (code)
{
case GPGME_STATUS_SIG_CREATED:
+ opd->sig_created_seen = 1;
err = parse_sig_created (args, opd->last_sig_p);
if (err)
return err;
@@ -285,7 +287,9 @@
case GPGME_STATUS_EOF:
if (opd->result.invalid_signers)
- return gpg_error (GPG_ERR_UNUSABLE_SECKEY);
+ err = gpg_error (GPG_ERR_UNUSABLE_SECKEY);
+ else if (!opd->sig_created_seen)
+ err = gpg_error (GPG_ERR_GENERAL);
break;
default:
@@ -323,6 +327,7 @@
opd->last_sig_p = &opd->result.signatures;
opd->ignore_inv_recp = !!ignore_inv_recp;
opd->inv_sgnr_seen = 0;
+ opd->sig_created_seen = 0;
return 0;
}
More information about the Gnupg-commits
mailing list