output to /dev/null.
* verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
* gpgme.c (gpgme_get_protocol): New.
* data.c (gpgme_data_write): Changed type of BUFFER to void*.
(gpgme_data_read): Ditto.
* verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
lines so that a claim can be made without looking up the key.
(gpgme_get_sig_string_attr): New.
(gpgme_get_sig_ulong_attr): New.
* gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
* gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
* verify.c (_gpgme_verify_status_handler, finish_sig): Handle
these new status codes. Store the expiration time
2002-05-03 Werner Koch <wk@gnupg.org>
+ * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
+ output to /dev/null.
+
+ * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
+ * gpgme.c (gpgme_get_protocol): New.
+
+ * data.c (gpgme_data_write): Changed type of BUFFER to void*.
+ (gpgme_data_read): Ditto.
+
* verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
lines so that a claim can be made without looking up the key.
(gpgme_get_sig_string_attr): New.
* error code GPGME_EOF.
**/
GpgmeError
-gpgme_data_read (GpgmeData dh, char *buffer, size_t length, size_t *nread)
+gpgme_data_read (GpgmeData dh, void *buffer, size_t length, size_t *nread)
{
size_t nbytes;
* Return value: 0 on success or an error code
**/
GpgmeError
-gpgme_data_write (GpgmeData dh, const char *buffer, size_t length)
+gpgme_data_write (GpgmeData dh, const void *buffer, size_t length)
{
if (!dh || !buffer)
return mk_error (Invalid_Value);
- return _gpgme_data_append (dh, buffer, length );
+ return _gpgme_data_append (dh, (const char *)buffer, length );
}
argv[1] = "--server";
argv[2] = NULL;
- err = assuan_pipe_connect (&gpgsm->assuan_ctx,
- _gpgme_get_gpgsm_path (), argv, child_fds);
+ err = assuan_pipe_connect2 (&gpgsm->assuan_ctx,
+ _gpgme_get_gpgsm_path (), argv, child_fds,
+ 1 /* dup stderr to /dev/null */);
dft_display = getenv ("DISPLAY");
if (dft_display)
return 0;
}
+GpgmeProtocol
+gpgme_get_protocol (GpgmeCtx ctx)
+{
+ if (!ctx)
+ return 0; /* well, this is OpenPGP */
+ if (ctx->use_cms)
+ return GPGME_PROTOCOL_CMS;
+ return GPGME_PROTOCOL_OpenPGP;
+}
+
/**
* gpgme_set_armor:
/* Set the protocol to be used by CTX to PROTO. */
GpgmeError gpgme_set_protocol (GpgmeCtx ctx, GpgmeProtocol proto);
+/* Get the protocol used with CTX */
+GpgmeProtocol gpgme_get_protocol (GpgmeCtx ctx);
+
/* If YES is non-zero, enable armor mode in CTX, disable it otherwise. */
void gpgme_set_armor (GpgmeCtx ctx, int yes);
/* Read LENGTH bytes from the data object DH and store them in the
memory starting at BUFFER. The number of bytes actually read is
returned in NREAD. */
-GpgmeError gpgme_data_read (GpgmeData dh, char *buffer,
+GpgmeError gpgme_data_read (GpgmeData dh, void *buffer,
size_t length, size_t *nread);
/* Write LENGTH bytes starting from BUFFER into the data object DH. */
-GpgmeError gpgme_data_write (GpgmeData dh, const char *buffer, size_t length);
+GpgmeError gpgme_data_write (GpgmeData dh, const void *buffer, size_t length);
/* Key and trust functions. */
err = gpgme_new (&listctx);
if (err)
return err;
+ gpgme_set_protocol (listctx, gpgme_get_protocol (c));
gpgme_set_keylist_mode (listctx, c->keylist_mode);
err = gpgme_op_keylist_start (listctx, result->fpr, 0);
if (!err)