2006-06-22 Marcus Brinkmann <marcus@g10code.de>

* keylist.c (gpgme_get_key): Also clone the engine info.
This commit is contained in:
Marcus Brinkmann 2006-06-22 17:20:47 +00:00
parent 0a8808623a
commit fca694b372
2 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2006-06-22 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (gpgme_get_key): Also clone the engine info.
2006-03-06 Marcus Brinkmann <marcus@g10code.de> 2006-03-06 Marcus Brinkmann <marcus@g10code.de>
* gpgme-config.in (cflags_pth): Revert accidential removal of * gpgme-config.in (cflags_pth): Revert accidential removal of

View File

@ -939,8 +939,22 @@ gpgme_get_key (gpgme_ctx_t ctx, const char *fpr, gpgme_key_t *r_key,
err = gpgme_new (&listctx); err = gpgme_new (&listctx);
if (err) if (err)
return err; return err;
gpgme_set_protocol (listctx, gpgme_get_protocol (ctx)); {
gpgme_set_keylist_mode (listctx, ctx->keylist_mode); gpgme_protocol_t proto;
gpgme_engine_info_t info;
/* Clone the relevant state. */
proto = gpgme_get_protocol (ctx);
gpgme_set_protocol (listctx, proto);
gpgme_set_keylist_mode (listctx, gpgme_get_keylist_mode (ctx));
info = gpgme_ctx_get_engine_info (ctx);
while (info && info->protocol != proto)
info = info->next;
if (info)
gpgme_ctx_set_engine_info (listctx, proto,
info->file_name, info->home_dir);
}
err = gpgme_op_keylist_start (listctx, fpr, secret); err = gpgme_op_keylist_start (listctx, fpr, secret);
if (!err) if (!err)
err = gpgme_op_keylist_next (listctx, r_key); err = gpgme_op_keylist_next (listctx, r_key);