From df58e024e71b100a1557b1023d35b2a0092a8748 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sat, 29 Jun 2002 14:01:53 +0000 Subject: * gpgsm.c: New option --auto-issuer-key-retrieve. * certpath.c (find_up): Try to retrieve an issuer key from an external source and from the ephemeral key DB. (find_up_store_certs_cb): New. * keydb.c (keydb_set_ephemeral): Does now return the old state. Call the backend only when required. * call-dirmngr.c (start_dirmngr): Use GNUPG_DEFAULT_DIRMNGR. (lookup_status_cb): Issue status only when CTRL is not NULL. (gpgsm_dirmngr_lookup): Document that CTRL is optional. * call-agent.c (start_agent): Use GNUPG_DEFAULT_AGENT. --- sm/keydb.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'sm/keydb.c') diff --git a/sm/keydb.c b/sm/keydb.c index bc4721418..52f40f1ad 100644 --- a/sm/keydb.c +++ b/sm/keydb.c @@ -59,7 +59,7 @@ struct keydb_handle { int locked; int found; int current; - int ephemeral; + int is_ephemeral; int used; /* items in active */ struct resource_item active[MAX_KEYDB_RESOURCES]; }; @@ -332,27 +332,34 @@ keydb_get_resource_name (KEYDB_HANDLE hd) return s? s: ""; } +/* Switch the handle into ephemeral mode and return the orginal value. */ int keydb_set_ephemeral (KEYDB_HANDLE hd, int yes) { int i; if (!hd) - return GNUPG_Invalid_Value; + return 0; - for (i=0; i < hd->used; i++) + yes = !!yes; + if (hd->is_ephemeral != yes) { - switch (hd->active[i].type) + for (i=0; i < hd->used; i++) { - case KEYDB_RESOURCE_TYPE_NONE: - break; - case KEYDB_RESOURCE_TYPE_KEYBOX: - keybox_set_ephemeral (hd->active[i].u.kr, yes); - break; + switch (hd->active[i].type) + { + case KEYDB_RESOURCE_TYPE_NONE: + break; + case KEYDB_RESOURCE_TYPE_KEYBOX: + keybox_set_ephemeral (hd->active[i].u.kr, yes); + break; + } } } - - return 0; + + i = hd->is_ephemeral; + hd->is_ephemeral = yes; + return i; } -- cgit v1.2.3