2001-11-22 Marcus Brinkmann <marcus@g10code.de>

* engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
	(_gpgme_gpgsm_op_import): Likewise.
This commit is contained in:
Marcus Brinkmann 2001-11-22 15:22:27 +00:00
parent c23a9b5e74
commit 6290f74605
2 changed files with 62 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
(_gpgme_gpgsm_op_import): Likewise.
2001-11-22 Marcus Brinkmann <marcus@gnu.org>
* engine-gpgsm.c: Shuffle around header inclusion a bit, to still

View File

@ -206,6 +206,50 @@ gpgsm_set_fd (ASSUAN_CONTEXT ctx, const char *which, int fd)
return ASSUAN_General_Error;
}
GpgmeError
_gpgme_gpgsm_op_decrypt (GpgsmObject gpgsm, GpgmeData ciph, GpgmeData plain)
{
AssuanError err;
if (!gpgsm)
return mk_error (Invalid_Value);
gpgsm->input_data = ciph;
err = gpgsm_set_fd (gpgsm->assuan_ctx, "INPUT", gpgsm->input_fd_server);
if (err)
return mk_error (General_Error); /* FIXME */
gpgsm->output_data = plain;
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;
gpgsm->command = "DECRYPT";
return 0;
}
GpgmeError
_gpgme_gpgsm_op_import (GpgsmObject gpgsm, GpgmeData keydata)
{
AssuanError err;
if (!gpgsm)
return mk_error (Invalid_Value);
gpgsm->input_data = keydata;
err = gpgsm_set_fd (gpgsm->assuan_ctx, "INPUT", gpgsm->input_fd_server);
if (err)
return mk_error (General_Error); /* FIXME */
_gpgme_io_close (gpgsm->output_fd);
gpgsm->output_fd = -1;
_gpgme_io_close (gpgsm->message_fd);
gpgsm->message_fd = -1;
gpgsm->command = "DECRYPT";
return 0;
}
GpgmeError
_gpgme_gpgsm_op_verify (GpgsmObject gpgsm, GpgmeData sig, GpgmeData text)
{
@ -346,6 +390,18 @@ _gpgme_gpgsm_set_status_handler (GpgsmObject gpgsm,
return;
}
GpgmeError
_gpgme_gpgsm_op_decrypt (GpgsmObject gpgsm, GpgmeData ciph, GpgmeData plain)
{
return mk_error (Invalid_Engine);
}
GpgmeError
_gpgme_gpgsm_op_import (GpgsmObject gpgsm, GpgmeData keydata)
{
return mk_error (Invalid_Engine);
}
GpgmeError
_gpgme_gpgsm_op_verify (GpgsmObject gpgsm, GpgmeData sig, GpgmeData text)
{