From 14c4adf33e6683f17e74277e8e9b9211470aa5fc Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Fri, 23 Nov 2001 11:52:09 +0000 Subject: [PATCH] 2001-11-23 Marcus Brinkmann * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to the current protocol definition. --- trunk/gpgme/ChangeLog | 5 +++++ trunk/gpgme/engine-gpgsm.c | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 03a093a..cb0c7b6 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,8 @@ +2001-11-23 Marcus Brinkmann + + * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to + the current protocol definition. + 2001-11-23 Marcus Brinkmann * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent diff --git a/trunk/gpgme/engine-gpgsm.c b/trunk/gpgme/engine-gpgsm.c index 63f019a..bf6bf83 100644 --- a/trunk/gpgme/engine-gpgsm.c +++ b/trunk/gpgme/engine-gpgsm.c @@ -395,8 +395,28 @@ _gpgme_gpgsm_op_sign (GpgsmObject gpgsm, GpgmeData in, GpgmeData out, GpgmeSigMode mode, int use_armor, int use_textmode, GpgmeCtx ctx /* FIXME */) { - /* FIXME */ - return mk_error (Not_Implemented); + AssuanError err; + + if (!gpgsm) + return mk_error (Invalid_Value); + + gpgsm->command = xtrystrdup (mode == GPGME_SIG_MODE_DETACH + ? "VERIFY --detach" : "VERIFY"); + if (!gpgsm->command) + return mk_error (Out_Of_Core); + + gpgsm->input_data = in; + err = gpgsm_set_fd (gpgsm->assuan_ctx, "INPUT", gpgsm->input_fd_server); + if (err) + return mk_error (General_Error); /* FIXME */ + gpgsm->output_data = out; + err = gpgsm_set_fd (gpgsm->assuan_ctx, "OUTPUT", gpgsm->output_fd_server); + if (err) + return mk_error (General_Error); /* FIXME */ + _gpgme_io_close (gpgsm->message_fd); + gpgsm->message_fd = -1; + + return 0; } GpgmeError -- 2.26.2