diff options
Diffstat (limited to 'src/op-support.c')
-rw-r--r-- | src/op-support.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/op-support.c b/src/op-support.c index 000560b..edd317d 100644 --- a/src/op-support.c +++ b/src/op-support.c @@ -2,17 +2,17 @@ Copyright (C) 2002, 2003, 2004, 2007 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 Lesser General Public License as published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -31,6 +31,7 @@ #include "context.h" #include "ops.h" #include "util.h" +#include "debug.h" gpgme_error_t @@ -55,7 +56,7 @@ _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_id_t type, void **hook, data = calloc (1, sizeof (struct ctx_op_data) + size); if (!data) - return gpg_error_from_errno (errno); + return gpg_error_from_syserror (); data->magic = CTX_OP_DATA_MAGIC; data->next = ctx->op_data; data->type = type; @@ -72,7 +73,7 @@ _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_id_t type, void **hook, /* type is: 0: asynchronous operation (use global or user event loop). 1: synchronous operation (always use private event loop). 2: asynchronous private operation (use private or user - event loop). + event loop). 256: Modification flag to suppress the engine reset. */ gpgme_error_t @@ -133,6 +134,15 @@ _gpgme_op_reset (gpgme_ctx_t ctx, int type) #endif if (gpg_err_code (err) == GPG_ERR_NOT_IMPLEMENTED) err = 0; + + if (!err) + { + err = _gpgme_engine_set_pinentry_mode (ctx->engine, + ctx->pinentry_mode); + if (gpg_err_code (err) == GPG_ERR_NOT_IMPLEMENTED) + err = 0; + } + if (err) { _gpgme_engine_release (ctx->engine); @@ -191,7 +201,7 @@ _gpgme_parse_inv_recp (char *args, gpgme_invalid_key_t *key) inv_key = malloc (sizeof (*inv_key)); if (!inv_key) - return gpg_error_from_errno (errno); + return gpg_error_from_syserror (); inv_key->next = NULL; gpg_err_set_errno (0); reason = strtol (args, &tail, 0); @@ -199,7 +209,7 @@ _gpgme_parse_inv_recp (char *args, gpgme_invalid_key_t *key) { /* The crypto backend does not behave. */ free (inv_key); - return gpg_error (GPG_ERR_INV_ENGINE); + return trace_gpg_error (GPG_ERR_INV_ENGINE); } switch (reason) @@ -265,9 +275,8 @@ _gpgme_parse_inv_recp (char *args, gpgme_invalid_key_t *key) inv_key->fpr = strdup (tail); if (!inv_key->fpr) { - int saved_errno = errno; free (inv_key); - return gpg_error_from_errno (saved_errno); + return gpg_error_from_syserror (); } } else |