* engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
selection. * vasprintf.c (va_copy): Define macro if not yet defined.
This commit is contained in:
parent
a48cef2c66
commit
c642b7d54a
@ -1,3 +1,9 @@
|
||||
2002-08-29 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
|
||||
selection.
|
||||
* vasprintf.c (va_copy): Define macro if not yet defined.
|
||||
|
||||
2002-08-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* passphrase.c (_gpgme_passphrase_status_handler): Reset
|
||||
|
@ -1076,6 +1076,8 @@ _gpgme_gpgsm_op_sign (GpgsmObject gpgsm, GpgmeData in, GpgmeData out,
|
||||
{
|
||||
GpgmeError err;
|
||||
char *assuan_cmd;
|
||||
int i;
|
||||
GpgmeKey key;
|
||||
|
||||
if (!gpgsm)
|
||||
return mk_error (Invalid_Value);
|
||||
@ -1087,11 +1089,36 @@ _gpgme_gpgsm_op_sign (GpgsmObject gpgsm, GpgmeData in, GpgmeData out,
|
||||
|
||||
if (asprintf (&assuan_cmd, "OPTION include-certs %i", include_certs) < 0)
|
||||
return mk_error (Out_Of_Core);
|
||||
err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, assuan_cmd, NULL, NULL);
|
||||
err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, assuan_cmd, NULL,NULL);
|
||||
free (assuan_cmd);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* We must do a reset becuase we need to reset the list of signers. Note
|
||||
that RESET does not reset OPTION commands. */
|
||||
err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, "RESET", NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
for (i = 0; (key = gpgme_signers_enum (ctx, i)); i++)
|
||||
{
|
||||
const char *s = gpgme_key_get_string_attr (key, GPGME_ATTR_FPR,
|
||||
NULL, 0);
|
||||
if (s && strlen (s) < 80)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
strcpy (stpcpy (buf, "SIGNER "), s);
|
||||
err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, buf,
|
||||
NULL, NULL);
|
||||
}
|
||||
else
|
||||
err = GPGME_Invalid_Key;
|
||||
gpgme_key_unref (key);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
gpgsm->input_cb.data = in;
|
||||
err = gpgsm_set_fd (gpgsm->assuan_ctx, "INPUT", gpgsm->input_fd_server,
|
||||
map_input_enc (gpgsm->input_cb.data));
|
||||
|
@ -43,7 +43,7 @@ extern "C" {
|
||||
AM_PATH_GPGME macro) check that this header matches the installed
|
||||
library. Warning: Do not edit the next line. configure will do
|
||||
that for you! */
|
||||
#define GPGME_VERSION "0.3.9"
|
||||
#define GPGME_VERSION "0.3.10"
|
||||
|
||||
|
||||
/* The opaque data types used by GPGME. */
|
||||
|
Loading…
Reference in New Issue
Block a user