+2011-05-26 Marcus Brinkmann <marcus@g10code.com>
+
+ * decrypt.c (gpgme_op_decrypt_start, gpgme_op_decrypt): Check CTX.
+ * decrypt-verify.c (gpgme_op_decrypt_verify_start)
+ (gpgme_op_decrypt_verify): Likewise.
+ * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
+ * edit.c (gpgme_op_edit_start, gpgme_op_edit)
+ (gpgme_op_card_edit_start, gpgme_op_card_edit): Likewise.
+ * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt): Likewise.
+ * encrypt-sign.c (gpgme_op_encrypt_sign_start)
+ (gpgme_op_encrypt_sign): Likewise.
+ * export.c (gpgme_op_export_start, gpgme_op_export)
+ (gpgme_op_export_ext_start, gpgme_op_export_ext)
+ (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
+ * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey): Likewise.
+ * getauditlog.c (gpgme_op_getauditlog_start)
+ (gpgme_op_getauditlog): Likewise.
+ * gpgconf.c (gpgme_op_conf_load, gpgme_op_conf_save): Likewise.
+ * import.c (gpgme_op_import_start, gpgme_op_import_keys_start)
+ (gpgme_op_import_keys, gpgme_op_import): Likewise.
+ * keylist.c (gpgme_op_keylist_start, gpgme_op_keylist_ext_start): Likewise.
+ * opassuan.c (gpgme_op_assuan_transact_start)
+ (gpgme_op_assuan_transact_ext): Likewise.
+ * passwd.c (gpgme_op_passwd_start, gpgme_op_passwd): Likewise.
+ * sign.c (gpgme_op_sign_start, gpgme_op_sign): Likewise.
+ * trustlist.c (gpgme_op_trustlist_start)
+ (gpgme_op_trustlist_next): Likewise.
+ * verify.c (gpgme_op_verify_start, gpgme_get_sig_key): Likewise.
+ * op-support.c (_gpgme_op_data_lookup): Likewise.
+ * vfs-create.c (gpgme_op_vfs_transact, gpgme_op_vfs_create): Likewise.
+ * vfs-mount.c (gpgme_op_vfs_mount, gpgme_op_vfs_transact): Likewise.
+ * gpgme.c (gpgme_set_protocol)
+ (gpgme_set_sub_protocol)
+ (gpgme_set_armor, gpgme_set_include_certs)
+ (gpgme_set_keylist_mode, gpgme_set_passphrase_cb)
+ (gpgme_set_progress_cb, gpgme_set_io_cbs, gpgme_set_locale)
+ (gpgme_ctx_set_engine_info, gpgme_sig_notation_clear): Likewise.
+ * gpgme.c (gpgme_new): Check for valid R_CTX.
+ (gpgme_cancel, gpgme_cancel_async, gpgme_release): Likewise.
+
2011-04-06 Werner Koch <wk@g10code.com>
* gpgme-config.in: Add option --host. Change options --cflags and
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_decrypt_verify_start", ctx,
"cipher=%p, plain=%p", cipher, plain);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = decrypt_verify_start (ctx, 0, cipher, plain);
return TRACE_ERR (err);
}
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_decrypt_verify", ctx,
"cipher=%p, plain=%p", cipher, plain);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = decrypt_verify_start (ctx, 1, cipher, plain);
if (!err)
err = _gpgme_wait_one (ctx);
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_decrypt_start", ctx,
"cipher=%p, plain=%p", cipher, plain);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = decrypt_start (ctx, 0, cipher, plain);
return TRACE_ERR (err);
}
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_decrypt", ctx,
"cipher=%p, plain=%p", cipher, plain);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = decrypt_start (ctx, 1, cipher, plain);
if (!err)
err = _gpgme_wait_one (ctx);
"key=%p (%s), allow_secret=%i", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", allow_secret);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = delete_start (ctx, 0, key, allow_secret);
return TRACE_ERR (err);
}
"key=%p (%s), allow_secret=%i", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", allow_secret);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = delete_start (ctx, 1, key, allow_secret);
if (!err)
err = _gpgme_wait_one (ctx);
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = edit_start (ctx, 0, 0, key, fnc, fnc_value, out);
return err;
}
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = edit_start (ctx, 1, 0, key, fnc, fnc_value, out);
if (!err)
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = edit_start (ctx, 0, 1, key, fnc, fnc_value, out);
return err;
}
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = edit_start (ctx, 1, 1, key, fnc, fnc_value, out);
if (!err)
err = _gpgme_wait_one (ctx);
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_encrypt_sign_start", ctx,
"flags=0x%x, plain=%p, cipher=%p", flags, plain, cipher);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && recp)
{
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_encrypt_sign", ctx,
"flags=0x%x, plain=%p, cipher=%p", flags, plain, cipher);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && recp)
{
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_encrypt_start", ctx,
"flags=0x%x, plain=%p, cipher=%p", flags, plain, cipher);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && recp)
{
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_encrypt", ctx,
"flags=0x%x, plain=%p, cipher=%p", flags, plain, cipher);
-
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
if (_gpgme_debug_trace () && recp)
{
int i = 0;
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_export_start", ctx,
"pattern=%s, mode=0x%x, keydata=%p", pattern, mode, keydata);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = export_start (ctx, 0, pattern, mode, keydata);
return TRACE_ERR (err);
}
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_export", ctx,
"pattern=%s, mode=0x%x, keydata=%p", pattern, mode, keydata);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = export_start (ctx, 1, pattern, mode, keydata);
if (!err)
err = _gpgme_wait_one (ctx);
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_export_ext_start", ctx,
"mode=0x%x, keydata=%p", mode, keydata);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
if (_gpgme_debug_trace () && pattern)
{
int i = 0;
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_export_ext_start", ctx,
"mode=0x%x, keydata=%p", mode, keydata);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
if (_gpgme_debug_trace () && pattern)
{
int i = 0;
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_export_keys_start", ctx,
"mode=0x%x, keydata=%p", mode, keydata);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && keys)
{
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_export_keys", ctx,
"mode=0x%x, keydata=%p", mode, keydata);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && keys)
{
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_genkey_start", ctx,
"pubkey=%p, seckey=%p", pubkey, seckey);
TRACE_LOGBUF (parms, strlen (parms));
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = genkey_start (ctx, 0, parms, pubkey, seckey);
return TRACE_ERR (err);
}
"pubkey=%p, seckey=%p", pubkey, seckey);
TRACE_LOGBUF (parms, strlen (parms));
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = genkey_start (ctx, 1, parms, pubkey, seckey);
if (!err)
err = _gpgme_wait_one (ctx);
gpg_error_t err;
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_getauditlog_start", ctx,
"output=%p, flags=0x%x", output, flags);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = getauditlog_start (ctx, 0, output, flags);
return TRACE_ERR (err);
}
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_getauditlog", ctx,
"output=%p, flags=0x%x", output, flags);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = getauditlog_start (ctx, 1, output, flags);
if (!err)
err = _gpgme_wait_one (ctx);
{
#ifdef ENABLE_GPGCONF
gpgme_error_t err;
- gpgme_protocol_t proto = ctx->protocol;
+ gpgme_protocol_t proto;
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
+ proto = ctx->protocol;
ctx->protocol = GPGME_PROTOCOL_GPGCONF;
err = _gpgme_op_reset (ctx, 1);
if (err)
{
#ifdef ENABLE_GPGCONF
gpgme_error_t err;
- gpgme_protocol_t proto = ctx->protocol;
+ gpgme_protocol_t proto;
+
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
+ proto = ctx->protocol;
ctx->protocol = GPGME_PROTOCOL_GPGCONF;
err = _gpgme_op_reset (ctx, 1);
if (err)
if (_gpgme_selftest)
return TRACE_ERR (gpgme_error (_gpgme_selftest));
+ if (!r_ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
ctx = calloc (1, sizeof *ctx);
if (!ctx)
return TRACE_ERR (gpg_error_from_errno (errno));
TRACE_BEG (DEBUG_CTX, "gpgme_cancel", ctx);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = _gpgme_cancel_with_err (ctx, gpg_error (GPG_ERR_CANCELED), 0);
return TRACE_ERR (err);
{
TRACE_BEG (DEBUG_CTX, "gpgme_cancel_async", ctx);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
LOCK (ctx->lock);
ctx->canceled = 1;
UNLOCK (ctx->lock);
{
TRACE (DEBUG_CTX, "gpgme_release", ctx);
+ if (!ctx)
+ return;
+
_gpgme_engine_release (ctx->engine);
_gpgme_fd_table_deinit (&ctx->fdt);
_gpgme_release_result (ctx);
&& protocol != GPGME_PROTOCOL_UISERVER)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
if (ctx->protocol != protocol)
{
/* Shut down the engine when switching protocols. */
"ctx->protocol=%i (%s)", ctx->protocol,
gpgme_get_protocol_name (ctx->protocol)
? gpgme_get_protocol_name (ctx->protocol) : "invalid");
+
return ctx->protocol;
}
TRACE2 (DEBUG_CTX, "gpgme_set_sub_protocol", ctx, "protocol=%i (%s)",
protocol, gpgme_get_protocol_name (protocol)
? gpgme_get_protocol_name (protocol) : "invalid");
+
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
ctx->sub_protocol = protocol;
return 0;
}
"ctx->sub_protocol=%i (%s)", ctx->sub_protocol,
gpgme_get_protocol_name (ctx->sub_protocol)
? gpgme_get_protocol_name (ctx->sub_protocol) : "invalid");
+
return ctx->sub_protocol;
}
{
TRACE2 (DEBUG_CTX, "gpgme_set_armor", ctx, "use_armor=%i (%s)",
use_armor, use_armor ? "yes" : "no");
+
+ if (!ctx)
+ return;
+
ctx->use_armor = use_armor;
}
{
TRACE2 (DEBUG_CTX, "gpgme_set_textmode", ctx, "use_textmode=%i (%s)",
use_textmode, use_textmode ? "yes" : "no");
+
+ if (!ctx)
+ return;
+
ctx->use_textmode = use_textmode;
}
void
gpgme_set_include_certs (gpgme_ctx_t ctx, int nr_of_certs)
{
+ if (!ctx)
+ return;
+
if (nr_of_certs == GPGME_INCLUDE_CERTS_DEFAULT)
ctx->include_certs = GPGME_INCLUDE_CERTS_DEFAULT;
else if (nr_of_certs < -2)
TRACE1 (DEBUG_CTX, "gpgme_set_keylist_mode", ctx, "keylist_mode=0x%x",
mode);
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
ctx->keylist_mode = mode;
return 0;
}
{
TRACE2 (DEBUG_CTX, "gpgme_set_passphrase_cb", ctx,
"passphrase_cb=%p/%p", cb, cb_value);
+
+ if (!ctx)
+ return;
+
ctx->passphrase_cb = cb;
ctx->passphrase_cb_value = cb_value;
}
{
TRACE2 (DEBUG_CTX, "gpgme_set_progress_cb", ctx, "progress_cb=%p/%p",
cb, cb_value);
+
+ if (!ctx)
+ return;
+
ctx->progress_cb = cb;
ctx->progress_cb_value = cb_value;
}
void
gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs)
{
+ if (!ctx)
+ return;
+
if (io_cbs)
{
TRACE6 (DEBUG_CTX, "gpgme_set_io_cbs", ctx,
TRACE_BEG2 (DEBUG_CTX, "gpgme_set_locale", ctx,
"category=%i, value=%s", category, value ? value : "(null)");
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
#define PREPARE_ONE_LOCALE(lcat, ucat) \
if (!failed && value \
&& (category == LC_ALL || category == LC_ ## ucat)) \
? gpgme_get_protocol_name (proto) : "unknown",
file_name ? file_name : "(default)",
home_dir ? home_dir : "(default)");
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
/* Shut down the engine when changing engine info. */
if (ctx->engine)
gpgme_sig_notation_clear (gpgme_ctx_t ctx)
{
TRACE (DEBUG_CTX, "gpgme_sig_notation_clear", ctx);
+
+ if (!ctx)
+ return;
+
_gpgme_sig_notation_clear (ctx);
}
TRACE_BEG1 (DEBUG_CTX, "gpgme_op_import_start", ctx,
"keydata=%p", keydata);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = _gpgme_op_import_start (ctx, 0, keydata);
return TRACE_ERR (err);
}
TRACE_BEG1 (DEBUG_CTX, "gpgme_op_import", ctx,
"keydata=%p", keydata);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = _gpgme_op_import_start (ctx, 1, keydata);
if (!err)
err = _gpgme_wait_one (ctx);
gpg_error_t err;
TRACE_BEG (DEBUG_CTX, "gpgme_op_import_keys_start", ctx);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
if (_gpgme_debug_trace () && keys)
{
int i = 0;
gpgme_error_t err;
TRACE_BEG (DEBUG_CTX, "gpgme_op_import_keys", ctx);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
if (_gpgme_debug_trace () && keys)
{
int i = 0;
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_keylist_start", ctx,
"pattern=%s, secret_only=%i", pattern, secret_only);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = _gpgme_op_reset (ctx, 2);
if (err)
return TRACE_ERR (err);
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_keylist_ext_start", ctx,
"secret_only=%i, reserved=0x%x", secret_only, reserved);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = _gpgme_op_reset (ctx, 2);
if (err)
return TRACE_ERR (err);
_gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_id_t type, void **hook,
int size, void (*cleanup) (void *))
{
- struct ctx_op_data *data = ctx->op_data;
+ struct ctx_op_data *data;
+
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
+ data = ctx->op_data;
while (data && data->type != type)
data = data->next;
if (!data)
command, data_cb, data_cb_value, inq_cb, inq_cb_value,
status_cb, status_cb_value);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = opassuan_start (ctx, 0, command, data_cb, data_cb_value,
inq_cb, inq_cb_value, status_cb, status_cb_value);
return TRACE_ERR (err);
command, data_cb, data_cb_value, inq_cb, inq_cb_value,
status_cb, status_cb_value, op_err_p);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = opassuan_start (ctx, 1, command,
data_cb, data_cb_value,
inq_cb, inq_cb_value,
TRACE (DEBUG_CTX, "gpgme_op_assuan_transact", ctx);
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
/* Users of the old-style session based interfaces need to look at
the result structure. */
err = gpgme_op_assuan_transact_ext (ctx, command, data_cb, data_cb_value,
gpg_error_t err;
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_passwd_start", ctx,
"key=%p, flags=0x%x", key, flags);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = passwd_start (ctx, 0, key, flags);
return TRACE_ERR (err);
}
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_passwd", ctx,
"key=%p, flags=0x%x", key, flags);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = passwd_start (ctx, 1, key, flags);
if (!err)
err = _gpgme_wait_one (ctx);
gpg_error_t err;
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_sign_start", ctx,
"plain=%p, sig=%p, mode=%i", plain, sig, mode);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = sign_start (ctx, 0, plain, sig, mode);
return TRACE_ERR (err);
}
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_sign", ctx,
"plain=%p, sig=%p, mode=%i", plain, sig, mode);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = sign_start (ctx, 1, plain, sig, mode);
if (!err)
err = _gpgme_wait_one (ctx);
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_trustlist_start", ctx,
"pattern=%s, max_level=%i", pattern, max_level);
- if (!pattern || !*pattern)
+ if (!ctx || !pattern || !*pattern)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = _gpgme_op_reset (ctx, 2);
TRACE_BEG (DEBUG_CTX, "gpgme_op_trustlist_next", ctx);
- if (!r_item)
+ if (!ctx || !r_item)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
*r_item = NULL;
if (!ctx)
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_verify_start", ctx,
"sig=%p, signed_text=%p, plaintext=%p",
sig, signed_text, plaintext);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = verify_start (ctx, 0, sig, signed_text, plaintext);
return TRACE_ERR (err);
}
"sig=%p, signed_text=%p, plaintext=%p",
sig, signed_text, plaintext);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = verify_start (ctx, 1, sig, signed_text, plaintext);
if (!err)
err = _gpgme_wait_one (ctx);
gpgme_verify_result_t result;
gpgme_signature_t sig;
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
result = gpgme_op_verify_result (ctx);
sig = result->signatures;
gpgme_error_t *op_err)
{
gpgme_error_t err;
+
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
err = vfs_start (ctx, 1, command, data_cb, data_cb_value,
inq_cb, inq_cb_value, status_cb, status_cb_value);
"container_file=%s, flags=0x%x, op_err=%p",
container_file, flags, op_err);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
if (_gpgme_debug_trace () && recp)
{
int i = 0;
gpgme_error_t *op_err)
{
gpgme_error_t err;
+
+ if (!ctx)
+ return gpg_error (GPG_ERR_INV_VALUE);
err = vfs_start (ctx, 1, command, data_cb, data_cb_value,
inq_cb, inq_cb_value, status_cb, status_cb_value);
TRACE_BEG4 (DEBUG_CTX, "gpgme_op_vfs_mount", ctx,
"container=%s, mount_dir=%s, flags=0x%x, op_err=%p",
container_file, mount_dir, flags, op_err);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = _gpgme_op_vfs_mount (ctx, container_file, mount_dir, flags, op_err);
return TRACE_ERR (err);
}