diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index b446e6a5..d1342550 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,7 @@ +2006-06-22 Marcus Brinkmann + + * keylist.c (gpgme_get_key): Also clone the engine info. + 2006-03-06 Marcus Brinkmann * gpgme-config.in (cflags_pth): Revert accidential removal of diff --git a/gpgme/keylist.c b/gpgme/keylist.c index 28129753..b6190162 100644 --- a/gpgme/keylist.c +++ b/gpgme/keylist.c @@ -939,8 +939,22 @@ gpgme_get_key (gpgme_ctx_t ctx, const char *fpr, gpgme_key_t *r_key, err = gpgme_new (&listctx); if (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); if (!err) err = gpgme_op_keylist_next (listctx, r_key);