(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@g10code.com>
/* 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;
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;
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:
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;
}