2003-01-19 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start. (gpg_start): Rename to ... (start): ... this function. Change arguments to GpgObject. (gpg_decrypt): Call start. (gpg_edit): Likewise. (gpg_encrypt): Likewise. (gpg_encrypt_sign): Likewise. (gpg_export): Likewise. (gpg_import): Likewise. (gpg_keylist): Likewise. (gpg_keylist_ext): Likewise. (gpg_trustlist): Likewise. (gpg_verify): Likewise. * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start. (gpgsm_start): Rename to ... (struct gpgsm_object_s): Remove member command. (gpgsm_release): Don't free command. (start): ... this function. Change arguments to GpgsmObject and const char *. (gpgsm_decrypt): Call start. (gpgsm_delete): Likewise. (gpgsm_encrypt): Likewise. (gpgsm_export): Likewise. (gpgsm_genkey): Likewise. (gpgsm_import): Likewise. (gpgsm_keylist): Likewise. (gpgsm_keylist_ext): Likewise. (gpgsm_verify): Likewise. * decrypt.c (_gpgme_decrypt_start): Don't call _gpgme_engine_start. * delete.c (_gpgme_op_delete_start): Likewise. * edit.c (_gpgme_op_edit_start): Likewise. * encrypt.c (_gpgme_op_encrypt_start): * encrypt-sign.c (_gpgme_op_encrypt_sign_start): * export.c (_gpgme_op_export_start): Likewise. * genkey.c (_gpgme_op_genkey_start): Likewise. * import.c (_gpgme_op_import_start): Likewise. * keylist.c (gpgme_op_keylist_ext_start): Likewise. (gpgme_op_keylist_start): Likewise. * sign.c (_gpgme_op_sign_start): Likewise. * trustlist.c (gpgme_op_trustlist_start): Likewise. * verify.c (_gpgme_op_verify_start): Likewise. * engine-backend.h (struct engine_ops): Remove member start. * engine.h (_gpgme_engine_start): Remove prototype. * engine.c (_gpgme_engine_start): Remove function.
This commit is contained in:
parent
3552416199
commit
b083ea8da3
@ -1,3 +1,55 @@
|
||||
2003-01-19 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
|
||||
(gpg_start): Rename to ...
|
||||
(start): ... this function. Change arguments to GpgObject.
|
||||
(gpg_decrypt): Call start.
|
||||
(gpg_edit): Likewise.
|
||||
(gpg_encrypt): Likewise.
|
||||
(gpg_encrypt_sign): Likewise.
|
||||
(gpg_export): Likewise.
|
||||
(gpg_import): Likewise.
|
||||
(gpg_keylist): Likewise.
|
||||
(gpg_keylist_ext): Likewise.
|
||||
(gpg_trustlist): Likewise.
|
||||
(gpg_verify): Likewise.
|
||||
|
||||
* engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
|
||||
(gpgsm_start): Rename to ...
|
||||
(struct gpgsm_object_s): Remove member command.
|
||||
(gpgsm_release): Don't free command.
|
||||
(start): ... this function. Change arguments to GpgsmObject and
|
||||
const char *.
|
||||
(gpgsm_decrypt): Call start.
|
||||
(gpgsm_delete): Likewise.
|
||||
(gpgsm_encrypt): Likewise.
|
||||
(gpgsm_export): Likewise.
|
||||
(gpgsm_genkey): Likewise.
|
||||
(gpgsm_import): Likewise.
|
||||
(gpgsm_keylist): Likewise.
|
||||
(gpgsm_keylist_ext): Likewise.
|
||||
(gpgsm_verify): Likewise.
|
||||
|
||||
* decrypt.c (_gpgme_decrypt_start): Don't call
|
||||
_gpgme_engine_start.
|
||||
* delete.c (_gpgme_op_delete_start): Likewise.
|
||||
* edit.c (_gpgme_op_edit_start): Likewise.
|
||||
* encrypt.c (_gpgme_op_encrypt_start):
|
||||
* encrypt-sign.c (_gpgme_op_encrypt_sign_start):
|
||||
* export.c (_gpgme_op_export_start): Likewise.
|
||||
* genkey.c (_gpgme_op_genkey_start): Likewise.
|
||||
* import.c (_gpgme_op_import_start): Likewise.
|
||||
* keylist.c (gpgme_op_keylist_ext_start): Likewise.
|
||||
(gpgme_op_keylist_start): Likewise.
|
||||
* sign.c (_gpgme_op_sign_start): Likewise.
|
||||
* trustlist.c (gpgme_op_trustlist_start): Likewise.
|
||||
* verify.c (_gpgme_op_verify_start): Likewise.
|
||||
|
||||
* engine-backend.h (struct engine_ops): Remove member start.
|
||||
|
||||
* engine.h (_gpgme_engine_start): Remove prototype.
|
||||
* engine.c (_gpgme_engine_start): Remove function.
|
||||
|
||||
2003-01-06 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
|
||||
|
@ -192,9 +192,6 @@ _gpgme_decrypt_start (GpgmeCtx ctx, int synchronous,
|
||||
|
||||
err = _gpgme_engine_op_decrypt (ctx->engine, ciph, plain);
|
||||
|
||||
if (!err) /* And kick off the process. */
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
{
|
||||
|
@ -1,24 +1,25 @@
|
||||
/* delete.c - delete a key
|
||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GPGME is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GPGME; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -108,8 +109,6 @@ _gpgme_op_delete_start (GpgmeCtx ctx, int synchronous,
|
||||
_gpgme_engine_set_verbosity (ctx->engine, ctx->verbosity);
|
||||
|
||||
err = _gpgme_engine_op_delete (ctx->engine, key, allow_secret);
|
||||
if (!err)
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
|
42
gpgme/edit.c
42
gpgme/edit.c
@ -1,24 +1,25 @@
|
||||
/* edit.c - key edit functions
|
||||
* Copyright (C) 2002 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GPGME is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
Copyright (C) 2002 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GPGME; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -110,10 +111,7 @@ _gpgme_op_edit_start (GpgmeCtx ctx, int synchronous,
|
||||
|
||||
_gpgme_engine_set_verbosity (ctx->engine, ctx->verbosity);
|
||||
|
||||
_gpgme_engine_op_edit (ctx->engine, key, out, ctx);
|
||||
|
||||
/* And kick off the process. */
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
err = _gpgme_engine_op_edit (ctx->engine, key, out, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
|
@ -1,25 +1,24 @@
|
||||
/* encrypt-sign.c - encrypt and verify functions
|
||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GPGME is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GPGME; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
@ -75,9 +74,6 @@ _gpgme_op_encrypt_sign_start (GpgmeCtx ctx, int synchronous,
|
||||
err = _gpgme_engine_op_encrypt_sign (ctx->engine, recp, plain, cipher,
|
||||
ctx->use_armor, ctx /* FIXME */);
|
||||
|
||||
if (!err) /* And kick off the process. */
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
{
|
||||
|
@ -1,25 +1,26 @@
|
||||
/* encrypt.c - encrypt functions
|
||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GPGME is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GPGME; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -203,10 +204,6 @@ _gpgme_op_encrypt_start (GpgmeCtx ctx, int synchronous,
|
||||
|
||||
err = _gpgme_engine_op_encrypt (ctx->engine, recp, plain, ciph, ctx->use_armor);
|
||||
|
||||
|
||||
if (!err) /* And kick off the process. */
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
{
|
||||
|
@ -72,7 +72,6 @@ struct engine_ops
|
||||
GpgmeError (*trustlist) (void *engine, const char *pattern);
|
||||
GpgmeError (*verify) (void *engine, GpgmeData sig, GpgmeData signed_text,
|
||||
GpgmeData plaintext);
|
||||
GpgmeError (*start) (void *engine, void *opaque);
|
||||
|
||||
void (*set_io_cbs) (void *engine, struct GpgmeIOCbs *io_cbs);
|
||||
void (*io_event) (void *engine, GpgmeEventIO type, void *type_data);
|
||||
|
1180
gpgme/engine-gpgsm.c
1180
gpgme/engine-gpgsm.c
File diff suppressed because it is too large
Load Diff
@ -426,19 +426,6 @@ _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig,
|
||||
}
|
||||
|
||||
|
||||
GpgmeError
|
||||
_gpgme_engine_start (EngineObject engine, void *opaque)
|
||||
{
|
||||
if (!engine)
|
||||
return mk_error (Invalid_Value);
|
||||
|
||||
if (!engine->ops->start)
|
||||
return mk_error (Not_Implemented);
|
||||
|
||||
return (*engine->ops->start) (engine->engine, opaque);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_gpgme_engine_set_io_cbs (EngineObject engine,
|
||||
struct GpgmeIOCbs *io_cbs)
|
||||
|
@ -81,7 +81,6 @@ GpgmeError _gpgme_engine_op_trustlist (EngineObject engine,
|
||||
const char *pattern);
|
||||
GpgmeError _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig,
|
||||
GpgmeData signed_text, GpgmeData plaintext);
|
||||
GpgmeError _gpgme_engine_start (EngineObject engine, void *opaque);
|
||||
|
||||
void _gpgme_engine_set_io_cbs (EngineObject engine,
|
||||
struct GpgmeIOCbs *io_cbs);
|
||||
|
@ -1,25 +1,26 @@
|
||||
/* export.c - encrypt functions
|
||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GPGME is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GPGME; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -61,8 +62,6 @@ _gpgme_op_export_start (GpgmeCtx ctx, int synchronous,
|
||||
_gpgme_engine_set_verbosity (ctx->engine, ctx->verbosity);
|
||||
|
||||
err = _gpgme_engine_op_export (ctx->engine, recp, keydata, ctx->use_armor);
|
||||
if (!err)
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
|
@ -130,9 +130,6 @@ _gpgme_op_genkey_start (GpgmeCtx ctx, int synchronous, const char *parms,
|
||||
err = _gpgme_engine_op_genkey (ctx->engine, ctx->help_data_1, ctx->use_armor,
|
||||
pubkey, seckey);
|
||||
|
||||
if (!err)
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
{
|
||||
|
@ -1,25 +1,26 @@
|
||||
/* import.c - encrypt functions
|
||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GPGME is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GPGME; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -195,10 +196,7 @@ _gpgme_op_import_start (GpgmeCtx ctx, int synchronous, GpgmeData keydata)
|
||||
_gpgme_engine_set_status_handler (ctx->engine, import_status_handler, ctx);
|
||||
_gpgme_engine_set_verbosity (ctx->engine, ctx->verbosity);
|
||||
|
||||
_gpgme_engine_op_import (ctx->engine, keydata);
|
||||
|
||||
if (!err)
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
err = _gpgme_engine_op_import (ctx->engine, keydata);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
|
@ -1220,6 +1220,8 @@ gpgme_get_key (GpgmeCtx ctx, const char *fpr, GpgmeKey *r_key,
|
||||
}
|
||||
}
|
||||
|
||||
/* We need our own context because we have to avoid the user's I/O
|
||||
callback handlers. */
|
||||
/* Fixme: This can be optimized by keeping an internal context
|
||||
used for such key listings. */
|
||||
err = gpgme_new (&listctx);
|
||||
|
@ -772,9 +772,6 @@ gpgme_op_keylist_start (GpgmeCtx ctx, const char *pattern, int secret_only)
|
||||
err = _gpgme_engine_op_keylist (ctx->engine, pattern, secret_only,
|
||||
ctx->keylist_mode);
|
||||
|
||||
if (!err) /* And kick off the process. */
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
{
|
||||
@ -826,10 +823,6 @@ gpgme_op_keylist_ext_start (GpgmeCtx ctx, const char *pattern[],
|
||||
err = _gpgme_engine_op_keylist_ext (ctx->engine, pattern, secret_only,
|
||||
reserved, ctx->keylist_mode);
|
||||
|
||||
/* And kick off the process. */
|
||||
if (!err)
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
{
|
||||
|
@ -1079,9 +1079,8 @@ colon_line_handler (void *opaque, int fd)
|
||||
|
||||
|
||||
static GpgmeError
|
||||
gpg_start (void *engine, void *opaque)
|
||||
start (GpgObject gpg)
|
||||
{
|
||||
GpgObject gpg = engine;
|
||||
GpgmeError rc;
|
||||
int i, n;
|
||||
int status;
|
||||
@ -1223,6 +1222,8 @@ gpg_decrypt (void *engine, GpgmeData ciph, GpgmeData plain)
|
||||
if (!err)
|
||||
err = add_data (gpg, ciph, 0, 0);
|
||||
|
||||
if (!err)
|
||||
start (gpg);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1245,6 +1246,8 @@ gpg_delete (void *engine, GpgmeKey key, int allow_secret)
|
||||
err = add_arg (gpg, s);
|
||||
}
|
||||
|
||||
if (!err)
|
||||
start (gpg);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1297,6 +1300,8 @@ gpg_edit (void *engine, GpgmeKey key, GpgmeData out, GpgmeCtx ctx /* FIXME */)
|
||||
else
|
||||
err = add_arg (gpg, s);
|
||||
}
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -1357,9 +1362,13 @@ gpg_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain,
|
||||
if (!err)
|
||||
err = add_data (gpg, plain, 0, 0);
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
static GpgmeError
|
||||
gpg_encrypt_sign (void *engine, GpgmeRecipients recp, GpgmeData plain,
|
||||
GpgmeData ciph, int use_armor, GpgmeCtx ctx /* FIXME */)
|
||||
@ -1396,9 +1405,13 @@ gpg_encrypt_sign (void *engine, GpgmeRecipients recp, GpgmeData plain,
|
||||
if (!err)
|
||||
err = add_data (gpg, plain, 0, 0);
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
static GpgmeError
|
||||
gpg_export (void *engine, GpgmeRecipients recp, GpgmeData keydata,
|
||||
int use_armor)
|
||||
@ -1426,6 +1439,9 @@ gpg_export (void *engine, GpgmeRecipients recp, GpgmeData keydata,
|
||||
err = gpgme_recipients_enum_close (recp, &ec);
|
||||
}
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1453,6 +1469,9 @@ gpg_genkey (void *engine, GpgmeData help_data, int use_armor,
|
||||
if (!err)
|
||||
err = add_data (gpg, help_data, 0, 0);
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1467,6 +1486,9 @@ gpg_import (void *engine, GpgmeData keydata)
|
||||
if (!err)
|
||||
err = add_data (gpg, keydata, 0, 0);
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1496,6 +1518,9 @@ gpg_keylist (void *engine, const char *pattern, int secret_only,
|
||||
if (!err && pattern && *pattern)
|
||||
err = add_arg (gpg, pattern);
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1531,6 +1556,9 @@ gpg_keylist_ext (void *engine, const char *pattern[], int secret_only,
|
||||
err = add_arg (gpg, *(pattern++));
|
||||
}
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1565,6 +1593,9 @@ gpg_sign (void *engine, GpgmeData in, GpgmeData out, GpgmeSigMode mode,
|
||||
if (!err)
|
||||
err = add_data (gpg, out, 1, 1);
|
||||
|
||||
if (!err)
|
||||
start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1584,6 +1615,9 @@ gpg_trustlist (void *engine, const char *pattern)
|
||||
if (!err)
|
||||
err = add_arg (gpg, pattern);
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1624,6 +1658,10 @@ gpg_verify (void *engine, GpgmeData sig, GpgmeData signed_text,
|
||||
err = add_data (gpg, signed_text, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!err)
|
||||
err = start (gpg);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1664,7 +1702,6 @@ struct engine_ops _gpgme_engine_ops_gpg =
|
||||
gpg_sign,
|
||||
gpg_trustlist,
|
||||
gpg_verify,
|
||||
gpg_start,
|
||||
gpg_set_io_cbs,
|
||||
gpg_io_event
|
||||
};
|
||||
|
54
gpgme/sign.c
54
gpgme/sign.c
@ -1,25 +1,26 @@
|
||||
/* sign.c - signing functions
|
||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GPGME is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GPGME; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -52,9 +53,9 @@ _gpgme_release_sign_result (SignResult result)
|
||||
}
|
||||
|
||||
/* Parse the args and save the information
|
||||
* <type> <pubkey algo> <hash algo> <class> <timestamp> <key fpr>
|
||||
* in an XML structure. With args of NULL the xml structure is closed.
|
||||
*/
|
||||
<type> <pubkey algo> <hash algo> <class> <timestamp> <key fpr>
|
||||
in an XML structure. With args of NULL the xml structure is
|
||||
closed. */
|
||||
static void
|
||||
append_xml_siginfo (GpgmeData *rdh, char *args)
|
||||
{
|
||||
@ -204,12 +205,9 @@ _gpgme_op_sign_start (GpgmeCtx ctx, int synchronous,
|
||||
ctx);
|
||||
_gpgme_engine_set_verbosity (ctx->engine, ctx->verbosity);
|
||||
|
||||
_gpgme_engine_op_sign (ctx->engine, in, out, mode, ctx->use_armor,
|
||||
ctx->use_textmode, ctx->include_certs,
|
||||
ctx /* FIXME */);
|
||||
|
||||
/* And kick off the process. */
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
err = _gpgme_engine_op_sign (ctx->engine, in, out, mode, ctx->use_armor,
|
||||
ctx->use_textmode, ctx->include_certs,
|
||||
ctx /* FIXME */);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
|
@ -1,25 +1,26 @@
|
||||
/* trustlist.c - key listing
|
||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GPGME is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GPGME; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -68,19 +69,17 @@ trustlist_status_handler (GpgmeCtx ctx, GpgmeStatusCode code, char *args)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This handler is used to parse the output of --list-trust-path:
|
||||
* Format:
|
||||
* level:keyid:type:recno:ot:val:mc:cc:name:
|
||||
* With TYPE = U for a user ID
|
||||
* K for a key
|
||||
* The RECNO is either the one of the dir record or the one of the uid record.
|
||||
* OT is the the usual trust letter and only availabel on K lines.
|
||||
* VAL is the calcualted validity
|
||||
* MC is the marginal trust counter and only available on U lines
|
||||
* CC is the same for the complete count
|
||||
* NAME ist the username and only printed on U lines
|
||||
*/
|
||||
/* This handler is used to parse the output of --list-trust-path:
|
||||
Format:
|
||||
level:keyid:type:recno:ot:val:mc:cc:name:
|
||||
With TYPE = U for a user ID
|
||||
K for a key
|
||||
The RECNO is either the one of the dir record or the one of the uid
|
||||
record. OT is the the usual trust letter and only availabel on K
|
||||
lines. VAL is the calcualted validity MC is the marginal trust
|
||||
counter and only available on U lines CC is the same for the
|
||||
complete count NAME ist the username and only printed on U
|
||||
lines. */
|
||||
static void
|
||||
trustlist_colon_handler (GpgmeCtx ctx, char *line)
|
||||
{
|
||||
@ -193,9 +192,6 @@ gpgme_op_trustlist_start (GpgmeCtx ctx, const char *pattern, int max_level)
|
||||
|
||||
err =_gpgme_engine_op_trustlist (ctx->engine, pattern);
|
||||
|
||||
if (!err) /* And kick off the process. */
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
{
|
||||
|
@ -384,8 +384,6 @@ _gpgme_op_verify_start (GpgmeCtx ctx, int synchronous,
|
||||
goto leave;
|
||||
}
|
||||
err = _gpgme_engine_op_verify (ctx->engine, sig, signed_text, plaintext);
|
||||
if (!err) /* And kick off the process. */
|
||||
err = _gpgme_engine_start (ctx->engine, ctx);
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
|
Loading…
Reference in New Issue
Block a user